[mapguide-commits] r6828 - in trunk/Tools/Maestro: LocalConfigure/Resources Maestro.AddIn.Local Maestro.AddIn.Local/FDO Maestro.AddIn.Local/Resources Maestro.Base/UI Maestro.LiveMapEditor Maestro.MapViewer MaestroAPITests OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Mapping OSGeo.MapGuide.MaestroAPI/Services OSGeo.MapGuide.MaestroAPI.Http OSGeo.MapGuide.MaestroAPI.Local OSGeo.MapGuide.MaestroAPI.Native

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jul 1 04:13:41 PDT 2012


Author: jng
Date: 2012-07-01 04:13:41 -0700 (Sun, 01 Jul 2012)
New Revision: 6828

Added:
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/gdal19.dll
Removed:
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/gdal17.dll
Modified:
   trunk/Tools/Maestro/LocalConfigure/Resources/Platform.ini
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/ExpressionEngine.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOCommon.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOGeometry.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOSpatial.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/Fdo.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/MySQLProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/MySqlOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/ODBCProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OGRProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OWS.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OdbcOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/PostgreSQLOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/PostgreSQLProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/RdbmsMsg.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/RdbmsOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SDFMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SDFProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLServerSpatialOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLServerSpatialProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLiteProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SmMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WFSMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WFSProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSMessage.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSOverrides.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSProvider.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/Xalan-C_1_11.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/XalanMessages_1_11.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/boost_date_time-vc100-mt-1_42.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/boost_thread-vc100-mt-1_42.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/providers.xml
   trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/xerces-c_3_1.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/FoundationUnmanagedApi.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/GeometryUnmanagedApi.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
   trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsCommon.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsQueryEngine.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgRenderers.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/MgStylization.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Foundation.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Geometry.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.PlatformBase.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.Desktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/PlatformBaseUnmanagedApi.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/Resources/mapguide_en.res
   trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
   trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
   trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs
   trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs
   trunk/Tools/Maestro/MaestroAPITests/LocalNativePerformanceTests.cs
   trunk/Tools/Maestro/MaestroAPITests/RuntimeMapTests.cs
   trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.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.Native/LocalNativeConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapObservable.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs
Log:
This submission contains the following changes:
 - Update mg-desktop to 28 June 2012 release
 - Update default Platform.ini that LocalConfigure.exe writes
 - Update the LocalRuntimeMap to work with existing API usage patterns for other connection providers
 - Add runtime map tests for LocalRuntimeMap, disabling any tests not relevant for this particular class (eg. Open/Save runtime state)
 - Modify the IMappingService render APIs to work against RuntimeMap instances instead of resource ids as the LocalRuntimeMap has no concept of runtime map state.

Modified: trunk/Tools/Maestro/LocalConfigure/Resources/Platform.ini
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/ExpressionEngine.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOCommon.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOGeometry.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/FDOSpatial.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/Fdo.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/GRFPProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/KingOracleProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/MySQLProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/MySqlOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/ODBCProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OGRProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OWS.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/OdbcOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/PostgreSQLOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/PostgreSQLProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/RdbmsMsg.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/RdbmsOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SDFMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SDFProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SHPProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLServerSpatialOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLServerSpatialProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SQLiteProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/SmMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WFSMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WFSProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSMessage.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSOverrides.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/WMSProvider.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/Xalan-C_1_11.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/XalanMessages_1_11.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/boost_date_time-vc100-mt-1_42.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/boost_thread-vc100-mt-1_42.dll
===================================================================
(Binary files differ)

Deleted: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/gdal17.dll
===================================================================
(Binary files differ)

Added: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/gdal19.dll
===================================================================
(Binary files differ)


Property changes on: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/gdal19.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/providers.xml
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/providers.xml	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/providers.xml	2012-07-01 11:13:41 UTC (rev 6828)
@@ -46,17 +46,17 @@
     <LibraryPath>.\WMSProvider.dll</LibraryPath>
   </FeatureProvider>
   <FeatureProvider>
-    <Name>OSGeo.ODBC.3.7</Name>
-    <DisplayName>OSGeo FDO Provider for ODBC</DisplayName>
-    <Description>FDO Provider for ODBC</Description>
-    <IsManaged>False</IsManaged>
-    <Version>3.7.0.0</Version>
+    <Name>OSGeo.ODBC.3.7</Name> 
+    <DisplayName>OSGeo FDO Provider for ODBC</DisplayName> 
+    <Description>FDO Provider for ODBC</Description> 
+    <IsManaged>False</IsManaged> 
+    <Version>3.7.0.0</Version> 
     <FeatureDataObjectsVersion>3.7.0.0</FeatureDataObjectsVersion>
     <LibraryPath>.\ODBCProvider.dll</LibraryPath>
   </FeatureProvider>
   <FeatureProvider>
-    <Name>OSGeo.MySQL.3.7</Name>
-    <DisplayName>OSGeo FDO Provider for MySQL</DisplayName>
+    <Name>OSGeo.MySQL.3.7</Name> 
+    <DisplayName>OSGeo FDO Provider for MySQL</DisplayName> 
     <Description>FDO Provider for MySql</Description>
     <IsManaged>False</IsManaged>
     <Version>3.7.0.0</Version>
@@ -73,13 +73,13 @@
     <LibraryPath>.\GRFPProvider.dll</LibraryPath>
   </FeatureProvider>
   <FeatureProvider>
-    <Name>OSGeo.OGR.3.7</Name>
-    <DisplayName>OSGeo FDO Provider for OGR</DisplayName>
-    <Description>FDO Access to OGR Data Sources</Description>
-    <IsManaged>False</IsManaged>
-    <Version>3.7.0.0</Version>
-    <FeatureDataObjectsVersion>3.7.0.0</FeatureDataObjectsVersion>
-    <LibraryPath>.\OGRProvider.dll</LibraryPath>
+    <Name>OSGeo.OGR.3.7</Name> 
+    <DisplayName>OSGeo FDO Provider for OGR</DisplayName> 
+    <Description>FDO Access to OGR Data Sources</Description> 
+    <IsManaged>False</IsManaged> 
+    <Version>3.7.0.0</Version> 
+    <FeatureDataObjectsVersion>3.7.0.0</FeatureDataObjectsVersion> 
+    <LibraryPath>.\OGRProvider.dll</LibraryPath> 
   </FeatureProvider>
   <FeatureProvider>
     <Name>OSGeo.KingOracle.3.7</Name>

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FDO/xerces-c_3_1.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/FoundationUnmanagedApi.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/GeometryUnmanagedApi.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj	2012-07-01 11:13:41 UTC (rev 6828)
@@ -214,7 +214,7 @@
     <Content Include="FDO\FDOSpatial.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
-    <Content Include="FDO\gdal17.dll">
+    <Content Include="FDO\gdal19.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
     <Content Include="FDO\GRFPMessage.dll">

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsCommon.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgGwsQueryEngine.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgRenderers.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgStylization.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Foundation.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Geometry.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.PlatformBase.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.Desktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/PlatformBaseUnmanagedApi.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Resources/mapguide_en.res
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Resources/mapguide_en.res	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Resources/mapguide_en.res	2012-07-01 11:13:41 UTC (rev 6828)
@@ -1,6 +1,6 @@
 # *****************************************************************************
 # MapGuide Resource File
-# Copyright (C) 2004-2010 by Autodesk, Inc.
+# Copyright (C) 2004-2011 by Autodesk, Inc.
 #
 # WARNING: DO NOT MODIFY THIS FILE
 #
@@ -19,7 +19,6 @@
 # E X C E P T I O N S
 # *****************************************************************************
 [Exceptions]
