[mapguide-commits] r7957 - in trunk/Tools/Maestro: Maestro.Editors/Preview MaestroAPITests MaestroAPITests/UserTestData OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Mapping OSGeo.MapGuide.MaestroAPI/Services OSGeo.MapGuide.MaestroAPI.Local

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 19 22:45:50 PST 2013


Author: jng
Date: 2013-12-19 22:45:50 -0800 (Thu, 19 Dec 2013)
New Revision: 7957

Added:
   trunk/Tools/Maestro/MaestroAPITests/UserTestData/InvalidLayer.xml
   trunk/Tools/Maestro/MaestroAPITests/UserTestData/TestMapWithInvalidLayers.xml
Modified:
   trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
   trunk/Tools/Maestro/MaestroAPITests/ConnectionTestBase.cs
   trunk/Tools/Maestro/MaestroAPITests/HttpConnectionTests.cs
   trunk/Tools/Maestro/MaestroAPITests/LocalConnectionTests.cs
   trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
   trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs
Log:
#2392: Allow RuntimeMap initialization to fail hard. Failing hard means that the first exception thrown by failed RuntimeMapLayer initialization will bubble up instead of being swallowed. RuntimeMap initialization is now set to fail hard on resource preview preparation in local map viewer mode.

New unit tests have been added to exercise RuntimeMap creation from a Map Definition with invalid layers in both loose and strict error modes.

Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -121,7 +121,7 @@
                     }
 
                     if (previewMdf != null)
-                        return mapSvc.CreateMap(previewMdf);
+                        return mapSvc.CreateMap(previewMdf, false);
                     else
                         return null;
                 };

Modified: trunk/Tools/Maestro/MaestroAPITests/ConnectionTestBase.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ConnectionTestBase.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/MaestroAPITests/ConnectionTestBase.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -17,32 +17,21 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 #endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
 using NUnit.Framework;
 using OSGeo.MapGuide.MaestroAPI;
-using OSGeo.MapGuide.MaestroAPI.Services;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
+using OSGeo.MapGuide.MaestroAPI.Feature;
+using OSGeo.MapGuide.MaestroAPI.Internal;
 using OSGeo.MapGuide.MaestroAPI.Resource;
-using System.IO;
-using OSGeo.MapGuide.ObjectModels.Common;
-using OSGeo.MapGuide.ObjectModels;
+using OSGeo.MapGuide.MaestroAPI.Schema;
 using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
-using NUnit.Framework;
-using OSGeo.MapGuide.MaestroAPI;
-using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
+using OSGeo.MapGuide.MaestroAPI.Services;
 using OSGeo.MapGuide.ObjectModels;
 using OSGeo.MapGuide.ObjectModels.Common;
+using OSGeo.MapGuide.ObjectModels.MapDefinition;
 using System;
-using System.Collections.Generic;
 using System.IO;
