[mapguide-commits] r6263 - trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Nov 29 10:59:13 EST 2011


Author: jng
Date: 2011-11-29 07:59:13 -0800 (Tue, 29 Nov 2011)
New Revision: 6263

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs
Log:
#1873: Add a new property to IMapDefinition (SetExtentsFromFirstAddedLayer) which will determine whether extents of the Map Definition will set from the extents of the first added layer. This will default to false, which only the Map Definition Editor will set to true (to retain existing functionality)

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs	2011-11-29 15:51:12 UTC (rev 6262)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs	2011-11-29 15:59:13 UTC (rev 6263)
@@ -115,6 +115,7 @@
 #if MDF_230
             this.versionField = "2.3.0";
 #endif
+            this.SetExtentsFromFirstAddedLayer = false;
         }
 
 #if MDF_230
@@ -124,6 +125,9 @@
 #endif
 
         [XmlIgnore]
+        public bool SetExtentsFromFirstAddedLayer { get; set; }
+
+        [XmlIgnore]
         public OSGeo.MapGuide.MaestroAPI.IServerConnection CurrentConnection
         {
             get;
@@ -283,6 +287,10 @@
 
         private void OnFirstLayerAdded(MapLayerType layer)
         {
+            //Do nothing if this is false
+            if (!this.SetExtentsFromFirstAddedLayer)
+                return;
+
             string csWkt;
             var ldf = (ILayerDefinition)this.CurrentConnection.ResourceService.GetResource(layer.ResourceId);
             var env = ldf.GetSpatialExtent(true, out csWkt);

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs	2011-11-29 15:51:12 UTC (rev 6262)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinitionInterfaces.cs	2011-11-29 15:59:13 UTC (rev 6263)
@@ -60,6 +60,11 @@
     public interface IMapDefinition : IResource, IMapDefinitionBase, INotifyPropertyChanged
     {
         /// <summary>
+        /// If true, the first layer added to this map definition will automatically set the extents
+        /// based on that layer's added extents. Default is false
+        /// </summary>
+        bool SetExtentsFromFirstAddedLayer { get; set; }
+        /// <summary>
         /// Gets or sets the name.
         /// </summary>
         /// <value>The name.</value>



More information about the mapguide-commits mailing list