-MgAliasNotFoundException							  = The given alias %1 is not defined in the configuration file
 MgAllProviderConnectionsUsedException                 = Cannot create any more connections to the %1 FDO provider.
 MgArgumentOutOfRangeException                         = Argument is out of range.
 MgArrayTypeMismatchException                          = Array type mismatch.
@@ -158,6 +157,7 @@
 # *****************************************************************************
 [ErrorDescription]
 MgArgumentsMismatch                                   = The arguments needed do not match the arguments provided.
+MgArgumentOutOfRange                                  = Argument out of range [%1, %2]: %3
 MgClassWOIdentity                                     = A class definition has no identity property.
 MgCollectionEmpty                                     = The collection cannot be empty.
 MgCoordinateSystemNotReadyException                   = The object is not ready for this operation.
@@ -225,14 +225,17 @@
 MgCoordinateSystemUnknownUnit                         = Unknown unit.
 MgDataReaderIdNotFound                                = The data reader ID was not found.
 MgDocumentIdentifierFilenameFailed                    = Failed to get the filename from the document identifier because no matching document path found.
+MgDuplicateObject                                     = Duplicate object found for name: %1
 MgFailedToGetFileNameForDates                         = Failed to get the filename for the specified dates.
 MgFailedToLoadFdoLibrary                              = Failed to load FDO library.
 MgFailedToRetrieveSystemExceptionMesage               = Failed to retrieve the system exception mesage. This message may not be unicode compliant.
 MgFailedToRetrieveThirdPartyExceptionMesage           = Failed to retrieve the third party exception mesage. This message may not be unicode compliant.
+MgFeatureSourceFormatInnerExceptionMessage            = Error occurred in Feature Source (%1): %2 (Cause: %3, Root Cause: %4)
 MgFeatureReaderIdNotFound                             = The feature reader ID was not found.
 MgFilenamesIdentical                                  = The filenames cannot be the same.
 MgFormatAllExceptionDetail                            = - %1(%2)
 MgFormatAllExceptionStackTrace                        = - %1(%2) line %3 file %4
+MgFormatFdoExceptionMessage                           = %1 (Cause: %2, Root Cause: %3)
 MgFormatInnerExceptionMessage                         = %1
 MgGeometryEmpty                                       = The geometry cannot be empty.
 MgGeometryPropertyEmpty                               = The geometry property cannot be empty.
@@ -260,6 +263,7 @@
 MgInvalidIpConfigurationForSiteServer                 = The site server (%1) must have the same IP address as this local server (%2).
 MgInvalidIpConfigurationForSupportServer              = The site server (%1) must have a different IP address than this support server (%2).
 MgInvalidLogType                                      = The log type is invalid because it is not recognized.
+MgInvalidLocale                                       = The specified locale (%1) is not a 2-letter ISO 639-1 language code
 MgInvalidMapPlotCollectionMapPlotInstruction          = The map plot is invalid because it contains an unrecognized map plot instruction.
 MgInvalidMicroSecond                                  = The microsecond is invalid because it must be between 0 and 999999.
 MgInvalidMinute                                       = The minute is invalid because it must be between 0 and 59.
@@ -285,6 +289,7 @@
 MgInvalidWebWidgetType                                = The web widget type is invalid because it is not recognized.
 MgInvalidXmlDateTime                                  = The Xml date time is invalid because not all of the fields were found.
 MgInvalidYear                                         = The year is invalid because it must be between 1 and 9999.
+MgLayerBelongsToGroupNotInMap                         = The layer (%1) belongs to a group (%2) which is not part of the map.
 MgMachineIpMustBeLocalHost                            = The machine IP address must be a local host.
 MgMapCacheCleared                                     = The Tile Service map cache has been cleared.  Please increase TiledMapCacheSize in serverconfig.ini.
 MgMapDisplayDpiCannotBeLessThanOrEqualToZero          = The map DPI cannot be less than or equal to zero.
@@ -298,6 +303,9 @@
 MgMissingSrs                                          = No coordinate system specified.
 MgNameNotFound                                        = The name was not found.
 MgNoDataFromRenderer                                  = No data from renderer.
+MgNoNameForObject                                     = No object found for name (%1)
+MgNullArgument                                        = Null argument: %1
+MgNullPointer                                         = Null pointer: %1
 MgPropertyValuesEmpty                                 = The property values cannot be empty.
 MgReaderIdNotFound                                    = The reader ID was not found.
 MgRepositoryAlreadyOpened                             = The repository is already opened by another process (e.g. If you are running the server interactively as an application from the command line, are you also running the server as a service?).
@@ -309,6 +317,9 @@
 MgResourceTypesDifferent                              = The resource types cannot be different.
 MgResourcesIdentical                                  = The resources cannot be the same.
 MgSchemaNameMismatch                                  = This schema name does not match the one specified in the qualified class name '%1' provided.
+MgSessionExpired                                      = The session (%1) has expired.
+MgSelectionOpenWithEmptySession                       = Attempted to open a map selection with an empty or expired session id
+MgSelectionSaveWithEmptySession                       = Attempted to save a map selection with an empty or expired session id
 MgSiteServerIpMustNotBeLocalHost                      = The site server IP address must not be a local host.
 MgSqlReaderIdNotFound                                 = The SQL reader ID was not found.
 MgStringContainsReservedCharacters                    = The string cannot contain reserved characters %1

