[fusion-commits] r2042 - in sandbox/jxlib-3.0: layers/MapServer/php widgets widgets/Legend

svn_fusion at osgeo.org svn_fusion at osgeo.org
Fri Jan 22 16:19:40 EST 2010


Author: madair
Date: 2010-01-22 16:19:39 -0500 (Fri, 22 Jan 2010)
New Revision: 2042

Added:
   sandbox/jxlib-3.0/layers/MapServer/php/SelectionCSV.php
Modified:
   sandbox/jxlib-3.0/widgets/InvokeURL.js
   sandbox/jxlib-3.0/widgets/Legend.js
   sandbox/jxlib-3.0/widgets/Legend/Legend.css
Log:
fixing layerInfo icon in legend and error in CSS class name; adding SelectionCSV.php

Added: sandbox/jxlib-3.0/layers/MapServer/php/SelectionCSV.php
===================================================================
--- sandbox/jxlib-3.0/layers/MapServer/php/SelectionCSV.php	                        (rev 0)
+++ sandbox/jxlib-3.0/layers/MapServer/php/SelectionCSV.php	2010-01-22 21:19:39 UTC (rev 2042)
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Selection
+ *
+ * $Id: Selection.php 1806 2009-03-04 20:38:53Z pdeschamps $
+ *
+ * Copyright (c) 2007, DM Solutions Group Inc.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*****************************************************************************
+ * Purpose: Get all attribute informations for elements in the 
+ * current selection
+ *****************************************************************************/
+
+/* set up the session */
+include ("Common.php");
+include('../../../common/php/Utilities.php');
+include ("Utilities.php");
+
+header('Content-type: text/plain');
+
+if (isset($_SESSION['maps']) && isset($_SESSION['maps'][$mapName])) {
+    $oMap = ms_newMapObj($_SESSION['maps'][$mapName]);
+}
+
+$result = NULL;
+$result->layers = array();
+
+if (isset($_REQUEST['queryfile']) && $_REQUEST['queryfile'] != "")
+{
+    $oMap->loadquery($_REQUEST['queryfile']);
+
+
+    if (isset($_SESSION['selection_array']))
+    {
+        //print_r($_SESSION['selection_array']);
+        $bAllLayers = 1;
+        $aLayers = array();
+        if (isset($_REQUEST['layers']) && $_REQUEST['layers'] !='')
+        {
+            $aLayers = split(",", $_REQUEST['layers']);
+            $bAllLayers = 0;
+        }
+
+        $properties = $_SESSION['selection_array'];
+        $aSelectedLayers = $properties->layers;
+        if (count($aSelectedLayers) > 0)
+        {
+            for ($i=0; $i<count($aSelectedLayers); $i++)
+            {
+                $layerName =  $aSelectedLayers[$i];
+                echo "Layer: ".$layerName."\n";
+                if (($bAllLayers || in_array($layerName, $aLayers)) &&
+                    $properties->$layerName->numelements > 0)
+                {
+                    echo implode(",",$properties->$layerName->propertyvalues)."\n";
+                    for ($j=0; $j<count($properties->$layerName->values); $j++)
+                    {
+                      echo implode(",",$properties->$layerName->values[$j])."\n";
+                    }
+                }
+            }
+        }
+    }
+}
+
+?>

