[fusion-commits] r2335 - trunk/lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Mon Feb 7 14:03:14 EST 2011
Author: assefa
Date: 2011-02-07 11:03:14 -0800 (Mon, 07 Feb 2011)
New Revision: 2335
Modified:
trunk/lib/ApplicationDefinition.js
trunk/lib/Map.js
Log:
Correct restrictedExtent
Modified: trunk/lib/ApplicationDefinition.js
===================================================================
--- trunk/lib/ApplicationDefinition.js 2011-02-07 16:26:48 UTC (rev 2334)
+++ trunk/lib/ApplicationDefinition.js 2011-02-07 19:03:14 UTC (rev 2335)
@@ -518,7 +518,7 @@
this.layerOptions[key] = val;
}
}
- if (key == 'maxExtent' || key == 'minExtent') {
+ if (key == 'maxExtent' || key == 'minExtent' || key == 'restrictedExtent') {
this.layerOptions[key] = OpenLayers.Bounds.fromString(this.layerOptions[key]);
}
if (key == 'resolutions' || key == 'scales') {
Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2011-02-07 16:26:48 UTC (rev 2334)
+++ trunk/lib/Map.js 2011-02-07 19:03:14 UTC (rev 2335)
@@ -526,36 +526,39 @@
*
* Return: none
*/
- addMap: function(map) {
+ addMap: function(currentmap) {
- if (map.mapTag.layerOptions.maxExtent) {
- this.maxExtent.extend(map.mapTag.layerOptions.maxExtent);
+ if (currentmap.mapTag.layerOptions.maxExtent) {
+ this.maxExtent.extend(currentmap.mapTag.layerOptions.maxExtent);
this.oMapOL.setOptions({maxExtent: this.maxExtent});
}
+ if (currentmap.mapTag.layerOptions.restrictedExtent) {
+ this.oMapOL.setOptions({restrictedExtent: currentmap.mapTag.layerOptions.restrictedExtent});
+ }
//if bRestrictExtent is null, use the default OL behaviour with somewhat restricted map navigation
//if bRestrictExtent is set to true, map navigation is limited to the map extent
//if bRestrictExtent is set to false, map navigation is not restricted at all
if (this.bRestrictExtent != null) {
if (this.bRestrictExtent) {
- this.oMapOL.restrictedExtent = map.mapTag.layerOptions.maxExtent;
+ this.oMapOL.restrictedExtent = currentmap.mapTag.layerOptions.maxExtent;
} else {
this.oMapOL.restrictedExtent = false;
}
}
- this.oMapOL.addLayer(map.oLayerOL);
- if (map.oLayerOL.isBaseLayer) {
- this.projection = map.projection;
- this.units = map.units;
+ this.oMapOL.addLayer(currentmap.oLayerOL);
+ if (currentmap.oLayerOL.isBaseLayer) {
+ this.projection = currentmap.projection;
+ this.units = currentmap.units;
this.oMapOL.setOptions({
- units: map.units,
+ units: currentmap.units,
projection: this.projection
});
}
- map.registerForEvent(Fusion.Event.MAP_SELECTION_OFF,
+ currentmap.registerForEvent(Fusion.Event.MAP_SELECTION_OFF,
OpenLayers.Function.bind(this.selectionHandler, this));
- map.registerForEvent(Fusion.Event.MAP_SELECTION_ON,
+ currentmap.registerForEvent(Fusion.Event.MAP_SELECTION_ON,
OpenLayers.Function.bind(this.selectionHandler, this));
},
More information about the fusion-commits
mailing list