Modified: trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -229,7 +229,7 @@
                                 {
                                     //TODO: Use extents rather than scale
                                     //using (System.IO.Stream s = m_connection.RenderRuntimeMap(tmp2, m.Extents, 1024, 800, 96))
-                                    using (System.IO.Stream s = mpsvc.RenderRuntimeMap(rtmap.ResourceID, ((rtmap.DataExtent.MaxX - rtmap.DataExtent.MinX) / 2) + rtmap.DataExtent.MinX, ((rtmap.DataExtent.MaxY - rtmap.DataExtent.MinY) / 2) + rtmap.DataExtent.MinY, 50000, 1024, 800, 96))
+                                    using (System.IO.Stream s = mpsvc.RenderRuntimeMap(rtmap, ((rtmap.DataExtent.MaxX - rtmap.DataExtent.MinX) / 2) + rtmap.DataExtent.MinX, ((rtmap.DataExtent.MaxY - rtmap.DataExtent.MinY) / 2) + rtmap.DataExtent.MinY, 50000, 1024, 800, 96))
                                     {
                                         backgroundWorker.ReportProgress(0, (string.Format(Properties.Resources.Prof_MapRenderingImageSize, s.Length)));
                                     }
@@ -351,7 +351,7 @@
                 {
                     //TODO: Use extents rather than scale
                     //using (System.IO.Stream s = m_connection.RenderRuntimeMap(tmp2, mdef.Extents, 1024, 800, 96))
-                    using (System.IO.Stream s = mpsvc.RenderRuntimeMap(rtmap.ResourceID, ((mdef.Extents.MaxX - mdef.Extents.MinX) / 2) + mdef.Extents.MinX, ((mdef.Extents.MaxY - mdef.Extents.MinY) / 2) + mdef.Extents.MinY, 50000, 1024, 800, 96))
+                    using (System.IO.Stream s = mpsvc.RenderRuntimeMap(rtmap, ((mdef.Extents.MaxX - mdef.Extents.MinX) / 2) + mdef.Extents.MinX, ((mdef.Extents.MaxY - mdef.Extents.MinY) / 2) + mdef.Extents.MinY, 50000, 1024, 800, 96))
                     {
                         //Just dispose it after being read
                         backgroundWorker.ReportProgress(0, (string.Format(Properties.Resources.Prof_MapRenderingImageSize, s.Length)));

Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -145,7 +145,7 @@
 
         private void EvaluateCommandStates()
         {
-            btnMapProperties.Enabled = btnSaveMap.Enabled = btnSaveMapAs.Enabled = (_mapEditor != null);
+            btnMapProperties.Enabled = btnSaveMap.Enabled = btnSaveMapAs.Enabled = saveAsToolStripMenuItem.Enabled = saveToolStripMenuItem.Enabled = (_mapEditor != null);
             UpdateTitle();
         }
 

Modified: trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -692,6 +692,9 @@
 
         private bool HasVisibleParent(RuntimeMapGroup grp)
         {
+            if (string.IsNullOrEmpty(grp.Group))
+                return true;
+
             var current = _map.Groups[grp.Group];
             if (current != null)
                 return current.Visible;
@@ -700,6 +703,9 @@
 
         private bool HasVisibleParent(RuntimeMapLayer layer)
         {
+            if (string.IsNullOrEmpty(layer.Group))
+                return true;
+
             var current = _map.Groups[layer.Group];
             if (current != null)
                 return current.Visible;

Modified: trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -373,7 +373,7 @@
     {
         protected override IServerConnection CreateTestConnection()
         {
-            return LocalNativeConnectionUtil.CreateTestConnection();
+            return ConnectionUtil.CreateTestLocalNativeConnection();
         }
 
         [Test]
@@ -424,7 +424,7 @@
     {
         protected override IServerConnection CreateTestConnection()
         {
-            return ConnectionProviderRegistry.CreateConnection("Maestro.Local", "ConfigFile", "Platform.ini");
+            return ConnectionUtil.CreateTestLocalConnection();
         }
 
         [Test]

Modified: trunk/Tools/Maestro/MaestroAPITests/LocalNativePerformanceTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/LocalNativePerformanceTests.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/MaestroAPITests/LocalNativePerformanceTests.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -31,7 +31,7 @@
         [Test]
         public void TestCase1914()
         {
-            var conn = LocalNativeConnectionUtil.CreateTestConnection();
+            var conn = ConnectionUtil.CreateTestLocalNativeConnection();
             var sw = new Stopwatch();
             sw.Start();
             conn.ResourceService.ResourceExists("Library://UnitTests/Data/Parcels.FeatureSource");

Modified: trunk/Tools/Maestro/MaestroAPITests/RuntimeMapTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/RuntimeMapTests.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/MaestroAPITests/RuntimeMapTests.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -75,7 +75,7 @@
                 _conn = CreateTestConnection();
                 SetupTestData();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 throw;
             }
@@ -162,7 +162,7 @@
             //Assert.IsTrue(Matches(map3, mdf));
         }
 
-        private bool Matches(RuntimeMap map, IMapDefinition mdf)
+        protected bool Matches(RuntimeMap map, IMapDefinition mdf)
         {
             if (map.MapDefinition != mdf.ResourceID) return false;
             if (map.Groups.Count != mdf.GetGroupCount()) return false;
@@ -212,7 +212,7 @@
             var mid = "Session:" + _conn.SessionID + "//TestSave.Map";
             var map = mapSvc.CreateMap(mid, mdf, 1.0);
             //Doesn't exist yet because save isn't called
-            Assert.IsTrue(!resSvc.ResourceExists(mid));
+            if (CaresAboutRuntimeMapState) Assert.IsTrue(!resSvc.ResourceExists(mid));
             
             //Call save
             Assert.IsTrue(Matches(map, mdf));
@@ -220,16 +220,20 @@
             map.Save();
             Assert.IsFalse(map.IsDirty);
             Assert.IsTrue(Matches(map, mdf));
-            Assert.IsTrue(resSvc.ResourceExists(mid));
+            if (CaresAboutRuntimeMapState) Assert.IsTrue(resSvc.ResourceExists(mid));
 
+            //Tests below not applicable if test suite doesn't care about runtime state
+            if (!CaresAboutRuntimeMapState)
+                return;
+
             //Open second runtime map instance
             var map2 = mapSvc.OpenMap(mid);
             Assert.IsFalse(map == map2);
             Assert.IsTrue(Matches(map2, mdf));
 
             //Tweak some settings
-            var parcels = map2.GetLayerByName("Parcels");
-            var rail = map2.GetLayerByName("Rail");
+            var parcels = map2.Layers["Parcels"];
+            var rail = map2.Layers["Rail"];
             Assert.NotNull(parcels);
 
             parcels.Visible = false;
@@ -252,8 +256,8 @@
             parcels = null;
             rail = null;
 
-            parcels = map3.GetLayerByName("Parcels");
-            rail = map3.GetLayerByName("Rail");
+            parcels = map3.Layers["Parcels"];
+            rail = map3.Layers["Rail"];
             Assert.NotNull(parcels);
 
             Assert.IsFalse(parcels.Visible);
@@ -264,6 +268,10 @@
             Assert.IsFalse(rail.Selectable);
         }
 
+        public abstract string TestPrefix { get; }
+
+        protected virtual bool CaresAboutRuntimeMapState { get { return true; } }
+
         public virtual void TestRender75k()
         {
             //Render a map of sheboygan at 75k
@@ -288,27 +296,28 @@
             metersPerUnit = cs.MetersPerUnitX;
             Trace.TraceInformation("Using MPU of: {0}", metersPerUnit);
 
-            var mid = "Session:" + _conn.SessionID + "//TestRender75k.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestRender75k.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
+            Assert.IsFalse(map.IsDirty);
             map.ViewScale = 75000;
             map.DisplayWidth = 1024;
             map.DisplayHeight = 1024;
             map.DisplayDpi = 96;
 
             //Doesn't exist yet because save isn't called
-            Assert.IsTrue(!resSvc.ResourceExists(mid));
+            if (CaresAboutRuntimeMapState) Assert.IsTrue(!resSvc.ResourceExists(mid));
             Assert.IsTrue(map.IsDirty);
             map.Save();
             Assert.IsFalse(map.IsDirty);
 
             //Render default
-            RenderAndVerify(mapSvc, map, "TestRender75k.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender75kConvenience.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay75k.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay75kConvenience.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender75k.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender75kConvenience.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay75k.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay75kConvenience.png", "PNG");
 
             //Turn off parcels
-            var rail = map.GetLayerByName("Rail");
+            var rail = map.Layers["Rail"];
             Assert.NotNull(rail);
             rail.Visible = false;
             Assert.IsTrue(map.IsDirty);
@@ -316,14 +325,14 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render again
-            RenderAndVerify(mapSvc, map, "TestRender75k_NoRail.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender75kConvenience_NoRail.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay75k_NoRail.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay75kConvenience_NoRail.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender75k_NoRail.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender75kConvenience_NoRail.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay75k_NoRail.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay75kConvenience_NoRail.png", "PNG");
 
             //Turn Rail back on
             rail = null;
-            rail = map.GetLayerByName("Rail");
+            rail = map.Layers["Rail"];
             Assert.NotNull(rail);
             rail.Visible = true;
             Assert.IsTrue(map.IsDirty);
@@ -331,10 +340,10 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render again
-            RenderAndVerify(mapSvc, map, "TestRender75k_RailBackOn.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender75kConvenience_RailBackOn.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay75k_RailBackOn.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay75kConvenience_RailBackOn.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender75k_RailBackOn.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender75kConvenience_RailBackOn.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay75k_RailBackOn.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay75kConvenience_RailBackOn.png", "PNG");
         }
 
         #region render helpers
@@ -441,7 +450,7 @@
 
         private static void RenderAndVerify(IMappingService mapSvc, RuntimeMap map, string fileName, string format)
         {
-            using (var stream = mapSvc.RenderRuntimeMap(map.ResourceID, map.ViewCenter.X, map.ViewCenter.Y, map.ViewScale, map.DisplayWidth, map.DisplayHeight, map.DisplayDpi, format))
+            using (var stream = mapSvc.RenderRuntimeMap(map, map.ViewCenter.X, map.ViewCenter.Y, map.ViewScale, map.DisplayWidth, map.DisplayHeight, map.DisplayDpi, format))
             {
                 using (var ms = new MemoryStream())
                 using (var ms2 = new MemoryStream())
@@ -511,7 +520,7 @@
             metersPerUnit = cs.MetersPerUnitX;
             Trace.TraceInformation("Using MPU of: {0}", metersPerUnit);
 
-            var mid = "Session:" + _conn.SessionID + "//TestLegendIconRendering.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestLegendIconRendering.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
             map.ViewScale = 12000;
             map.DisplayWidth = 1024;
@@ -528,28 +537,28 @@
             foreach (var layer in map.Layers)
             {
                 var icon = mapSvc.GetLegendImage(map.ViewScale, layer.LayerDefinitionID, -1, -1);
-                icon.Save("TestLegendIconRendering_" + counter + "_16x16.png");
+                icon.Save(TestPrefix + "TestLegendIconRendering_" + counter + "_16x16.png");
                 counter++;
             }
 
             foreach (var layer in map.Layers)
             {
                 var icon = mapSvc.GetLegendImage(map.ViewScale, layer.LayerDefinitionID, -1, -1, 16, 16, "JPG");
-                icon.Save("TestLegendIconRendering_" + counter + "_16x16.jpg");
+                icon.Save(TestPrefix + "TestLegendIconRendering_" + counter + "_16x16.jpg");
                 counter++;
             }
 
             foreach (var layer in map.Layers)
             {
                 var icon = mapSvc.GetLegendImage(map.ViewScale, layer.LayerDefinitionID, -1, -1, 16, 16, "GIF");
-                icon.Save("TestLegendIconRendering_" + counter + "_16x16.gif");
+                icon.Save(TestPrefix + "TestLegendIconRendering_" + counter + "_16x16.gif");
                 counter++;
             }
 
             foreach (var layer in map.Layers)
             {
                 var icon = mapSvc.GetLegendImage(map.ViewScale, layer.LayerDefinitionID, -1, -1, 160, 50, "PNG");
-                icon.Save("TestLegendIconRendering_" + counter + "_160x50.png");
+                icon.Save(TestPrefix + "TestLegendIconRendering_" + counter + "_160x50.png");
                 counter++;
             }
         }
@@ -578,8 +587,9 @@
             metersPerUnit = cs.MetersPerUnitX;
             Trace.TraceInformation("Using MPU of: {0}", metersPerUnit);
 
-            var mid = "Session:" + _conn.SessionID + "//TestRender12k.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestRender12k.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
+            Assert.IsFalse(map.IsDirty);
             map.ViewScale = 12000;
             map.DisplayWidth = 1024;
             map.DisplayHeight = 1024;
@@ -592,13 +602,13 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render default
-            RenderAndVerify(mapSvc, map, "TestRender12k.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender12kConvenience.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay12k.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay12kConvenience.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender12k.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender12kConvenience.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay12k.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay12kConvenience.png", "PNG");
 
             //Turn off parcels
-            var parcels = map.GetLayerByName("Parcels");
+            var parcels = map.Layers["Parcels"];
             Assert.NotNull(parcels);
             parcels.Visible = false;
             Assert.IsTrue(map.IsDirty);
@@ -606,14 +616,14 @@
             Assert.IsFalse(map.IsDirty);
             
             //Render again
-            RenderAndVerify(mapSvc, map, "TestRender12k_NoParcels.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender12kConvenience_NoParcels.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay12k_NoParcels.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay12kConvenience_NoParcels.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender12k_NoParcels.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender12kConvenience_NoParcels.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay12k_NoParcels.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay12kConvenience_NoParcels.png", "PNG");
 
             //Turn parcels back on
             parcels = null;
-            parcels = map.GetLayerByName("Parcels");
+            parcels = map.Layers["Parcels"];
             Assert.NotNull(parcels);
             parcels.Visible = true;
             Assert.IsTrue(map.IsDirty);
@@ -621,10 +631,10 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render again
-            RenderAndVerify(mapSvc, map, "TestRender12k_ParcelsBackOn.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestRender12kConvenience_ParcelsBackOn.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestRenderOverlay12k_ParcelsBackOn.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestRenderOverlay12kConvenience_ParcelsBackOn.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestRender12k_ParcelsBackOn.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestRender12kConvenience_ParcelsBackOn.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestRenderOverlay12k_ParcelsBackOn.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestRenderOverlay12kConvenience_ParcelsBackOn.png", "PNG");
         }
 
         public virtual void TestMapManipulation()
@@ -650,7 +660,7 @@
             metersPerUnit = cs.MetersPerUnitX;
             Trace.TraceInformation("Using MPU of: {0}", metersPerUnit);
 
-            var mid = "Session:" + _conn.SessionID + "//TestMapManipulation.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestMapManipulation.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
             map.ViewScale = 12000;
             map.DisplayWidth = 1024;
@@ -664,43 +674,43 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render default
-            RenderAndVerify(mapSvc, map, "TestMapManipulation12kWithRail.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestMapManipulation12kConvenienceWithRail.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestMapManipulationOverlay12kWithRail.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestMapManipulationOverlay12kConvenienceWithRail.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestMapManipulation12kWithRail.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestMapManipulation12kConvenienceWithRail.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestMapManipulationOverlay12kWithRail.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestMapManipulationOverlay12kConvenienceWithRail.png", "PNG");
 
-            RenderLegendAndVerify(mapSvc, map, 200, 600, "TestLegend12kWithRail.png", "PNG");
-            RenderLegendAndVerifyConvenience(map, 200, 600, "TestLegend12kConvenienceWithRail.png", "PNG");
+            RenderLegendAndVerify(mapSvc, map, 200, 600, TestPrefix + "TestLegend12kWithRail.png", "PNG");
+            RenderLegendAndVerifyConvenience(map, 200, 600, TestPrefix + "TestLegend12kConvenienceWithRail.png", "PNG");
 
             //Remove parcels
-            var rail = map.GetLayerByName("Rail");
+            var rail = map.Layers["Rail"];
             Assert.NotNull(rail);
-            map.RemoveLayer(rail);
+            map.Layers.Remove(rail);
             Assert.IsTrue(map.IsDirty);
             map.Save();
             Assert.IsFalse(map.IsDirty);
 
             //Render again
-            RenderAndVerify(mapSvc, map, "TestMapManipulation12k_RailRemoved.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestMapManipulation12kConvenience_RailRemoved.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestMapManipulationOverlay12k_RailRemoved.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestMapManipulationOverlay12kConvenience_RailRemoved.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestMapManipulation12k_RailRemoved.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestMapManipulation12kConvenience_RailRemoved.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestMapManipulationOverlay12k_RailRemoved.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestMapManipulationOverlay12kConvenience_RailRemoved.png", "PNG");
 
-            RenderLegendAndVerify(mapSvc, map, 200, 600, "TestLegend12k_RailRemoved.png", "PNG");
-            RenderLegendAndVerifyConvenience(map, 200, 600, "TestLegend12kConvenience_RailRemoved.png", "PNG");
+            RenderLegendAndVerify(mapSvc, map, 200, 600, TestPrefix + "TestLegend12k_RailRemoved.png", "PNG");
+            RenderLegendAndVerifyConvenience(map, 200, 600, TestPrefix + "TestLegend12kConvenience_RailRemoved.png", "PNG");
 
             //Add rail again
             rail = null;
-            rail = map.GetLayerByName("Rail");
+            rail = map.Layers["Rail"];
             Assert.Null(rail);
 
-            rail = map.CreateLayer("Library://UnitTests/Layers/Rail.LayerDefinition", null);
+            rail = mapSvc.CreateMapLayer(map, (ILayerDefinition)resSvc.GetResource("Library://UnitTests/Layers/Rail.LayerDefinition"));
             rail.LegendLabel = "Rail";
             rail.Visible = true;
             rail.ShowInLegend = true;
             rail.ExpandInLegend = true;
 
-            map.InsertLayer(0, rail);
+            map.Layers.Insert(0, rail);
 
             //map.AddLayer(rail);
             //Set draw order above parcels
@@ -712,13 +722,13 @@
             Assert.IsFalse(map.IsDirty);
 
             //Render again. Rail should be above parcels
-            RenderAndVerify(mapSvc, map, "TestMapManipulation12k_RailReAdded.png", "PNG");
-            RenderAndVerifyConvenience(map, "TestMapManipulation12kConvenience_RailReAdded.png", "PNG");
-            RenderDynamicOverlayAndVerify(mapSvc, map, "TestMapManipulationOverlay12k_RailReAdded.png", "PNG");
-            RenderDynamicOverlayAndVerifyConvenience(map, "TestMapManipulationOverlay12kConvenience_RailReAdded.png", "PNG");
+            RenderAndVerify(mapSvc, map, TestPrefix + "TestMapManipulation12k_RailReAdded.png", "PNG");
+            RenderAndVerifyConvenience(map, TestPrefix + "TestMapManipulation12kConvenience_RailReAdded.png", "PNG");
+            RenderDynamicOverlayAndVerify(mapSvc, map, TestPrefix + "TestMapManipulationOverlay12k_RailReAdded.png", "PNG");
+            RenderDynamicOverlayAndVerifyConvenience(map, TestPrefix + "TestMapManipulationOverlay12kConvenience_RailReAdded.png", "PNG");
 
-            RenderLegendAndVerify(mapSvc, map, 200, 600, "TestLegend12k_RailReAdded.png", "PNG");
-            RenderLegendAndVerifyConvenience(map, 200, 600, "TestLegend12kConvenience_RailReAdded.png", "PNG");
+            RenderLegendAndVerify(mapSvc, map, 200, 600, TestPrefix + "TestLegend12k_RailReAdded.png", "PNG");
+            RenderLegendAndVerifyConvenience(map, 200, 600, TestPrefix + "TestLegend12kConvenience_RailReAdded.png", "PNG");
         }
 
         public virtual void TestMapManipulation2()
@@ -752,8 +762,13 @@
             foreach (var removeMe in removeGroups)
                 mdf.RemoveGroup(removeMe);
 
+            var testResourceId = "Library://UnitTests/Maps/Sheboygan_" + TestPrefix + "_TestMapManipulation2.MapDefinition";
+            resSvc.SaveResourceAs(mdf, testResourceId);
+            mdf = resSvc.GetResource(testResourceId) as IMapDefinition;
+            Assert.NotNull(mdf);
+
             //Now create our runtime map
-            var mid = "Session:" + _conn.SessionID + "//TestMapManipulation2.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestMapManipulation2.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
             map.ViewScale = 12000;
             map.DisplayWidth = 1024;
@@ -763,8 +778,8 @@
             Assert.AreEqual(0, map.Layers.Count);
             Assert.AreEqual(0, map.Groups.Count);
 
-            map.Groups.Add(new RuntimeMapGroup(map, "Group1"));
-            map.Groups.Add(new RuntimeMapGroup(map, "Group2"));
+            map.Groups.Add(mapSvc.CreateMapGroup(map, "Group1"));//new RuntimeMapGroup(map, "Group1"));
+            map.Groups.Add(mapSvc.CreateMapGroup(map, "Group2"));//new RuntimeMapGroup(map, "Group2"));
             Assert.AreEqual(2, map.Groups.Count);
 
             Assert.NotNull(map.Groups["Group1"]);
@@ -876,8 +891,13 @@
             foreach (var removeMe in removeGroups)
                 mdf.RemoveGroup(removeMe);
 
+            var testResourceId = "Library://UnitTests/Maps/Sheboygan_" + TestPrefix + "_TestMapManipulation3.MapDefinition";
+            resSvc.SaveResourceAs(mdf, testResourceId);
+            mdf = resSvc.GetResource(testResourceId) as IMapDefinition;
+            Assert.NotNull(mdf);
+
             //Now create our runtime map
-            var mid = "Session:" + _conn.SessionID + "//TestMapManipulation2.Map";
+            var mid = "Session:" + _conn.SessionID + "//" + TestPrefix + "TestMapManipulation2.Map";
             var map = mapSvc.CreateMap(mid, mdf, metersPerUnit);
             map.ViewScale = 12000;
             map.DisplayWidth = 1024;
@@ -887,8 +907,8 @@
             Assert.AreEqual(0, map.Layers.Count);
             Assert.AreEqual(0, map.Groups.Count);
 
-            map.Groups.Add(new RuntimeMapGroup(map, "Group1"));
-            map.Groups.Add(new RuntimeMapGroup(map, "Group2"));
+            map.Groups.Add(mapSvc.CreateMapGroup(map, "Group1"));//new RuntimeMapGroup(map, "Group1"));
+            map.Groups.Add(mapSvc.CreateMapGroup(map, "Group2"));//new RuntimeMapGroup(map, "Group2"));
             Assert.AreEqual(2, map.Groups.Count);
 
             Assert.NotNull(map.Groups["Group1"]);
@@ -1095,6 +1115,11 @@
             return ConnectionUtil.CreateTestHttpConnection();
         }
 
+        public override string TestPrefix
+        {
+            get { return "Http"; }
+        }
+
         [Test]
         public override void TestExtentSerialization()
         {
@@ -1175,13 +1200,18 @@
     }
 
     [TestFixture(Ignore = TestControl.IgnoreLocalNativeRuntimeMapTests)]
-    public class LocalRuntimeMapTests : RuntimeMapTests
+    public class LocalNativeRuntimeMapTests : RuntimeMapTests
     {
         protected override IServerConnection CreateTestConnection()
         {
-            return LocalNativeConnectionUtil.CreateTestConnection();
+            return ConnectionUtil.CreateTestLocalNativeConnection();
         }
 
+        public override string TestPrefix
+        {
+            get { return "LocalNative"; }
+        }
+
         [Test]
         public override void TestExtentSerialization()
         {
@@ -1248,4 +1278,94 @@
             base.TestLargeMapCreatePerformance();
         }
     }
+
+    [TestFixture(Ignore = TestControl.IgnoreLocalRuntimeMapTests)]
+    public class LocalRuntimeMapTests : RuntimeMapTests
+    {
+        protected override IServerConnection CreateTestConnection()
+        {
+            return ConnectionUtil.CreateTestLocalConnection();
+        }
+
+        public override string TestPrefix
+        {
+            get { return "Local"; }
+        }
+
+        protected override bool CaresAboutRuntimeMapState
+        {
+            get
+            {
+                return false;
+            }
+        }
+
+        /*
+        [Test]
+        public override void TestExtentSerialization()
+        {
+            base.TestExtentSerialization();
+        }*/
+
+        [Test]
+        public override void TestResourceEvents()
+        {
+            base.TestResourceEvents();
+        }
+
+        [Test]
+        public override void TestCreate()
+        {
+            base.TestCreate();
+        }
+        
+        [Test]
+        public override void TestSave()
+        {
+            base.TestSave();
+        }
+        
+        [Test]
+        public override void TestRender75k()
+        {
+            base.TestRender75k();
+        }
+
+        [Test]
+        public override void TestRender12k()
+        {
+            base.TestRender12k();
+        }
+
+        [Test]
+        public override void TestLegendIconRendering()
+        {
+            base.TestLegendIconRendering();
+        }
+
+        [Test]
+        public override void TestMapManipulation()
+        {
+            base.TestMapManipulation();
+        }
+
+        [Test]
+        public override void TestMapManipulation2()
+        {
+            base.TestMapManipulation2();
+        }
+
+        [Test]
+        public override void TestMapManipulation3()
+        {
+            base.TestMapManipulation3();
+        }
+
+        /*
+        [Test]
+        public override void TestLargeMapCreatePerformance()
+        {
+            base.TestLargeMapCreatePerformance();
+        }*/
+    }
 }

Modified: trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -37,6 +37,7 @@
         public const bool IgnoreObjectTests = false;
         public const bool IgnoreResourceTests = false;
         public const bool IgnoreHttpRuntimeMapTests = false;
+        public const bool IgnoreLocalRuntimeMapTests = false;
         public const bool IgnoreLocalNativeRuntimeMapTests = true;
         public const bool IgnoreLocalNativePerformanceTests = true;
         public const bool IgnoreLocalNativeFeatureTests = true;
@@ -48,20 +49,22 @@
         public const bool IgnoreMiscTests = false;
     }
 
-    public class LocalNativeConnectionUtil
+    public class ConnectionUtil
     {
-        public static IServerConnection CreateTestConnection()
+        public static string Port { get { return ""; } }
+
+        public static IServerConnection CreateTestLocalNativeConnection()
         {
             return ConnectionProviderRegistry.CreateConnection("Maestro.LocalNative",
                     "ConfigFile", "MGOS22\\webconfig.ini",
                     "Username", "Administrator",
                     "Password", "admin");
         }
-    }
 
-    public class ConnectionUtil
-    {
-        public static string Port { get { return ""; } }
+        public static IServerConnection CreateTestLocalConnection()
+        {
+            return ConnectionProviderRegistry.CreateConnection("Maestro.Local", "ConfigFile", "Platform.ini");
+        }
 
         public static IServerConnection CreateTestHttpConnectionWithGeoRest()
         {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapObservable.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapObservable.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapObservable.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -54,6 +54,16 @@
             return true;
         }
 
+        protected virtual bool ObservableSet<T>(T oldValue, T newValue, Action<T> setter, string propertyName)
+        {
+            if (EqualityComparer<T>.Default.Equals(oldValue, newValue))
+                return false;
+
+            setter.Invoke(newValue);
+            OnPropertyChanged(propertyName);
+            return true;
+        }
+
         /// <summary>
         /// Raises the <see cref="PropertyChanged"/> event
         /// </summary>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -153,6 +153,7 @@
         protected internal RuntimeMap(IServerConnection conn)
         {
             this.StrictSelection = true;
+            this.IsDirty = false;
             _disableChangeTracking = true;
 
             this.WatermarkUsage = (int)WatermarkUsageType.Viewer;
@@ -172,7 +173,6 @@
             }
             this.Layers = new RuntimeMapLayerCollection(this);
             this.Groups = new RuntimeMapGroupCollection(this);
-            this.IsDirty = false;
         }
 
         static IEnumerable<string> GetLayerIds(IMapDefinition mdf)
@@ -1285,10 +1285,10 @@
         /// <value>
         ///   <c>true</c> if this instance is dirty; otherwise, <c>false</c>.
         /// </value>
-        public bool IsDirty
+        public virtual bool IsDirty
         {
             get;
-            internal set;
+            protected internal set;
         }
 
         private void SaveSelectionXml(string resourceID)
@@ -1467,7 +1467,7 @@
                 throw new NotSupportedException();
 
             return _mapSvc.RenderRuntimeMap(
-                this.ResourceID, 
+                this, 
                 this.ViewCenter.X, 
                 this.ViewCenter.Y, 
                 this.ViewScale, 

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -233,9 +233,9 @@
         /// <param name="height">The height.</param>
         /// <param name="dpi">The dpi.</param>
         /// <returns></returns>
-        public virtual System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi)
+        public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi)
         {
-            return this.RenderRuntimeMap(resourceId, x, y, scale, width, height, dpi, "PNG", false);
+            return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false);
         }
 
         /// <summary>