Modified: sandbox/jxlib-3.0/widgets/InvokeURL.js
===================================================================
--- sandbox/jxlib-3.0/widgets/InvokeURL.js	2010-01-22 17:14:59 UTC (rev 2041)
+++ sandbox/jxlib-3.0/widgets/InvokeURL.js	2010-01-22 21:19:39 UTC (rev 2042)
@@ -68,6 +68,9 @@
         var map = this.getMap();
         if (this.bSelectionOnly || !map) {
             if (map && map.hasSelection()) {
+                if (map.aMaps[0]._sQueryfile) {
+                  this.additionalParameters.push('queryfile='+map.aMaps[0]._sQueryfile);
+                }
                 if (this.action) {
                     this.action.setEnabled(true);
                 } else {
@@ -95,9 +98,9 @@
         
         var map = this.getMap();
         var params = [];
-        params.push('LOCALE='+Fusion.locale);
-        params.push('SESSION='+map.getSessionID());
-        params.push('MAPNAME='+map.getMapName());
+        params.push('locale='+Fusion.locale);
+        params.push('session='+map.getSessionID());
+        params.push('mapname='+map.getMapName());
         params = params.concat(this.additionalParameters);
         if (url.indexOf('?') < 0) {
             url += '?';

Modified: sandbox/jxlib-3.0/widgets/Legend/Legend.css
===================================================================
--- sandbox/jxlib-3.0/widgets/Legend/Legend.css	2010-01-22 17:14:59 UTC (rev 2041)
+++ sandbox/jxlib-3.0/widgets/Legend/Legend.css	2010-01-22 21:19:39 UTC (rev 2042)
@@ -30,6 +30,7 @@
     width: 16px;
     z-index: 2;
     line-height: 20px;
+    text-align: center;
     font-size: 0px;
 }
 
@@ -51,14 +52,22 @@
 }
 
 /* Layer Information Icon */
+.fusionLayerInfo {
+    display: none;
+    position: absolute;
+    right: 1px;
+    top: 0px;
+    height: 20px;
+    width: 16px;
+    z-index: 2;
+    line-height: 20px;
+    font-size: 0px;
+}
+
 .fusionShowLayerInfo .fusionLayerInfo {
     display: block;
 }
 
-.fusionLayerInfo {
-    display: none;
-}
-
 .fusionLayerInfoIcon {
-    
+    vertical-align: middle;
 }

Modified: sandbox/jxlib-3.0/widgets/Legend.js
===================================================================
--- sandbox/jxlib-3.0/widgets/Legend.js	2010-01-22 17:14:59 UTC (rev 2041)
+++ sandbox/jxlib-3.0/widgets/Legend.js	2010-01-22 21:19:39 UTC (rev 2042)
@@ -532,8 +532,7 @@
                     layer.legend.treeItem.empty();
                 }
                 for (var i=0; i<range.styles.length; i++) {
-                    var item = this.createTreeItem(layer,
-                                               range.styles[i], fScale, false);
+                    var item = this.createTreeItem(layer, range.styles[i], fScale, false);
                     layer.legend.treeItem.add(item);
                 }
             /* if there is only one style, we represent it as a tree item */
@@ -635,7 +634,7 @@
             if (style.iconOpt && style.iconOpt.url) {
                 opt.image = style.iconOpt.url;
             } else {
-                opt.image = layer.oMap.getLegendImageURL(scale, layer, style, defaultIcon);
+                opt.image = layer.oMap.getLegendImageURL(scale, layer, style);
             }
         }
 
@@ -700,7 +699,7 @@
 Fusion.Widget.Legend.TreeItem = new Class({
     Extends: Jx.TreeItem,
     options: {
-        template: '<li class="jxTreeContainer jxTreeLeaf"><img class="jxTreeImage" src="'+Jx.aPixel.src+'" alt="" title=""><span class="fusionLegendCheckboxContainer"><input type="checkbox" class="fusionLegendCheckboxInput"></span><a class="jxTreeItem fusionCheckboxItem" href="javascript:void(0);"><img class="jxTreeIcon" src="'+Jx.aPixel.src+'" alt="" title=""><span class="jxTreeLabel"></span></a><a class="fusionLayerInfo"><img class="fusionLayerInfoIcon" src="'+Jx.aPixel.src+'"></a></li>'
+        template: '<li class="jxTreeContainer jxTreeLeaf"><img class="jxTreeImage" src="'+Jx.aPixel.src+'" alt="" title=""><span class="fusionLegendCheckboxContainer"><input type="checkbox" class="fusionLegendCheckboxInput"></span><a class="fusionLayerInfo" target="_blank"><img class="fusionLayerInfoIcon" src="'+Jx.aPixel.src+'"></a><a class="jxTreeItem fusionCheckboxItem" href="javascript:void(0);"><img class="jxTreeIcon" src="'+Jx.aPixel.src+'" alt="" title=""><span class="jxTreeLabel"></span></a></li>'
     },
     classes: new Hash({
         domObj: 'jxTreeContainer', 
@@ -747,7 +746,7 @@
     },
     setLayerInfo: function(url, icon) {
         //change class to make fusionLayerInfo display block
-        this.domObj.addClass('showFusionLayerInfo');
+        this.domObj.addClass('fusionShowLayerInfo');
         if (this.layerInfo) {
             this.layerInfo.set('href', url);
         }
@@ -811,7 +810,7 @@
     },
     setLayerInfo: function(url, icon) {
         //change class to make fusionLayerInfo display block
-        this.domObj.addClass('showFusionLayerInfo');
+        this.domObj.addClass('fusionShowLayerInfo');
         if (this.layerInfo) {
             this.layerInfo.set('href', url);
         }
@@ -822,7 +821,7 @@
     
     setGroupInfo: function(url, icon) {
         //change class to make fusionGroupInfo display block
-        this.domObj.addClass('showFusionGroupInfo');
+        this.domObj.addClass('fusionShowGroupInfo');
         if (this.groupInfo) {
             this.groupInfo.set('href', url);
         }



More information about the fusion-commits mailing list