[fusion-commits] r2076 - in trunk: layers/Generic lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Feb 18 14:48:55 EST 2010
Author: madair
Date: 2010-02-18 14:48:54 -0500 (Thu, 18 Feb 2010)
New Revision: 2076
Modified:
trunk/layers/Generic/Generic.js
trunk/lib/ApplicationDefinition.js
Log:
re #315: set projection and units corrrectly for Generic layers
Modified: trunk/layers/Generic/Generic.js
===================================================================
--- trunk/layers/Generic/Generic.js 2010-02-17 18:44:38 UTC (rev 2075)
+++ trunk/layers/Generic/Generic.js 2010-02-18 19:48:54 UTC (rev 2076)
@@ -166,12 +166,22 @@
}
if (!this.oLayerOL) {
- if (!this.mapTag.layerOptions.maxExtent) {
- this.mapTag.layerOptions.maxExtent = new OpenLayers.Bounds(-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892);
- }
if (typeof this.mapTag.layerOptions.sphericalMercator == 'undefined') {
this.mapTag.layerOptions.sphericalMercator = true;
}
+ if (this.mapTag.layerOptions.sphericalMercator) {
+ if (!this.mapTag.layerOptions.maxExtent) {
+ this.mapTag.layerOptions.maxExtent = new OpenLayers.Bounds(-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892);
+ }
+ this.mapTag.layerOptions.units = "m";
+ this.mapTag.layerOptions.projection = "EPSG:900913";
+ } else {
+ if (!this.mapTag.layerOptions.maxExtent) {
+ this.mapTag.layerOptions.maxExtent = new OpenLayers.Bounds(-180,-90,180,90);
+ }
+ this.mapTag.layerOptions.units = "dd";
+ this.mapTag.layerOptions.projection = "EPSG:4326";
+ }
if (typeof this.mapTag.layerOptions.numZoomLevels == 'undefined') {
this.mapTag.layerOptions.numZoomLevels = 20;
}
@@ -180,6 +190,7 @@
this.mapWidget.oMapOL.setOptions({fractionalZoom: false});
}
+
this.oLayerOL.events.register("loadstart", this, this.loadStart);
this.oLayerOL.events.register("loadend", this, this.loadEnd);
this.oLayerOL.events.register("loadcancel", this, this.loadEnd);
Modified: trunk/lib/ApplicationDefinition.js
===================================================================
--- trunk/lib/ApplicationDefinition.js 2010-02-17 18:44:38 UTC (rev 2075)
+++ trunk/lib/ApplicationDefinition.js 2010-02-18 19:48:54 UTC (rev 2076)
@@ -526,6 +526,7 @@
}
//projection info from the extension
+ this.projCode = "EPSG:4326"; //default to WGS84 lat long
if (this.extension.ProjectionCode) {
this.projCode = this.extension.ProjectionCode[0];
}
More information about the fusion-commits
mailing list