-using System.Linq;
-using System.Text;
-using OSGeo.MapGuide.MaestroAPI.Schema;
-using OSGeo.MapGuide.MaestroAPI.Commands;
-using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
-using OSGeo.MapGuide.MaestroAPI.Internal;
-using OSGeo.MapGuide.MaestroAPI.Feature;
 
 namespace MaestroAPITests
 {
@@ -526,10 +515,64 @@
 
         public virtual void TestSchemaMapping()
         {
-            var conn = ConnectionUtil.CreateTestHttpConnection();
+            var conn = CreateTestConnection();
             var doc1 = conn.FeatureService.GetSchemaMapping("OSGeo.WMS", "FeatureServer=http://wms.jpl.nasa.gov/wms.cgi");
             Assert.NotNull(doc1);
             Assert.True(doc1 is WmsConfigurationDocument);
         }
+
+        public virtual void TestCreateRuntimeMapWithInvalidLayersErrorsEnabled()
+        {
+            var conn = CreateTestConnection();
+            var resSvc = conn.ResourceService;
+            resSvc.SetResourceXmlData("Library://UnitTests/Maps/SheboyganWithInvalidLayers.MapDefinition", File.OpenRead("UserTestData/TestMapWithInvalidLayers.xml"));
+            resSvc.SetResourceXmlData("Library://UnitTests/Layers/InvalidLayer.LayerDefinition", File.OpenRead("UserTestData/InvalidLayer.xml"));
+
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) < 0)
+            {
+                Assert.Ignore("Connection does not support the Mapping Service");
+            }
+            else
+            {
+                var mapSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+                var mdf = (IMapDefinition)resSvc.GetResource("Library://UnitTests/Maps/SheboyganWithInvalidLayers.MapDefinition");
+                try
+                {
+                    mapSvc.CreateMap(mdf, false);
+                    Assert.Fail("CreateMap should've thrown an exception with suppressErrors = false");
+                }
+                catch (Exception ex)
+                {
+                    Assert.True(true, ex.ToString());
+                }
+            }
+        }
+
+        public virtual void TestCreateRuntimeMapWithInvalidLayersErrorsDisabled()
+        {
+            var conn = CreateTestConnection();
+            var resSvc = conn.ResourceService;
+            resSvc.SetResourceXmlData("Library://UnitTests/Maps/SheboyganWithInvalidLayers.MapDefinition", File.OpenRead("UserTestData/TestMapWithInvalidLayers.xml"));
+            resSvc.SetResourceXmlData("Library://UnitTests/Layers/InvalidLayer.LayerDefinition", File.OpenRead("UserTestData/InvalidLayer.xml"));
+
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) < 0)
+            {
+                Assert.Ignore("Connection does not support the Mapping Service");
+            }
+            else
+            {
+                var mapSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+                var mdf = (IMapDefinition)resSvc.GetResource("Library://UnitTests/Maps/SheboyganWithInvalidLayers.MapDefinition");
+                try
+                {
+                    mapSvc.CreateMap(mdf, true);
+                    Assert.True(true);
+                }
+                catch (Exception ex)
+                {
+                    Assert.Fail("CreateMap with suppressErrors = true should not have thrown an exception: " + ex.ToString());
+                }
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/MaestroAPITests/HttpConnectionTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/HttpConnectionTests.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/MaestroAPITests/HttpConnectionTests.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -76,6 +76,18 @@
             base.TestSchemaMapping();
         }
 
+        [Test]
+        public override void TestCreateRuntimeMapWithInvalidLayersErrorsDisabled()
+        {
+            base.TestCreateRuntimeMapWithInvalidLayersErrorsDisabled();
+        }
+
+        [Test]
+        public override void TestCreateRuntimeMapWithInvalidLayersErrorsEnabled()
+        {
+            base.TestCreateRuntimeMapWithInvalidLayersErrorsEnabled();
+        }
+
         protected override IServerConnection CreateTestConnection()
         {
             return ConnectionUtil.CreateTestHttpConnection();

Modified: trunk/Tools/Maestro/MaestroAPITests/LocalConnectionTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/LocalConnectionTests.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/MaestroAPITests/LocalConnectionTests.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -103,6 +103,18 @@
             base.TestSchemaMapping();
         }
 
