[fusion-commits] r2141 - sandbox/adsk/2.2gp/layers/MapGuide/php trunk/layers/MapGuide/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Apr 14 17:53:46 EDT 2010


Author: chrisclaydon
Date: 2010-04-14 17:53:46 -0400 (Wed, 14 Apr 2010)
New Revision: 2141

Modified:
   sandbox/adsk/2.2gp/layers/MapGuide/php/LoadMap.php
   trunk/layers/MapGuide/php/LoadMap.php
Log:
Fixes #382 - Redline: features cannot display in the map with commercial layer after upload

Modified: sandbox/adsk/2.2gp/layers/MapGuide/php/LoadMap.php
===================================================================
--- sandbox/adsk/2.2gp/layers/MapGuide/php/LoadMap.php	2010-04-14 17:34:06 UTC (rev 2140)
+++ sandbox/adsk/2.2gp/layers/MapGuide/php/LoadMap.php	2010-04-14 21:53:46 UTC (rev 2141)
@@ -84,6 +84,13 @@
       @$metersPerUnit = $cs->ConvertCoordinateSystemUnitsToMeters(1.0);
       try {
         $epsgCode = $csFactory->ConvertWktToEpsgCode($srs);
+
+        // Convert EPSG code 3857 to the equivalent code 900913 that is understood by OpenLayers
+        if($epsgCode == 3857)
+        {
+            $epsgCode = 900913;
+        }
+
       } catch (MgException $e) {
         //just catch the exception and set epsgCode to empty string
       }
@@ -152,11 +159,11 @@
         $layerObj->isBaseMapLayer = $isBaseMapLayer;
         if($isBaseMapLayer)
         {
-        	$mapObj->hasBaseMapLayers = true;
+            $mapObj->hasBaseMapLayers = true;
         }
         else
         {
-        	$mapObj->hasDynamicLayers = true;
+            $mapObj->hasDynamicLayers = true;
         }
 
         $layerObj->legendLabel = addslashes($layer->GetLegendLabel());

Modified: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php	2010-04-14 17:34:06 UTC (rev 2140)
+++ trunk/layers/MapGuide/php/LoadMap.php	2010-04-14 21:53:46 UTC (rev 2141)
@@ -84,6 +84,13 @@
       @$metersPerUnit = $cs->ConvertCoordinateSystemUnitsToMeters(1.0);
       try {
         $epsgCode = $csFactory->ConvertWktToEpsgCode($srs);
+
+        // Convert EPSG code 3857 to the equivalent code 900913 that is understood by OpenLayers
+        if($epsgCode == 3857)
+        {
+            $epsgCode = 900913;
+        }
+
       } catch (MgException $e) {
         //just catch the exception and set epsgCode to empty string
       }
@@ -152,11 +159,11 @@
         $layerObj->isBaseMapLayer = $isBaseMapLayer;
         if($isBaseMapLayer)
         {
-        	$mapObj->hasBaseMapLayers = true;
+            $mapObj->hasBaseMapLayers = true;
         }
         else
         {
-        	$mapObj->hasDynamicLayers = true;
+            $mapObj->hasDynamicLayers = true;
         }
 
         $layerObj->legendLabel = addslashes($layer->GetLegendLabel());



More information about the fusion-commits mailing list