[mapguide-commits] r6236 - in trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI: Mapping ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Nov 18 10:19:03 EST 2011


Author: jng
Date: 2011-11-18 07:19:03 -0800 (Fri, 18 Nov 2011)
New Revision: 6236

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs
Log:
Add a ForceRefresh() method to RuntimeMapLayer to conditionally modify the NeedsRefresh property (condition being the layer must be potentially visible at the current scale). Also improve the API doc for IMapDefinition.AddLayer()

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2011-11-18 11:42:18 UTC (rev 6235)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2011-11-18 15:19:03 UTC (rev 6236)
@@ -247,6 +247,9 @@
             }
             set
             {
+                if (this.Type == kBaseMap)
+                    throw new InvalidOperationException("Setting visbility of a tiled map layer is not permitted");
+
                 SetField(ref _visible, value, "Visible");
             }
         }
@@ -457,6 +460,17 @@
         }
 
         /// <summary>
+        /// Sets the refresh flag for this layer
+        /// </summary>
+        public void ForceRefresh()
+        {
+            if (!this.IsVisibleAtScale(this.Parent.ViewScale))
+                return;
+
+            this.NeedsRefresh = true;
+        }
+
+        /// <summary>
         /// Gets whether this layer has tooltips
         /// </summary>
         public bool HasTooltips

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs	2011-11-18 11:42:18 UTC (rev 6235)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs	2011-11-18 15:19:03 UTC (rev 6236)
@@ -134,10 +134,10 @@
         /// if this has not been set already.
         /// </summary>
         /// <param name="layerToInsertAbove">The layer to insert above in the draw order</param>
-        /// <param name="groupName"></param>
-        /// <param name="layerName"></param>
-        /// <param name="resourceId"></param>
-        /// <returns></returns>
+        /// <param name="groupName">The name of the group this layer belongs to. If null or empty, this layer will not belong to any group</param>
+        /// <param name="layerName">The name of this layer. This must be unique</param>
+        /// <param name="resourceId">The layer definition id</param>
+        /// <returns>The added layer</returns>
         IMapLayer AddLayer(IMapLayer layerToInsertAbove, string groupName, string layerName, string resourceId);
 
         /// <summary>



More information about the mapguide-commits mailing list