+        [Test]
+        public override void TestCreateRuntimeMapWithInvalidLayersErrorsDisabled()
+        {
+            base.TestCreateRuntimeMapWithInvalidLayersErrorsDisabled();
+        }
+
+        [Test]
+        public override void TestCreateRuntimeMapWithInvalidLayersErrorsEnabled()
+        {
+            base.TestCreateRuntimeMapWithInvalidLayersErrorsEnabled();
+        }
+
         public override IServerConnection CreateFromExistingSession(IServerConnection orig)
         {
             throw new NotImplementedException();

Modified: trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2013-12-20 06:45:50 UTC (rev 7957)
@@ -574,7 +574,15 @@
     <Content Include="UserTestData\odbc_example_config2.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
-    <Content Include="UserTestData\SpaceShip.xml" />
+    <Content Include="UserTestData\SpaceShip.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="UserTestData\TestMapWithInvalidLayers.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="UserTestData\InvalidLayer.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="UserTestData\wms_config_example1.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

Modified: trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -25,6 +25,8 @@
 namespace MaestroAPITests
 {
     //Use this to toggle individual test suites
+    //
+    //TODO: To support parameterization, these settings should all be read from a text file
 
     public class TestControl
     {
@@ -51,7 +53,7 @@
 
     public class ConnectionUtil
     {
-        public static string Port { get { return "8018"; } }
+        public static string Port { get { return "80"; } }
 
         public static IServerConnection CreateTestLocalNativeConnection()
         {

Added: trunk/Tools/Maestro/MaestroAPITests/UserTestData/InvalidLayer.xml
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/UserTestData/InvalidLayer.xml	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITests/UserTestData/InvalidLayer.xml	2013-12-20 06:45:50 UTC (rev 7957)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LayerDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LayerDefinition-1.2.0.xsd" version="1.2.0">
+  <VectorLayerDefinition>
+    <ResourceId>Library://IDontExist.FeatureSource</ResourceId>
+    <FeatureName>SHP_Schema:Rail</FeatureName>
+    <FeatureNameType>FeatureClass</FeatureNameType>
+    <Geometry>SHPGEOM</Geometry>
+    <VectorScaleRange>
+      <LineTypeStyle>
+        <LineRule>
+          <LegendLabel/>
+          <LineSymbolization2D>
+            <LineStyle>Rail</LineStyle>
+            <Thickness>0.0</Thickness>
+            <Color>FFFF0000</Color>
+            <Unit>Centimeters</Unit>
+            <SizeContext>DeviceUnits</SizeContext>
+          </LineSymbolization2D>
+        </LineRule>
+      </LineTypeStyle>
+    </VectorScaleRange>
+  </VectorLayerDefinition>
+</LayerDefinition>

Added: trunk/Tools/Maestro/MaestroAPITests/UserTestData/TestMapWithInvalidLayers.xml
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/UserTestData/TestMapWithInvalidLayers.xml	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITests/UserTestData/TestMapWithInvalidLayers.xml	2013-12-20 06:45:50 UTC (rev 7957)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<MapDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MapDefinition-1.0.0.xsd">
+  <Name>New Map</Name> 
+  <CoordinateSystem>GEOGCS["WGS84 Lat/Long's, Degrees, -180 ==> +180",DATUM["D_WGS_1984",SPHEROID["World_Geodetic_System_of_1984",6378137,298.257222932867]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]</CoordinateSystem> 
+  <Extents>
+    <MinX>-87.770746109180749</MinX> 
+    <MaxX>-87.6957605384125</MaxX> 
+    <MinY>43.686899685828813</MinY> 
+    <MaxY>43.805498742206247</MaxY> 
+  </Extents>
+  <BackgroundColor>FFFFFFFF</BackgroundColor> 
+  <MapLayer>
+    <Name>Rail</Name> 
+    <ResourceId>Library://UnitTests/Layers/Rail.LayerDefinition</ResourceId> 
+    <Selectable>true</Selectable> 
+    <ShowInLegend>true</ShowInLegend> 
+    <LegendLabel>Rail</LegendLabel> 
+    <ExpandInLegend>true</ExpandInLegend> 
+    <Visible>true</Visible> 
+    <Group /> 
+  </MapLayer>
+  <MapLayer>
+    <Name>Invalid</Name>
+    <ResourceId>Library://UnitTests/Layers/InvalidLayer.LayerDefinition</ResourceId>
+    <Selectable>true</Selectable>
+    <ShowInLegend>true</ShowInLegend>
+    <LegendLabel>Invalid</LegendLabel>
+    <ExpandInLegend>true</ExpandInLegend>
+    <Visible>true</Visible>
+    <Group />
+  </MapLayer>
+  <MapLayer>
+    <Name>HydrographicPolygons</Name> 
+    <ResourceId>Library://UnitTests/Layers/HydrographicPolygons.LayerDefinition</ResourceId> 
+    <Selectable>true</Selectable> 
+    <ShowInLegend>true</ShowInLegend> 
+    <LegendLabel>HydrographicPolygons</LegendLabel> 
+    <ExpandInLegend>true</ExpandInLegend> 
+    <Visible>true</Visible> 
+    <Group /> 
+  </MapLayer>
+  <MapLayer>
+    <Name>Parcels</Name> 
+    <ResourceId>Library://UnitTests/Layers/Parcels.LayerDefinition</ResourceId> 
+    <Selectable>true</Selectable> 
+    <ShowInLegend>true</ShowInLegend> 
+    <LegendLabel>Parcels</LegendLabel> 
+    <ExpandInLegend>true</ExpandInLegend> 
+    <Visible>true</Visible> 
+    <Group /> 
+  </MapLayer>
+</MapDefinition>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -263,7 +263,7 @@
         /// </summary>
         /// <param name="mdf">The map definition to create this map from.</param>
         /// <param name="metersPerUnit">The meters per unit value</param>
-        internal RuntimeMap(IMapDefinition mdf, double metersPerUnit)
+        internal RuntimeMap(IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
             : this(mdf.CurrentConnection)
         {
             this.MetersPerUnit = metersPerUnit;
@@ -296,7 +296,7 @@
             //Load map layers
             foreach (var layer in mdf.MapLayer)
             {
-                var rtl = _mapSvc.CreateMapLayer(this, layer);
+                var rtl = _mapSvc.CreateMapLayer(this, layer, suppressErrors);
                 this.Layers.Add(rtl);
             }
 
@@ -1214,7 +1214,7 @@
         public RuntimeMapLayer CreateLayer(string layerDefinitionId, RuntimeMapGroup group)
         {
             ILayerDefinition ldf = GetLayerDefinition(layerDefinitionId);
-            var layer = new RuntimeMapLayer(this, ldf);
+            var layer = new RuntimeMapLayer(this, ldf, true);
             if (group != null)
                 layer.Group = group.Name;
             return layer;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -124,7 +124,7 @@
         /// Initializes this instances from the specified Layer Definition
         /// </summary>
         /// <param name="ldf"></param>
-        protected void Initialize(ILayerDefinition ldf)
+        protected void Initialize(ILayerDefinition ldf, bool suppressErrors)
         {
             Check.NotNull(ldf, "ldf"); //NOXLATE
             this.LayerDefinitionID = ldf.ResourceID;
@@ -135,7 +135,7 @@
                 _geometryPropertyName = vl.Geometry;
                 _featureSourceId = vl.ResourceId;
                 _filter = vl.Filter;
-                InitIdentityProperties(vl);
+                InitIdentityProperties(vl, suppressErrors);
                 InitScaleRanges(vl);
                 _hasTooltips = !string.IsNullOrEmpty(vl.ToolTip);
             }
@@ -185,12 +185,13 @@
         /// Initializes a new instance of the <see cref="RuntimeMapLayer"/> class.
         /// </summary>
         /// <param name="parent">The parent.</param>
-        /// <param name="ldf">The LDF.</param>
-        protected internal RuntimeMapLayer(RuntimeMap parent, ILayerDefinition ldf)
+        /// <param name="ldf">The Layer Definition.</param>
+        /// <param name="suppressErrors">If true, any errors while creating the layer are suppressed. The nature of the error may result in un-selectable layers</param>
+        protected internal RuntimeMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors)
             : this(parent)
         {
             _disableChangeTracking = true;
-            Initialize(ldf);
+            Initialize(ldf, suppressErrors);
             _disableChangeTracking = false;
         }
 
@@ -237,8 +238,9 @@
         /// </summary>
         /// <param name="parent">The parent.</param>
         /// <param name="source">The source.</param>
-        protected internal RuntimeMapLayer(RuntimeMap parent, IMapLayer source)
-            : this(parent, source, (ILayerDefinition)parent.CurrentConnection.ResourceService.GetResource(source.ResourceId))
+        /// <param name="suppressErrors"></param>
+        protected internal RuntimeMapLayer(RuntimeMap parent, IMapLayer source, bool suppressErrors)
+            : this(parent, source, (ILayerDefinition)parent.CurrentConnection.ResourceService.GetResource(source.ResourceId), suppressErrors)
         {
             _disableChangeTracking = false;
         }
@@ -249,8 +251,9 @@
         /// <param name="parent"></param>
         /// <param name="source"></param>
         /// <param name="ldf"></param>
-        protected internal RuntimeMapLayer(RuntimeMap parent, IMapLayer source, ILayerDefinition ldf)
-            : this(parent, (IBaseMapLayer)source, ldf)
+        /// <param name="suppressErrors"></param>
+        protected internal RuntimeMapLayer(RuntimeMap parent, IMapLayer source, ILayerDefinition ldf, bool suppressErrors)
+            : this(parent, (IBaseMapLayer)source, ldf, suppressErrors)
         {
             _disableChangeTracking = true;
 
@@ -266,8 +269,9 @@
         /// <param name="parent"></param>
         /// <param name="source"></param>
         /// <param name="ldf"></param>
-        protected internal RuntimeMapLayer(RuntimeMap parent, IBaseMapLayer source, ILayerDefinition ldf) 
-            : this(parent, ldf)
+        /// <param name="suppressErrors"></param>
+        protected internal RuntimeMapLayer(RuntimeMap parent, IBaseMapLayer source, ILayerDefinition ldf, bool suppressErrors) 
+            : this(parent, ldf, suppressErrors)
         {
             Check.NotNull(source, "source"); //NOXLATE
             Check.NotNull(ldf, "ldf"); //NOXLATE
@@ -302,7 +306,7 @@
         /// </summary>
         public ScaleRange[] ScaleRanges { get; private set; }
 
-        private void InitIdentityProperties(IVectorLayerDefinition vl)
+        private void InitIdentityProperties(IVectorLayerDefinition vl, bool suppressErrors)
         {
             try
             {
@@ -325,6 +329,10 @@
             }
             catch (Exception ex) //Has to be a bug in MapGuide or in the FDO provider
             {
+                //If not suppressing, rethrow with original stack trace
+                if (!suppressErrors)
+                    throw;
+
                 this.IdentityProperties = new PropertyInfo[0];
                 Trace.TraceWarning(string.Format(Strings.ERR_INIT_IDENTITY_PROPS, Environment.NewLine, this.Name, ex.ToString()));
             }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -1954,10 +1954,23 @@
         public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf)
         {
             //TODO: Review when we decide to split the implementations
-            return new RuntimeMapLayer(parent, ldf);
+            return CreateMapLayer(parent, ldf, true);
         }
 
         /// <summary>
+        /// Creates a new runtime map layer from the specified Layer Definition
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="ldf">The layer definition</param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors)
+        {
+            //TODO: Review when we decide to split the implementations
+            return new RuntimeMapLayer(parent, ldf, suppressErrors);
+        }
+
+        /// <summary>
         /// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
         /// </summary>
         /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
@@ -1965,8 +1978,20 @@
         /// <returns></returns>
         public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source)
         {
+            return CreateMapLayer(parent, source, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="source">The map definition layer</param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source, bool suppressErrors)
+        {
             ILayerDefinition layerDef = (ILayerDefinition)GetResource(source.ResourceId);
-            var rtLayer = CreateMapLayer(parent, layerDef);
+            var rtLayer = CreateMapLayer(parent, layerDef, suppressErrors);
 
             //These may not match, so set them here
             rtLayer.ExpandInLegend = source.ExpandInLegend;
@@ -1988,8 +2013,20 @@
         /// <returns></returns>
         public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source)
         {
+            return CreateMapLayer(parent, source);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="source">The map definition layer</param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source, bool suppressErrors)
+        {
             ILayerDefinition layerDef = (ILayerDefinition)GetResource(source.ResourceId);
-            var rtLayer = CreateMapLayer(parent, layerDef);
+            var rtLayer = CreateMapLayer(parent, layerDef, suppressErrors);
 
             //These may not match, so set them here
             rtLayer.ExpandInLegend = source.ExpandInLegend;
@@ -2019,13 +2056,33 @@
         /// <returns></returns>
         public RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId)
         {
+            return CreateMap(runtimeMapResourceId, baseMapDefinitionId, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. Meters per unit
+        /// is calculated from the Coordinate System WKT of the map definition.
+        /// </summary>
+        /// <remarks>
+        /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
+        /// effect on things such as rendering and measuring depending on the underlying implementation
+        /// 
+        /// If you are certain of the meters-per-unit value required, use the overloaded method that 
+        /// accepts a metersPerUnit parameter.
+        /// </remarks>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="baseMapDefinitionId"></param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, bool suppressErrors)
+        {
             var mdf = (IMapDefinition)GetResource(baseMapDefinitionId);
             double mpu = 1.0;
             if (CsHelper.DefaultCalculator != null)
                 mpu = CsHelper.DefaultCalculator.Calculate(mdf.CoordinateSystem, 1.0);
             else
                 mpu = InferMPU(mdf.CoordinateSystem, 1.0);
-            return CreateMap(runtimeMapResourceId, mdf, mpu);
+            return CreateMap(runtimeMapResourceId, mdf, mpu, suppressErrors);
         }
 
         /// <summary>
@@ -2037,8 +2094,21 @@
         /// <returns></returns>
         public virtual RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit)
         {
+            return CreateMap(runtimeMapResourceId, baseMapDefinitionId, metersPerUnit, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition
+        /// </summary>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="baseMapDefinitionId"></param>
+        /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public virtual RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit, bool suppressErrors)
+        {
             var mdf = (IMapDefinition)GetResource(baseMapDefinitionId);
-            return CreateMap(runtimeMapResourceId, mdf, metersPerUnit);
+            return CreateMap(runtimeMapResourceId, mdf, metersPerUnit, suppressErrors);
         }
 
         /// <summary>
@@ -2049,8 +2119,20 @@
         /// <returns></returns>
         public RuntimeMap CreateMap(IMapDefinition mdf)
         {
+            return CreateMap(mdf, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition.  The runtime map resource id is calculated from the 
+        /// current session id and the name component of the Map Definition resource id
+        /// </summary>
+        /// <param name="mdf"></param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMap CreateMap(IMapDefinition mdf, bool suppressErrors)
+        {
             var rid = new ResourceIdentifier(ResourceIdentifier.GetName(mdf.ResourceID), ResourceTypes.RuntimeMap, this.SessionID);
-            return CreateMap(rid.ToString(), mdf);
+            return CreateMap(rid.ToString(), mdf, suppressErrors);
         }
 
         /// <summary>
@@ -2062,8 +2144,21 @@
         /// <returns></returns>
         public RuntimeMap CreateMap(IMapDefinition mdf, double metersPerUnit)
         {
+            return CreateMap(mdf, metersPerUnit, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. The runtime map resource id is calculated from the
+        /// current session id and the name component of the Map Definition resource id
+        /// </summary>
+        /// <param name="mdf">The map definition.</param>
+        /// <param name="metersPerUnit">The meters per unit.</param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMap CreateMap(IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
+        {
             var rid = new ResourceIdentifier(ResourceIdentifier.GetName(mdf.ResourceID), ResourceTypes.RuntimeMap, this.SessionID);
-            return CreateMap(rid.ToString(), mdf, metersPerUnit);
+            return CreateMap(rid.ToString(), mdf, metersPerUnit, suppressErrors);
         }
 
         /// <summary>
@@ -2082,12 +2177,32 @@
         /// <returns></returns>
         public RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf)
         {
+            return CreateMap(runtimeMapResourceId, mdf, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. Meters per unit
+        /// is calculated from the Coordinate System WKT of the map definition.
+        /// </summary>
+        /// <remarks>
+        /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
+        /// effect on things such as rendering and measuring depending on the underlying implementation
+        /// 
+        /// If you are certain of the meters-per-unit value required, use the overloaded method that 
+        /// accepts a metersPerUnit parameter.
+        /// </remarks>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="mdf"></param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, bool suppressErrors)
+        {
             double mpu = 1.0;
             if (CsHelper.DefaultCalculator != null)
                 mpu = CsHelper.DefaultCalculator.Calculate(mdf.CoordinateSystem, 1.0);
             else
                 mpu = InferMPU(mdf.CoordinateSystem, 1.0);
-            return CreateMap(runtimeMapResourceId, mdf, mpu);
+            return CreateMap(runtimeMapResourceId, mdf, mpu, suppressErrors);
         }
 
         /// <summary>
@@ -2096,10 +2211,24 @@
         /// <param name="runtimeMapResourceId"></param>
         /// <param name="mdf"></param>
         /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors"></param>
         /// <returns></returns>
         public virtual RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit)
         {
-            var map = new RuntimeMap(mdf, metersPerUnit);
+            return CreateMap(runtimeMapResourceId, mdf, metersPerUnit, true);
+        }
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition
+        /// </summary>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="mdf"></param>
+        /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors"></param>
+        /// <returns></returns>
+        public virtual RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
+        {
+            var map = new RuntimeMap(mdf, metersPerUnit, suppressErrors);
             map.ResourceID = runtimeMapResourceId;
             map.IsDirty = false;
             return map;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -92,6 +92,33 @@
         RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source);
 
         /// <summary>
+        /// Creates a new runtime map layer from the specified Layer Definition
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="ldf">The layer definition</param>
+        /// <param name="suppressErrors">If false, this method will throw an exception if the layer cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors);
+
+        /// <summary>
+        /// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="source">The map definition layer</param>
+        /// <param name="suppressErrors">If false, this method will throw an exception if the layer cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source, bool suppressErrors);
+
+        /// <summary>
+        /// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IMapLayer"/> instance
+        /// </summary>
+        /// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
+        /// <param name="source">The map definition layer</param>
+        /// <param name="suppressErrors">If false, this method will throw an exception if the layer cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source, bool suppressErrors);
+
+        /// <summary>
         /// Creates a new runtime map instance from an existing map definition.
         /// </summary>
         /// <remarks>
@@ -118,6 +145,34 @@
         RuntimeMap CreateMap(IMapDefinition mapDef);
 
         /// <summary>
+        /// Creates a new runtime map instance from an existing map definition.
+        /// </summary>
+        /// <remarks>
+        /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
+        /// effect on things such as rendering and measuring depending on the underlying implementation
+        /// 
+        /// If you are certain of the meters-per-unit value required, use the overloaded method that 
+        /// accepts a metersPerUnit parameter.
+        /// </remarks>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// IMapDefinition mapDef = (IMapDefinition)conn.ResourceService.GetResource("Library://Path/To/My.MapDefinition");
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(mapDef, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="mapDef"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(IMapDefinition mapDef, bool suppressErrors);
+
+        /// <summary>
         /// Creates a new runtime map instance from an existing map definition. Meters per unit
         /// is calculated from the Coordinate System WKT of the map definition.
         /// </summary>
@@ -143,6 +198,30 @@
         /// Creates a new runtime map instance from an existing map definition. Meters per unit
         /// is calculated from the Coordinate System WKT of the map definition.
         /// </summary>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// IMapDefinition mapDef = (IMapDefinition)conn.ResourceService.GetResource("Library://Path/To/My.MapDefinition");
+        /// double metersPerUnit = 1.0;
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(mapDef, metersPerUnit, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="mapDef"></param>
+        /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(IMapDefinition mapDef, double metersPerUnit, bool suppressErrors);
+
+        /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. Meters per unit
+        /// is calculated from the Coordinate System WKT of the map definition.
+        /// </summary>
         /// <remarks>
         /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
         /// effect on things such as rendering and measuring depending on the underlying implementation
@@ -170,6 +249,38 @@
         RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId);
 
         /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. Meters per unit
+        /// is calculated from the Coordinate System WKT of the map definition.
+        /// </summary>
+        /// <remarks>
+        /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
+        /// effect on things such as rendering and measuring depending on the underlying implementation
+        /// 
+        /// If you are certain of the meters-per-unit value required, use the overloaded method that 
+        /// accepts a metersPerUnit parameter.
+        /// </remarks>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// string mapName = "MyMap";
+        /// string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";
+        /// string baseMapDefId = "Library://Path/To/My.MapDefinition";
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, baseMapDefId, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="baseMapDefinitionId"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, bool suppressErrors);
+
+        /// <summary>
         /// Creates a new runtime map instance from an existing map definition
         /// </summary>
         /// <example>
@@ -183,7 +294,7 @@
         /// string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";
         /// string baseMapDefId = "Library://Path/To/My.MapDefinition";
         /// double metersPerUnit = 1.0;
-        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, baseMapDefId);
+        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, baseMapDefId, metersPerUnit);
         /// ]]>
         /// </code>
         /// </example>
@@ -194,6 +305,32 @@
         RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit);
 
         /// <summary>
+        /// Creates a new runtime map instance from an existing map definition
+        /// </summary>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// string mapName = "MyMap";
+        /// string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";
+        /// string baseMapDefId = "Library://Path/To/My.MapDefinition";
+        /// double metersPerUnit = 1.0;
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, baseMapDefId, metersPerUnit, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="baseMapDefinitionId"></param>
+        /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit, bool suppressErrors);
+
+        /// <summary>
         /// Creates a new runtime map instance from an existing map definition. Meters per unit
         /// is calculated from the Coordinate System WKT of the map definition.
         /// </summary>
@@ -224,6 +361,38 @@
         RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf);
 
         /// <summary>
+        /// Creates a new runtime map instance from an existing map definition. Meters per unit
+        /// is calculated from the Coordinate System WKT of the map definition.
+        /// </summary>
+        /// <remarks>
+        /// Calculation of meters-per-unit may differ between implementations. This may have an adverse
+        /// effect on things such as rendering and measuring depending on the underlying implementation
+        /// 
+        /// If you are certain of the meters-per-unit value required, use the overloaded method that 
+        /// accepts a metersPerUnit parameter.
+        /// </remarks>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// string mapName = "MyMap";
+        /// string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";
+        /// IMapDefinition mdf = (IMapDefinition)conn.ResourceService.GetResource("Library://Path/To/My.MapDefinition");
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, mdf, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="mdf"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, bool suppressErrors);
+
+        /// <summary>
         /// Creates a new runtime map instance from an existing map definition
         /// </summary>
         /// <example>
@@ -248,6 +417,32 @@
         RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit);
 
         /// <summary>
+        /// Creates a new runtime map instance from an existing map definition
+        /// </summary>
+        /// <example>
+        /// This example shows how to create a new runtime map instance
+        /// <code>
+        /// <![CDATA[
+        /// IServerConnection conn;
+        /// ...
+        /// IMappingService mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+        /// double metersPerUnit = 1.0;
+        /// string mapName = "MyMap";
+        /// string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";
+        /// IMapDefinition mdf = (IMapDefinition)conn.ResourceService.GetResource("Library://Path/To/My.MapDefinition");
+        /// bool suppressErrors = true;
+        /// RuntimeMap map = mappingSvc.CreateMap(rtMapId, mdf, metersPerUnit, suppressErrors);
+        /// ]]>
+        /// </code>
+        /// </example>
+        /// <param name="runtimeMapResourceId"></param>
+        /// <param name="mdf"></param>
+        /// <param name="metersPerUnit"></param>
+        /// <param name="suppressErrors">If false, this method will throw an exception on the first layer that cannot be initialized. Otherwise, any exceptions that occur during layer initialization are suppressed</param>
+        /// <returns></returns>
+        RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit, bool suppressErrors);
+
+        /// <summary>
         /// Opens an existing runtime map instance
         /// </summary>
         /// <example>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -1075,11 +1075,11 @@
             throw new NotSupportedException();
         }
 
-        public override Mapping.RuntimeMap CreateMap(string runtimeMapResourceId, ObjectModels.MapDefinition.IMapDefinition mdf, double metersPerUnit)
+        public override Mapping.RuntimeMap CreateMap(string runtimeMapResourceId, ObjectModels.MapDefinition.IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
         {
             var mdfId = new MgResourceIdentifier(mdf.ResourceID);
             var implMap = new MgdMap(mdfId);
-            var map = new LocalRuntimeMap(this, implMap);
+            var map = new LocalRuntimeMap(this, implMap, suppressErrors);
             map.ResourceID = runtimeMapResourceId;
             map.ResetDirtyState();
             return map;
@@ -1138,7 +1138,7 @@
             return new LocalRuntimeMapGroup(impl, group);
         }
 
-        public override Mapping.RuntimeMapLayer CreateMapLayer(Mapping.RuntimeMap parent, ObjectModels.LayerDefinition.ILayerDefinition ldf)
+        public override Mapping.RuntimeMapLayer CreateMapLayer(Mapping.RuntimeMap parent, ObjectModels.LayerDefinition.ILayerDefinition ldf, bool suppressErrors)
         {
             var impl = parent as LocalRuntimeMap;
             if (impl == null)
@@ -1146,7 +1146,7 @@
 
             var ldfId = new MgResourceIdentifier(ldf.ResourceID);
             var layer = new MgdLayer(ldfId, GetResourceService());
-            return new LocalRuntimeMapLayer(impl, layer, this);
+            return new LocalRuntimeMapLayer(impl, layer, this, suppressErrors);
         }
 
         public Stream RenderDynamicOverlay(Mapping.RuntimeMap map, Mapping.MapSelection selection, string format)

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs	2013-12-12 12:59:01 UTC (rev 7956)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs	2013-12-20 06:45:50 UTC (rev 7957)
@@ -40,11 +40,11 @@
         private MgdMap _impl;
         private LocalConnection _conn;
 
-        public LocalRuntimeMap(LocalConnection conn, MgdMap map) : base(conn)
+        public LocalRuntimeMap(LocalConnection conn, MgdMap map, bool suppressErrors) : base(conn)
         { 
             _impl = map;
             _conn = conn;
-            InitializeLayersAndGroups();
+            InitializeLayersAndGroups(suppressErrors);
             _disableChangeTracking = false;
         }
 
@@ -80,7 +80,7 @@
             }
         }
 
-        private void InitializeLayersAndGroups()
+        private void InitializeLayersAndGroups(bool suppressErrors)
         {
             this.Layers.Clear();
             this.Groups.Clear();
@@ -97,7 +97,7 @@
             //Then layers
             for (int i = 0; i < layers.GetCount(); i++)
             {
-                this.Layers.Add(new LocalRuntimeMapLayer(this, layers.GetItem(i), _conn));
+                this.Layers.Add(new LocalRuntimeMapLayer(this, layers.GetItem(i), _conn, suppressErrors));
             }
         }
 
@@ -470,13 +470,13 @@
         private LocalRuntimeMap _parent;
         private MgLayerBase _impl;
 
-        internal LocalRuntimeMapLayer(LocalRuntimeMap parent, MgLayerBase layer, IResourceService resSvc) : base(parent)
+        internal LocalRuntimeMapLayer(LocalRuntimeMap parent, MgLayerBase layer, IResourceService resSvc, bool suppressErrors) : base(parent)
         {
             _parent = parent;
             _impl = layer;
             var ldfId = layer.GetLayerDefinition();
             var ldf = (ILayerDefinition)resSvc.GetResource(ldfId.ToString());
-            Initialize(ldf);
+            Initialize(ldf, suppressErrors);
             _disableChangeTracking = false;
         }
 



More information about the mapguide-commits mailing list