[mapguide-commits] r9057 - trunk/Tools/Maestro/MgCooker

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Sep 30 06:03:40 PDT 2016


Author: jng
Date: 2016-09-30 06:03:39 -0700 (Fri, 30 Sep 2016)
New Revision: 9057

Modified:
   trunk/Tools/Maestro/MgCooker/SetupRun.cs
Log:
Fix #2744: InvalidCastException when editing override coordinates for a selected TileSetDefinition

Modified: trunk/Tools/Maestro/MgCooker/SetupRun.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.cs	2016-09-27 07:23:24 UTC (rev 9056)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.cs	2016-09-30 13:03:39 UTC (rev 9057)
@@ -578,9 +578,14 @@
             if (!m_coordinateOverrides.ContainsKey(root.Text))
             {
                 //IEnvelope newbox = new OSGeo.MapGuide.IEnvelope();
-                IEnvelope origbox = ((IMapDefinition)root.Tag).Extents;
+                IMapDefinition mdf = root.Tag as IMapDefinition;
+                ITileSetDefinition tdf = root.Tag as ITileSetDefinition;
+                IEnvelope origbox = null;
+                if (mdf != null)
+                    origbox = mdf.Extents;
+                else if (tdf != null)
+                    origbox = tdf.Extents;
                 IEnvelope newbox = origbox.Clone();
-
                 m_coordinateOverrides.Add(root.Text, newbox);
             }
 



More information about the mapguide-commits mailing list