@@ -250,9 +250,9 @@
         /// <param name="height">The height.</param>
         /// <param name="dpi">The dpi.</param>
         /// <returns></returns>
-        public virtual System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi)
+        public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi)
         {
-            return this.RenderRuntimeMap(resourceId, x1, y1, x2, y2, width, height, dpi, "PNG", false);
+            return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false);
         }
 
         /// <summary>
@@ -267,9 +267,9 @@
         /// <param name="dpi">The dpi.</param>
         /// <param name="format">The format.</param>
         /// <returns></returns>
-        public virtual System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format)
+        public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format)
         {
-            return this.RenderRuntimeMap(resourceId, x, y, scale, width, height, dpi, format, false);
+            return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
         }
 
         /// <summary>
@@ -285,9 +285,9 @@
         /// <param name="dpi">The dpi.</param>
         /// <param name="format">The format.</param>
         /// <returns></returns>
-        public virtual System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
+        public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
         {
-            return this.RenderRuntimeMap(resourceId, x1, y1, x2, y2, width, height, dpi, format, false);
+            return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
         }
 
         /// <summary>
@@ -303,7 +303,7 @@
         /// <param name="format">The format.</param>
         /// <param name="clip">if set to <c>true</c> [clip].</param>
         /// <returns></returns>
-        public abstract System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip);
+        public abstract System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip);
         /// <summary>
         /// Renders the runtime map.
         /// </summary>
