[fusion-commits] r1935 - in trunk: layers/MapGuide layers/MapGuide/php templates/mapguide/standard

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Oct 7 16:33:04 EDT 2009


Author: madair
Date: 2009-10-07 16:33:03 -0400 (Wed, 07 Oct 2009)
New Revision: 1935

Modified:
   trunk/layers/MapGuide/MapGuide.js
   trunk/layers/MapGuide/php/LoadMap.php
   trunk/templates/mapguide/standard/ApplicationDefinition.xml
Log:
re #247: make equivalent changes for MapGuide

Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js	2009-10-07 15:29:35 UTC (rev 1934)
+++ trunk/layers/MapGuide/MapGuide.js	2009-10-07 20:33:03 UTC (rev 1935)
@@ -296,6 +296,9 @@
             //TODO: consider passing the metersPerUnit value into the framework
             //to allow for scaling that doesn't match any of the pre-canned units
             this.units = Fusion.getClosestUnits(o.metersPerUnit);
+            if (this.projCode) {
+              this.mapWidget.setProjection(this.projCode);
+            }
 
             //add in scales array if supplied
             if (o.FiniteDisplayScales && o.FiniteDisplayScales.length>0) {

Modified: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php	2009-10-07 15:29:35 UTC (rev 1934)
+++ trunk/layers/MapGuide/php/LoadMap.php	2009-10-07 20:33:03 UTC (rev 1935)
@@ -71,18 +71,26 @@
     @$oMax = $extents->GetUpperRightCoordinate();
 
     @$srs = $map->GetMapSRS();
+    $epsgCode = "";
     if($srs != "")
     {
       @$csFactory = new MgCoordinateSystemFactory();
       @$cs = $csFactory->Create($srs);
       @$metersPerUnit = $cs->ConvertCoordinateSystemUnitsToMeters(1.0);
+      try {
+        $epsgCode = $csFactory->ConvertWktToEpsgCode($srs);
+      } catch (MgException $e) {
+        //just catch the exception and set epsgCode to empty string
+      }
+      
+
       //  $unitsType = $cs->GetUnits();
     }
     else
     {
       $metersPerUnit = 1.0;
       //$unitsType = "Meters";
-    }   
+    }
 
 
     header('Content-type: application/json');
@@ -91,6 +99,8 @@
     $mapObj->sessionId = $sessionID;
     $mapObj->mapId = $mapid;
     $mapObj->metersPerUnit = $metersPerUnit;
+    $mapObj->wkt = $srs;
+    $mapObj->epsg = $epsgCode;
     $mapObj->siteVersion = GetSiteVersion();
 
     $mapObj->mapTitle=addslashes($mapTitle);

Modified: trunk/templates/mapguide/standard/ApplicationDefinition.xml
===================================================================
--- trunk/templates/mapguide/standard/ApplicationDefinition.xml	2009-10-07 15:29:35 UTC (rev 1934)
+++ trunk/templates/mapguide/standard/ApplicationDefinition.xml	2009-10-07 20:33:03 UTC (rev 1935)
@@ -64,6 +64,8 @@
         <Type>MapGuide</Type>
         <SingleTile>false</SingleTile>
         <Extension>
+          <ProjectionCode>EPSG:42304</ProjectionCode>
+          <ProjectionDef>+title=LCC +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs</ProjectionDef>
           <ResourceId>Library://Samples/Gmap/Maps/gmapTiled.MapDefinition</ResourceId>
         </Extension>
       </Map>
@@ -74,6 +76,8 @@
         <SingleTile>false</SingleTile>
         <Extension>
           <ResourceId>Library://Samples/Gmap/Maps/gmap.MapDefinition</ResourceId>
+          <ProjectionCode>EPSG:42304</ProjectionCode>
+          <ProjectionDef>+title=LCC +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs</ProjectionDef>
         </Extension>
       </Map>
     </MapGroup>
@@ -139,7 +143,7 @@
       </Item>
       <Item xsi:type="WidgetItemType">
         <Function>Widget</Function>
-        <Widget>menuBuffer</Widget>
+        <Widget>toolbarBuffer</Widget>
       </Item>
     </Container>
 
@@ -1114,7 +1118,7 @@
       <Type>MapMenu</Type>
       <StatusText/>
       <Extension>
-        <Folder>Library://Samples/Sheboygan/</Folder>
+        <!--Folder>Library://Samples/Sheboygan/</Folder-->
       </Extension>
       <ImageUrl/>
       <ImageClass/>
@@ -1131,6 +1135,7 @@
       <Type>OverviewMap</Type>
       <Description/>
       <Extension xsi:type="CustomContentType">
+        <MapId>sheboygan</MapId>
       </Extension>
     </Widget>
     



More information about the fusion-commits mailing list