[mapguide-commits] r6624 - in branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI: . Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 8 08:38:31 EDT 2012


Author: jng
Date: 2012-05-08 05:38:30 -0700 (Tue, 08 May 2012)
New Revision: 6624

Modified:
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
Log:
#1976: RuntimeMapLayer fixes. Patch by Hans Milling.

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-05-08 12:34:17 UTC (rev 6623)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-05-08 12:38:30 UTC (rev 6624)
@@ -289,6 +289,7 @@
                         foreach (var layer in group.BaseMapLayer)
                         {
                             var rtl = _mapSvc.CreateMapLayer(this, layer);
+                            rtl.Type = RuntimeMapLayer.kDynamic; //HACK: Setting Visible = true not allowed for kBaseMap
                             rtl.Visible = true;
                             rtl.Type = RuntimeMapLayer.kBaseMap;
                             rtl.Group = group.Name;

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-05-08 12:34:17 UTC (rev 6623)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-05-08 12:38:30 UTC (rev 6624)
@@ -1786,7 +1786,9 @@
             rtLayer.Name = source.Name;
             rtLayer.Selectable = source.Selectable;
             rtLayer.ShowInLegend = source.ShowInLegend;
-            
+            rtLayer.Visible = true; 
+ 	        rtLayer.Type = RuntimeMapLayer.kBaseMap; 
+
             return rtLayer;
         }
 
@@ -1798,9 +1800,15 @@
         /// <returns></returns>
         public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source)
         {
-            var rtLayer = CreateMapLayer(parent, (IBaseMapLayer)source);
+            ILayerDefinition layerDef = (ILayerDefinition)GetResource(source.ResourceId);
+            var rtLayer = CreateMapLayer(parent, layerDef);
 
             //These may not match, so set them here
+            rtLayer.ExpandInLegend = source.ExpandInLegend;
+            rtLayer.LegendLabel = source.LegendLabel;
+            rtLayer.Name = source.Name;
+            rtLayer.Selectable = source.Selectable;
+            rtLayer.ShowInLegend = source.ShowInLegend;
             rtLayer.Group = source.Group;
             rtLayer.Visible = source.Visible;
             



More information about the mapguide-commits mailing list