@@ -318,7 +318,7 @@
         /// <param name="format">The format.</param>
         /// <param name="clip">if set to <c>true</c> [clip].</param>
         /// <returns></returns>
-        public abstract System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip);
+        public abstract System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip);
 
         /// <summary>
         /// Renders a dynamic overlay image of the map

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IMappingService.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -208,7 +208,7 @@
         /// <param name="height">The height.</param>
         /// <param name="dpi">The dpi.</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi);
         /// <summary>
         /// Renders the runtime map.
         /// </summary>
@@ -221,7 +221,7 @@
         /// <param name="height">The height.</param>
         /// <param name="dpi">The dpi.</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi);
 
         /// <summary>
         /// Renders the runtime map.
@@ -235,7 +235,7 @@
         /// <param name="dpi">The dpi.</param>
         /// <param name="format">The format.</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format);
         /// <summary>
         /// Renders the runtime map.
         /// </summary>
@@ -249,7 +249,7 @@
         /// <param name="dpi">The dpi.</param>
         /// <param name="format">The format.</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format);
 
         /// <summary>
         /// Renders the runtime map.
@@ -264,7 +264,7 @@
         /// <param name="format">The format.</param>
         /// <param name="clip">if set to <c>true</c> [clip].</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip);
         /// <summary>
         /// Renders the runtime map.
         /// </summary>
