[fusion-commits] r2689 - sandbox/adsk/2.4j/layers/MapGuide

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sun Apr 14 18:57:47 PDT 2013


Author: liuar
Date: 2013-04-14 18:57:47 -0700 (Sun, 14 Apr 2013)
New Revision: 2689

Modified:
   sandbox/adsk/2.4j/layers/MapGuide/MapGuide.js
Log:
Submit on behalf of Andy Zhang. Integrate revision 2688 to sandbox/adsk/2.4j.

Enhancement of MapGuide Ticket#434. http://trac.osgeo.org/fusion/ticket/434
There is a case that the wkt string is invalid or outdated. The property wktProj.proj.readyToUse is false in this case. We need to check the value of readyToUse after wktProj object is constructed.

Modified: sandbox/adsk/2.4j/layers/MapGuide/MapGuide.js
===================================================================
--- sandbox/adsk/2.4j/layers/MapGuide/MapGuide.js	2013-04-15 01:09:09 UTC (rev 2688)
+++ sandbox/adsk/2.4j/layers/MapGuide/MapGuide.js	2013-04-15 01:57:47 UTC (rev 2689)
@@ -335,13 +335,16 @@
             var wktProj;
             if (o.wkt && o.wkt.length > 0){
               wktProj = new OpenLayers.Projection(o.wkt);
-            } else if (o.epsg != 0) {
-              this.mapTag.layerOptions.projection = "EPSG:" + o.epsg;
-            } else {
-              //default to the local non-projected system if not otherwise specified
-              o.wkt = "LOCAL_CS[\"Non-Earth (Meter)\",LOCAL_DATUM[\"Local Datum\",0],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]";
-              wktProj = new OpenLayers.Projection(o.wkt);
             }
+            if (!wktProj || (wktProj && wktProj.proj && !wktProj.proj.readyToUse)) {
+              if (o.epsg != 0) {
+                this.mapTag.layerOptions.projection = "EPSG:" + o.epsg;
+              } else {
+                //default to the local non-projected system if not otherwise specified
+                o.wkt = "LOCAL_CS[\"Non-Earth (Meter)\",LOCAL_DATUM[\"Local Datum\",0],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]";
+                wktProj = new OpenLayers.Projection(o.wkt);
+              }
+            }
             //TODO: consider passing the metersPerUnit value into the framework
             //to allow for scaling that doesn't match any of the pre-canned units
             this.mapTag.layerOptions.units = Fusion.getClosestUnits(o.metersPerUnit);
@@ -385,7 +388,7 @@
                 this.oLayerOL = this.createOLLayer(this._sMapname, this.bSingleTile, 2, false, "");
             }
             
-            if (wktProj) {
+            if (wktProj && wktProj.proj && wktProj.proj.readyToUse) {
               this.oLayerOL.projection = wktProj;
               this.oLayerOL.projection.proj.units = this.mapTag.layerOptions.units;
             }



More information about the fusion-commits mailing list