[fusion-commits] r2030 - in sandbox/jxlib-3.0: layers
layers/MapGuide/php layers/MapServer layers/MapServer/php lib
widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Jan 5 10:47:33 EST 2010
Author: madair
Date: 2010-01-05 10:47:33 -0500 (Tue, 05 Jan 2010)
New Revision: 2030
Modified:
sandbox/jxlib-3.0/layers/Layers.js
sandbox/jxlib-3.0/layers/MapGuide/php/LoadMap.php
sandbox/jxlib-3.0/layers/MapServer/MapServer.js
sandbox/jxlib-3.0/layers/MapServer/php/LoadMap.php
sandbox/jxlib-3.0/lib/Map.js
sandbox/jxlib-3.0/widgets/ActivityIndicator.js
sandbox/jxlib-3.0/widgets/ScalebarDual.js
Log:
adding support for MapMetadata widget
Modified: sandbox/jxlib-3.0/layers/Layers.js
===================================================================
--- sandbox/jxlib-3.0/layers/Layers.js 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/layers/Layers.js 2010-01-05 15:47:33 UTC (rev 2030)
@@ -108,6 +108,14 @@
getMapTitle: function() {
return this._sMapTitle;
},
+
+ getMetadata: function(key) {
+ if (typeof this.metadata[key] != 'undefined') {
+ return this.metadata[key];
+ } else {
+ return '';
+ }
+ },
/**
* Function: isMapLoaded
@@ -458,8 +466,8 @@
this.visible = o.visible;
this.initiallyVisible = o.visible;
this.selectable = o.selectable;
+ this.metadata = o.metadata;
-
//determine the layer type so that the correct icon can be displayed in the legend
this.layerType = null;
if (this.supportsType(Fusion.Constant.LAYER_RASTER_TYPE)) { //raster layers
Modified: sandbox/jxlib-3.0/layers/MapGuide/php/LoadMap.php
===================================================================
--- sandbox/jxlib-3.0/layers/MapGuide/php/LoadMap.php 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/layers/MapGuide/php/LoadMap.php 2010-01-05 15:47:33 UTC (rev 2030)
@@ -103,6 +103,7 @@
$mapObj->sessionId = $sessionID;
$mapObj->mapId = $mapid;
+ $mapObj->metadata = NULL;
$mapObj->metersPerUnit = $metersPerUnit;
$mapObj->wkt = $srs;
$mapObj->epsg = $epsgCode;
Modified: sandbox/jxlib-3.0/layers/MapServer/MapServer.js
===================================================================
--- sandbox/jxlib-3.0/layers/MapServer/MapServer.js 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/layers/MapServer/MapServer.js 2010-01-05 15:47:33 UTC (rev 2030)
@@ -781,9 +781,29 @@
},
getLayerInfoUrl: function(layerName) {
- return null;
+ var layer = this.getLayerByName(layerName);
+ var metadata = layer.metadata;
+ if (metadata && metadata["LAYERINFOURL"]) {
+ return metadata["LAYERINFOURL"];
+ } else {
+ return null;
+ }
},
+ getLayerByName: function(name)
+ {
+ var oLayer = null;
+ for (var i=0; i<this.aLayers.length; i++)
+ {
+ if (this.aLayers[i].layerName == name)
+ {
+ oLayer = this.aLayers[i];
+ break;
+ }
+ }
+ return oLayer;
+ },
+
getLayerById: function(id)
{
var oLayer = null;
@@ -798,14 +818,6 @@
return oLayer;
},
- getMetadata: function(key) {
- if (typeof this.metadata[key] != 'undefined') {
- return this.metadata[key];
- } else {
- return '';
- }
- },
-
getLegendImageURL: function(fScale, layer, style,defaultIcon) {
var sl = Fusion.getScriptLanguage();
var url = Fusion.getFusionURL() + '/layers/' + this.arch + '/' + sl + '/LegendIcon.' + sl;
@@ -814,6 +826,13 @@
return url + '?'+params;
},
+ getLinkParams: function() {
+ var queryParams = {};
+ queryParams.theme = this.sMapFile;
+
+ return queryParams;
+ },
+
getMapTip: function(oMapTips){
if (!this.aLayers ||
!this.aLayers.length ||
Modified: sandbox/jxlib-3.0/layers/MapServer/php/LoadMap.php
===================================================================
--- sandbox/jxlib-3.0/layers/MapServer/php/LoadMap.php 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/layers/MapServer/php/LoadMap.php 2010-01-05 15:47:33 UTC (rev 2030)
@@ -308,8 +308,8 @@
for ($j=0; $j<$layer->numclasses; $j++) {
$oClass = $layer->getClass($j);
$classObj = NULL;
- // Use formatted legend label as defined by CLASS->TITLE
- $classObj->legendLabel = $oClass->title != '' ? $oClass->title : $oClass->name;
+ // Use formatted legend label as defined by CLASS->TITLE
+ $classObj->legendLabel = $oClass->title != '' ? $oClass->title : $oClass->name;
$classObj->filter = $oClass->getExpression();
$classMin = $oClass->minscale == -1 ? $layerMin : max($oClass->minscale, $layerMin);
$classMax = $oClass->maxscale == -1 ? $layerMax : min($oClass->maxscale, $layerMax);
@@ -324,7 +324,7 @@
}
}
//$layerObj->scaleRanges = $aScaleRanges;
- $_SESSION['scale_ranges'][$mapName][$layer->name] = $aScaleRanges;
+ $_SESSION['scale_ranges'][$mapName][$layer->name] = $aScaleRanges;
/*get the min/max scale for the layer*/
$nCount = count($aScaleRanges);
$layerObj->minScale = $aScaleRanges[0]->minScale;
Modified: sandbox/jxlib-3.0/lib/Map.js
===================================================================
--- sandbox/jxlib-3.0/lib/Map.js 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/lib/Map.js 2010-01-05 15:47:33 UTC (rev 2030)
@@ -329,6 +329,12 @@
return this.aMaps[0]._sMapTitle;
},
+ getMetadata: function(key) {
+ //TODO: what is the map title in the case of multiple map layer objects?
+ //just return baselayer mapTitle for now
+ return this.aMaps[0].getMetadata(key);
+ },
+
getSessionID: function() {
//TODO: what is the mapname in the case of multiple map layer objects?
//just return baselayer session ID for now
Modified: sandbox/jxlib-3.0/widgets/ActivityIndicator.js
===================================================================
--- sandbox/jxlib-3.0/widgets/ActivityIndicator.js 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/widgets/ActivityIndicator.js 2010-01-05 15:47:33 UTC (rev 2030)
@@ -50,6 +50,7 @@
this.getMap().registerForEvent(Fusion.Event.MAP_BUSY_CHANGED,
OpenLayers.Function.bind(this.busyChanged, this));
},
+
busyChanged: function() {
this.element.style.visibility = this.getMap().isBusy() ? 'visible' : 'hidden';
}
Modified: sandbox/jxlib-3.0/widgets/ScalebarDual.js
===================================================================
--- sandbox/jxlib-3.0/widgets/ScalebarDual.js 2010-01-05 07:28:15 UTC (rev 2029)
+++ sandbox/jxlib-3.0/widgets/ScalebarDual.js 2010-01-05 15:47:33 UTC (rev 2030)
@@ -45,6 +45,9 @@
bottomInUnits: bottomInUnits,
bottomOutUnits: bottomOutUnits
};
+ if (this.domObj) {
+ options.div = this.domObj;
+ }
this.addControl(new OpenLayers.Control.ScaleLine(options));
}
});
More information about the fusion-commits
mailing list