@@ -279,7 +279,7 @@
         /// <param name="format">The format.</param>
         /// <param name="clip">if set to <c>true</c> [clip].</param>
         /// <returns></returns>
-        System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip);
+        System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip);
 
         /// <summary>
         /// Renders the legend for the specified <see cref="RuntimeMap"/> to the requested size and format

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -993,8 +993,9 @@
             return this.OpenRead(req);
         }
 
-		public override System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
+		public override System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
 		{
+            var resourceId = map.ResourceID;
             ResourceIdentifier.Validate(resourceId, ResourceTypes.RuntimeMap);
 			string mapname = resourceId.Substring(resourceId.IndexOf("//") + 2);
 			mapname = mapname.Substring(0, mapname.LastIndexOf("."));
@@ -1024,8 +1025,9 @@
 #endif
 		}
 
-        public override System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
+        public override System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
         {
+            var resourceId = map.ResourceID;
             ResourceIdentifier.Validate(resourceId, ResourceTypes.RuntimeMap);
             string mapname = resourceId.Substring(resourceId.IndexOf("//") + 2);
             mapname = mapname.Substring(0, mapname.LastIndexOf("."));

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -34,6 +34,7 @@
 using System.Diagnostics;
 using OSGeo.MapGuide.MaestroAPI.Local.Commands;
 using OSGeo.MapGuide.MaestroAPI.Commands;
+using OSGeo.MapGuide.MaestroAPI.Mapping;
 
 namespace OSGeo.MapGuide.MaestroAPI.Local
 {
@@ -1042,12 +1043,18 @@
             return base.InferMPU(csWkt, units);
         }
 
+        public override Mapping.RuntimeMap OpenMap(string runtimeMapResourceId)
+        {
+            throw new NotSupportedException();
+        }
+
         public override Mapping.RuntimeMap CreateMap(string runtimeMapResourceId, ObjectModels.MapDefinition.IMapDefinition mdf, double metersPerUnit)
         {
             var mdfId = new MgResourceIdentifier(mdf.ResourceID);
             var implMap = new MgdMap(mdfId);
             var map = new LocalRuntimeMap(this, implMap);
             map.ResourceID = runtimeMapResourceId;
+            map.ResetDirtyState();
             return map;
         }
 
@@ -1108,12 +1115,12 @@
             return RenderDynamicOverlay(map, selection, format, true);
         }
 
-        private static MgdSelection Convert(Mapping.MapSelection sel)
+        private static MgdSelection Convert(MgdMap map, Mapping.MapSelection sel)
         {
             if (sel == null)
                 return null;
 
-            MgdSelection impl = new MgdSelection();
+            MgdSelection impl = new MgdSelection(map);
             var xml = sel.ToXml();
             if (!string.IsNullOrEmpty(xml))
                 impl.FromXml(xml);
@@ -1128,8 +1135,9 @@
             var renderSvc = GetRenderingService();
             GetByteReaderMethod fetch = () =>
             {
-                var sel = Convert(selection);
-                return renderSvc.RenderDynamicOverlay(impl.GetWrappedInstance(), sel, format, keepSelection);
+                var implMap = impl.GetWrappedInstance();
+                var sel = Convert(implMap, selection);
+                return renderSvc.RenderDynamicOverlay(implMap, sel, format, keepSelection);
             };
             return new MgReadOnlyStream(fetch);
         }
@@ -1142,43 +1150,89 @@
             var renderSvc = GetRenderingService();
             GetByteReaderMethod fetch = () =>
             {
-                var sel = Convert(selection);
+                var implMap = impl.GetWrappedInstance();
+                var sel = Convert(implMap, selection);
                 var opts = new MgRenderingOptions(format, behaviour, new MgColor(selectionColor));
-                return renderSvc.RenderDynamicOverlay(impl.GetWrappedInstance(), sel, opts);
+                return renderSvc.RenderDynamicOverlay(implMap, sel, opts);
             };
             return new MgReadOnlyStream(fetch);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi)
+        public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi)
+        public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format)
+        public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
+        public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
+        public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            var impl = map as LocalRuntimeMap;
+            if (impl == null)
+                throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+            var implMap = impl.GetWrappedInstance();
+            var renderSvc = GetRenderingService();
+            GetByteReaderMethod fetch = () =>
+            {
+                implMap.SetViewCenterXY(x, y);
+                implMap.SetViewScale(scale);
+                implMap.SetDisplaySize(width, height);
+                implMap.SetDisplayDpi(dpi);
+                return renderSvc.RenderMap(implMap, null, format, false, clip);
+            };
+            return new MgReadOnlyStream(fetch);
         }
 
-        public Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
+        private static double CalculateScale(double mcsW, double mcsH, LocalRuntimeMap map)
         {
-            throw new NotImplementedException(); //TODO: Not needed for Live Map Editor, but will have problems when viewer component is used standalone
+            var mpu = map.MetersPerUnit;
+            var mpp = 0.0254 / map.MetersPerUnit;
+            if (map.DisplayHeight * mcsW > map.DisplayWidth * mcsH)
+                return mcsW * mpu / (map.DisplayWidth * mpp); //width-limited
+            else
+                return mcsH * mpu / (map.DisplayHeight * mpp); //height-limited
         }
 
+        private void GetDisplayViewAndCenter(double llx, double lly, double urx, double ury, LocalRuntimeMap map, out double vcx, out double vcy, out double vscale)
+        {
+            vscale = CalculateScale((urx - llx), (ury - lly), map);
+            vcx = llx + ((urx - llx) / 2);
+            vcy = ury + ((lly - ury) / 2);
+        }
+
+        public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
+        {
+            var impl = map as LocalRuntimeMap;
+            if (impl == null)
+                throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+            var implMap = impl.GetWrappedInstance();
+            var renderSvc = GetRenderingService();
+            GetByteReaderMethod fetch = () =>
+            {
+                double x, y, scale;
+                GetDisplayViewAndCenter(x1, y1, x2, y2, impl, out x, out y, out scale);
+                implMap.SetViewCenterXY(x, y);
+                implMap.SetViewScale(scale);
+                implMap.SetDisplaySize(width, height);
+                implMap.SetDisplayDpi(dpi);
+                return renderSvc.RenderMap(implMap, null, format, false, clip);
+            };
+            return new MgReadOnlyStream(fetch);
+        }
+
         public Stream RenderMapLegend(Mapping.RuntimeMap map, int width, int height, System.Drawing.Color backgroundColor, string format)
         {
             var impl = map as LocalRuntimeMap;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -41,6 +41,7 @@
         { 
             _impl = map;
             InitializeLayersAndGroups();
+            _disableChangeTracking = false;
         }
 
         private void InitializeLayersAndGroups()
@@ -115,7 +116,8 @@
             }
             set
             {
-                _impl.DisplayDpi = value;
+                Action<int> setter = (val) => { _impl.DisplayDpi = val; };
+                ObservableSet(_impl.DisplayDpi, value, setter, "DisplayDpi");
             }
         }
 
@@ -127,7 +129,8 @@
             }
             set
             {
-                _impl.SetDisplaySize(_impl.DisplayWidth, value);
+                Action<int> setter = (val) => { _impl.SetDisplaySize(_impl.DisplayWidth, val); };
+                ObservableSet(_impl.DisplayHeight, value, setter, "DisplayHeight");
             }
         }
 
@@ -139,7 +142,8 @@
             }
             set
             {
-                _impl.SetDisplaySize(value, _impl.DisplayHeight);
+                Action<int> setter = (val) => { _impl.SetDisplaySize(val, _impl.DisplayHeight); };
+                ObservableSet(_impl.DisplayWidth, value, setter, "DisplayWidth");
             }
         }
 
@@ -204,7 +208,12 @@
 
         public override void SetViewCenter(double x, double y)
         {
-            _impl.SetViewCenterXY(x, y);
+            var center = this.ViewCenter;
+            if (center.X != x || center.Y != y)
+            {
+                _impl.SetViewCenterXY(x, y);
+                OnPropertyChanged("ViewCenter");
+            }
         }
 
         public override double ViewScale
@@ -215,7 +224,8 @@
             }
             set
             {
-                _impl.SetViewScale(value);
+                Action<double> setter = (val) => { _impl.SetViewScale(val); };
+                ObservableSet(_impl.ViewScale, value, setter, "ViewScale");
             }
         }
 
@@ -227,13 +237,55 @@
             }
         }
 
+        public override bool IsDirty
+        {
+            get
+            {
+                return base.IsDirty;
+            }
+            protected set
+            {
+                if (_disableChangeTracking) return;
+                base.IsDirty = value;
+            }
+        }
+
         public override void Save()
         {
             //Synchronize the ordering of our layers and groups
+            var layers = _impl.GetLayers();
+            var groups = _impl.GetLayerGroups();
 
+            layers.Clear();
+            groups.Clear();
+
+            foreach (LocalRuntimeMapGroup group in this.Groups)
+            {
+                groups.Add(group.GetWrappedInstance());
+            }
+
+            foreach (LocalRuntimeMapLayer layer in this.Layers)
+            {
+                layers.Add(layer.GetWrappedInstance());
+            }
+
+            this.IsDirty = false;
         }
 
         public MgdMap GetWrappedInstance() { return _impl; }
+
+        public override void Deserialize(Serialization.MgBinaryDeserializer d)
+        {
+            
+        }
+
+        public override void Serialize(Serialization.MgBinarySerializer s)
+        {
+            
+        }
+
+        internal void ResetDirtyState() { this.IsDirty = false; }
+        internal void MakeDirty() { this.IsDirty = true; }
     }
 
     internal class LocalRuntimeMapGroup : RuntimeMapGroup
@@ -245,6 +297,7 @@
         {
             _parent = parent;
             _impl = group;
+            _disableChangeTracking = false;
         }
 
         public override bool ExpandInLegend
@@ -255,7 +308,8 @@
             }
             set
             {
-                MgdMap.SetGroupExpandInLegend(_impl, value);
+                Action<bool> setter = (val) => { MgdMap.SetGroupExpandInLegend(_impl, val); };
+                ObservableSet(_impl.ExpandInLegend, value, setter, "ExpandInLegend");
             }
         }
 
@@ -276,7 +330,11 @@
                 if (groups.IndexOf(value) >= 0)
                 {
                     var grp = groups.GetItem(value);
-                    _impl.Group = grp;
+                    if (grp != _impl.Group)
+                    {
+                        _impl.Group = grp;
+                        OnPropertyChanged("Group");
+                    }
                 }
                 else
                 {
@@ -294,7 +352,9 @@
             set
             {
                 if (_disableChangeTracking) return; //Still initializing it seems
-                _impl.LegendLabel = value;
+
+                Action<string> setter = (val) => { _impl.LegendLabel = val; };
+                ObservableSet(_impl.LegendLabel, value, setter, "LegendLabel");
             }
         }
 
@@ -328,7 +388,8 @@
             set
             {
                 if (_disableChangeTracking) return; //Still initializing it seems
-                _impl.SetDisplayInLegend(value);
+                Action<bool> setter = (val) => { _impl.SetDisplayInLegend(val); };
+                ObservableSet(_impl.GetDisplayInLegend(), value, setter, "ShowInLegend");
             }
         }
 
@@ -349,9 +410,22 @@
             set
             {
                 if (_disableChangeTracking) return; //Still initializing it seems
-                _impl.Visible = value;
+                Action<bool> setter = (val) => { _impl.Visible = val; };
+                ObservableSet(_impl.Visible, value, setter, "Visible");
             }
         }
+
+        internal MgLayerGroup GetWrappedInstance() { return _impl; }
+
+        public override void Deserialize(Serialization.MgBinaryDeserializer d)
+        {
+            
+        }
+
+        public override void Serialize(Serialization.MgBinarySerializer s)
+        {
+            
+        }
     }
 
     internal class LocalRuntimeMapLayer : RuntimeMapLayer
@@ -363,6 +437,7 @@
         {
             _parent = parent;
             _impl = layer;
+            _disableChangeTracking = false;
         }
 
         public override bool ExpandInLegend
@@ -374,7 +449,9 @@
             set
             {
                 if (_disableChangeTracking) return; //Still initializing it seems
-                MgdMap.SetLayerExpandInLegend(_impl, value);
+                Action<bool> setter = (val) => { MgdMap.SetLayerExpandInLegend(_impl, val); };
+                if (ObservableSet(_impl.ExpandInLegend, value, setter, "ExpandInLegend"))
+                    _parent.MakeDirty();
             }
         }
 
@@ -415,11 +492,16 @@
             {
                 if (_disableChangeTracking) return; //Still initializing it seems
                 var impl = _parent.GetWrappedInstance();
-                var groups = impl.GetLayerGroups();
-                if (groups.IndexOf(value) >= 0)
+                var grp = _parent.Groups[value] as LocalRuntimeMapGroup;
+                if (grp != null)
                 {
-                    var grp = groups.GetItem(value);
-                    _impl.Group = grp;
+                    var implGroup = grp.GetWrappedInstance();
+                    if (implGroup != _impl.Group)
+                    {
+                        _impl.Group = implGroup;
+                        OnPropertyChanged("Group");
+                        _parent.MakeDirty();
+                    }
                 }
                 else
                 {
@@ -444,7 +526,9 @@
             }
             set
             {
-                _impl.LegendLabel = value;
+                Action<string> setter = (val) => { _impl.LegendLabel = val; };
+                if (ObservableSet(_impl.LegendLabel, value, setter, "LegendLabel"))
+                    _parent.MakeDirty();
             }
         }
 
@@ -493,7 +577,9 @@
             }
             set
             {
-                _impl.Selectable = value;
+                Action<bool> setter = (val) => { _impl.Selectable = val; };
+                if (ObservableSet(_impl.Selectable, value, setter, "Selectable"))
+                    _parent.MakeDirty();
             }
         }
 
@@ -505,7 +591,9 @@
             }
             set
             {
-                _impl.DisplayInLegend = value;
+                Action<bool> setter = (val) => { _impl.DisplayInLegend = val; };
+                if (ObservableSet(_impl.DisplayInLegend, value, setter, "ShowInLegend"))
+                    _parent.MakeDirty();
             }
         }
 
@@ -525,8 +613,22 @@
             }
             set
             {
-                _impl.Visible = value;
+                Action<bool> setter = (val) => { _impl.Visible = val; };
+                if (ObservableSet(_impl.Visible, value, setter, "Visible"))
+                    _parent.MakeDirty();
             }
         }
+
+        internal MgLayerBase GetWrappedInstance() { return _impl; }
+
+        public override void Serialize(Serialization.MgBinarySerializer s)
+        {
+            
+        }
+
+        public override void Deserialize(Serialization.MgBinaryDeserializer d)
+        {
+            
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-06-27 16:41:20 UTC (rev 6827)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-07-01 11:13:41 UTC (rev 6828)
@@ -598,8 +598,9 @@
                 OnResourceAdded(newpath);
 		}
 
-		public override System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
+        public override System.IO.Stream RenderRuntimeMap(RuntimeMap rtmap, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
 		{
+            var resourceId = rtmap.ResourceID;
 			MgRenderingService rnd = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
 			MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
 			MgGeometryFactory gf = new MgGeometryFactory();
@@ -620,8 +621,9 @@
             return new MgReadOnlyStream(fetch);
 		}
 
-        public override System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
+        public override System.IO.Stream RenderRuntimeMap(RuntimeMap rtmap, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
         {
+            var resourceId = rtmap.ResourceID;
             MgRenderingService rnd = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
             MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
             MgGeometryFactory gf = new MgGeometryFactory();



More information about the mapguide-commits mailing list