[mapguide-commits] r8204 - in sandbox/jng/tiling: Common/MapGuideCommon/MapLayer Common/MapGuideCommon/Services Common/PlatformBase/MapLayer Common/Schema Server/src/Services/Mapping Server/src/UnitTesting Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Jun 14 04:45:22 PDT 2014


Author: jng
Date: 2014-06-14 04:45:22 -0700 (Sat, 14 Jun 2014)
New Revision: 8204

Added:
   sandbox/jng/tiling/Common/Schema/RuntimeMap-3.0.0.xsd
Modified:
   sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp
   sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.h
   sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingDefs.h
   sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingService.h
   sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.cpp
   sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.h
   sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp
   sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h
   sandbox/jng/tiling/Server/src/Services/Mapping/MappingOperationFactory.cpp
   sandbox/jng/tiling/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp
   sandbox/jng/tiling/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp
   sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.cpp
   sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.h
   sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.cpp
   sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.h
   sandbox/jng/tiling/Server/src/UnitTesting/TestTileService.cpp
   sandbox/jng/tiling/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
   sandbox/jng/tiling/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
   sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters
Log:
This submission includes the following changes:
 - Remove redundant set of operation codes for the Mapping Service. We now use MgMappingServiceOpId instead of the inline enum in MgMappingService
 - Move GetTileSetDefinition from MgLayerGroup to MgMap. The map will at most only ever link to one tile set, so it should make more sense to have this method in the MgMap.
 - Update tile service unit tests to verify checked values are the same after saving the MgMap and re-opening the MgMap.
 - Update CreateRuntimeMap/DescribeRuntimeMap:
    - Add new v3.0 RuntimeMap schema
    - Add new overload that takes a schema version, allowing v2.6 and v3.0 responses to be generated.
    - For the v3.0 response, if the MgMap was created from a Tile Set Definition or from a Map Definition linked to a tile set, the tile set definition id and tile size is included in the response.

Modified: sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -36,7 +36,8 @@
     m_inSave(false),
     m_unpackedLayersGroups(false),
     m_colorPalette(NULL),        // lazy instantiation
-    m_watermarkUsage(Viewer)
+    m_watermarkUsage(Viewer),
+    m_tileSetId((MgResourceIdentifier*)NULL)
 {
 }
 
@@ -49,7 +50,8 @@
     m_inSave(false),
     m_unpackedLayersGroups(false),
     m_colorPalette(NULL),        // lazy instantiation
-    m_watermarkUsage(Viewer)
+    m_watermarkUsage(Viewer),
+    m_tileSetId((MgResourceIdentifier*)NULL)
 {
     if (NULL == siteConnection)
     {
@@ -184,13 +186,13 @@
     //If this Map Definition links to a Tile Set Definition, its coordinate system takes precedence
     if (mdef->GetTileSourceType() == MapDefinition::TileSetDefinition)
     {
-        // get the map definition from the resource repository
+        // get the tile set definition from the resource repository
         tileSetDefId = new MgResourceIdentifier(mdef->GetTileSetSource()->GetResourceId());
         Ptr<MgByteReader> tdContent = m_resourceService->GetResourceContent(tileSetDefId);
         Ptr<MgByteSink> tdSink = new MgByteSink(tdContent);
         Ptr<MgByte> tdBytes = tdSink->ToBuffer();
 
-        // parse the map definition
+        // parse the tile set definition
         MdfParser::SAX2Parser parser;
         parser.ParseString((const char*)tdBytes->Bytes(), tdBytes->GetLength());
 
@@ -233,6 +235,7 @@
             m_center = gf.CreatePoint(coordCenter);
         }
         m_backColor = mdef->GetBackgroundColor();
+        m_tileSetId = SAFE_ADDREF((MgResourceIdentifier*)tileSetDefId);
     }
     else
     {
@@ -434,17 +437,11 @@
 
             //create a runtime group from this group and add it to the group collection
             STRING groupName = baseGroup->GetName();
-            Ptr<MgLayerGroup> rtGroup;
-            if (NULL != (MgResourceIdentifier*)tileSetDefId)
-            {
-                rtGroup = new MgLayerGroup(groupName, tileSetDefId);
+            Ptr<MgLayerGroup> rtGroup = new MgLayerGroup(groupName);
+            if (tdef.get() != NULL)
                 rtGroup->SetLayerGroupType(MgLayerGroupType::BaseMapFromTileSet);
-            }
             else
-            {
-                rtGroup = new MgLayerGroup(groupName);
                 rtGroup->SetLayerGroupType(MgLayerGroupType::BaseMap);
-            }
             rtGroup->SetVisible(baseGroup->IsVisible());
             rtGroup->SetDisplayInLegend(baseGroup->IsShowInLegend());
             rtGroup->SetExpandInLegend(baseGroup->IsExpandInLegend());
@@ -576,6 +573,7 @@
 
     m_mapDefinitionId = NULL;
     m_name = mapName;
+    m_tileSetId = SAFE_ADDREF(tileSetDefId);
 
     // reset the colorlist from our layers (std::list dtor clears the list)
     delete m_colorPalette;
@@ -678,7 +676,7 @@
             //create a runtime group from this group and add it to the group collection
             STRING groupName = baseGroup->GetName();
             Ptr<MgLayerGroup> rtGroup;
-            rtGroup = new MgLayerGroup(groupName, tileSetDefId);
+            rtGroup = new MgLayerGroup(groupName);
             rtGroup->SetVisible(baseGroup->IsVisible());
             rtGroup->SetLayerGroupType(MgLayerGroupType::BaseMapFromTileSet);
             rtGroup->SetDisplayInLegend(baseGroup->IsShowInLegend());
@@ -1292,6 +1290,9 @@
     //watermark usage
     stream->WriteInt32(m_watermarkUsage);
 
+    //tile set definition
+    stream->WriteObject(m_tileSetId);
+
     // Serialize Layers and Groups as a blob.
     if (m_inSave)
     {
@@ -1413,6 +1414,9 @@
     //watermark usage
     streamReader->GetInt32(m_watermarkUsage);
 
+    //tile set definition
+    m_tileSetId = (MgResourceIdentifier*)stream->GetObject();
+
     //blob for layers and groups
     INT32 nBytes = 0;
     streamReader->GetInt32(nBytes);
@@ -1568,3 +1572,11 @@
 {
     m_watermarkUsage = watermarkUsage;
 }
+
+//////////////////////////////////////////////////////////////////
+// Returns the resource id of the Tile Set Definition that this group originates from.
+//
+MgResourceIdentifier* MgMap::GetTileSetDefinition()
+{
+    return SAFE_ADDREF((MgResourceIdentifier*)m_tileSetId);
+}
\ No newline at end of file

Modified: sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -565,6 +565,31 @@
     ///
     INT32 GetWatermarkUsage();
 
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the resource id of the Tile Set Definition that created 
+    /// this map, or the Tile Set Definition linked from the Map Definition 
+    /// used to created this map. If it was created from a Map Definition and 
+    /// that does not link to a Tile Set Definition, then NULL is returned.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// MgResourceIdentifier GetTileSetDefinition();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// MgResourceIdentifier GetTileSetDefinition();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// MgResourceIdentifier GetTileSetDefinition();
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \since 3.0
+    ///
+    /// \return
+    /// Returns the resource id of the Tile Set Definition. NULL if created from a Map Definition that does not link
+    /// to a Tile Set
+    MgResourceIdentifier* GetTileSetDefinition();
+
 INTERNAL_API:
 
     /// \brief
@@ -694,6 +719,7 @@
     Ptr<MgSiteConnection> m_siteConnection;
     Ptr<MgMemoryStreamHelper> m_layerGroupHelper;
     Ptr<MgResourceService> m_resourceService;
+    Ptr<MgResourceIdentifier> m_tileSetId;
     bool m_inSave;
     bool m_unpackedLayersGroups;
     ColorStringList* m_colorPalette;

Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingDefs.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingDefs.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingDefs.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -109,6 +109,9 @@
     static const int CreateRuntimeMap2          = 0x1111EE0F;
     static const int DescribeRuntimeMap         = 0x1111EE10;
     static const int DescribeRuntimeMap2        = 0x1111EE11;
+    static const int CreateRuntimeMap3          = 0x1111EE12;
+    static const int DescribeRuntimeMap3        = 0x1111EE13;
+
 };
 /// \endcond
 

Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingService.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingService.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/MappingService.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -638,6 +638,24 @@
     ///
     MgMappingService();
 
+    virtual MgByteReader* DescribeRuntimeMap(MgMap* map,
+                                             CREFSTRING iconFormat,
+                                             INT32 iconWidth,
+                                             INT32 iconHeight,
+                                             INT32 requestedFeatures,
+                                             INT32 iconsPerScaleRange,
+                                             INT32 schemaVersion) = 0;
+
+    virtual MgByteReader* CreateRuntimeMap(MgResourceIdentifier* mapDefinition,
+                                           CREFSTRING targetMapName,
+                                           CREFSTRING sessionId,
+                                           CREFSTRING iconFormat,
+                                           INT32 iconWidth,
+                                           INT32 iconHeight,
+                                           INT32 requestedFeatures,
+                                           INT32 iconsPerScaleRange,
+                                           INT32 schemaVersion) = 0;
+
     //TODO: Get rid of sessionId from API once user information is passed to server
     virtual MgByteReader* GenerateMap(MgMap* map, CREFSTRING sessionId, CREFSTRING mapAgentUri, MgDwfVersion* dwfVersion) = 0;
 
@@ -706,31 +724,6 @@
 
 CLASS_ID:
     static const INT32 m_cls_id = MapGuide_MappingService_MappingService;
-
-public:
-
-    /// \cond INTERNAL
-    //////////////////////////////////////////////////////////////////
-    /// Enumerations
-    enum OperationId
-    {
-        opIdGenerateMap             =  0x1111EE01,
-        opIdGenerateMapUpdate       =  0x1111EE02,
-        opIdGeneratePlot            =  0x1111EE03,
-        opIdGeneratePlotWithLayout  =  0x1111EE04,
-        opIdGenerateMultiPlot       =  0x1111EE05,
-        opIdGenerateLegendPlot      =  0x1111EE06,
-        opIdQueryFeatures           =  0x1111EE07,
-        opIdQueryFeaturesWms        =  0x1111EE08,
-        opIdGeneratePlot2           =  0x1111EE09,
-        opIdGeneratePlot3           =  0x1111EE0A,
-        opIdGenerateLegendImage     =  0x1111EE0D,
-        opIdCreateRuntimeMap        =  0x1111EE0E,
-        opIdCreateRuntimeMap2       =  0x1111EE0F,
-        opIdDescribeRuntimeMap      =  0x1111EE10,
-        opIdDescribeRuntimeMap2     =  0x1111EE11
-    };
-    /// \endcond
 };
 /// \}
 

Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.cpp
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -509,6 +509,40 @@
     return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
 }
 
+MgByteReader* MgProxyMappingService::CreateRuntimeMap(MgResourceIdentifier* mapDefinition,
+                                                      CREFSTRING targetMapName,
+                                                      CREFSTRING sessionId,
+                                                      CREFSTRING iconFormat,
+                                                      INT32 iconWidth,
+                                                      INT32 iconHeight,
+                                                      INT32 requestedFeatures,
+                                                      INT32 iconsPerScaleRange,
+                                                      INT32 schemaVersion)
+{
+    MgCommand cmd;
+
+    cmd.ExecuteCommand(m_connProp,
+                       MgCommand::knObject,
+                       MgMappingServiceOpId::CreateRuntimeMap3,
+                       9,
+                       Mapping_Service,
+                       BUILD_VERSION(3,0,0),
+                       MgCommand::knObject,    mapDefinition,
+                       MgCommand::knString,    &targetMapName,
+                       MgCommand::knString,    &sessionId,
+                       MgCommand::knString,    &iconFormat,
+                       MgCommand::knInt32,     iconWidth,
+                       MgCommand::knInt32,     iconHeight,
+                       MgCommand::knInt32,     requestedFeatures,
+                       MgCommand::knInt32,     iconsPerScaleRange,
+                       MgCommand::knInt32,     schemaVersion,
+                       MgCommand::knNone);
+
+    SetWarning(cmd.GetWarningObject());
+
+    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Returns an XML-based description of the runtime map
@@ -632,6 +666,36 @@
     return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
 }
 
+MgByteReader* MgProxyMappingService::DescribeRuntimeMap(MgMap* map,
+                                                        CREFSTRING iconFormat,
+                                                        INT32 iconWidth,
+                                                        INT32 iconHeight,
+                                                        INT32 requestedFeatures,
+                                                        INT32 iconsPerScaleRange,
+                                                        INT32 schemaVersion)
+{
+    MgCommand cmd;
+
+    cmd.ExecuteCommand(m_connProp,
+                       MgCommand::knObject,
+                       MgMappingServiceOpId::DescribeRuntimeMap3,
+                       7,
+                       Mapping_Service,
+                       BUILD_VERSION(3,0,0),
+                       MgCommand::knObject,    map,
+                       MgCommand::knString,    &iconFormat,
+                       MgCommand::knInt32,     iconWidth,
+                       MgCommand::knInt32,     iconHeight,
+                       MgCommand::knInt32,     requestedFeatures,
+                       MgCommand::knInt32,     iconsPerScaleRange,
+                       MgCommand::knInt32,     schemaVersion,
+                       MgCommand::knNone);
+
+    SetWarning(cmd.GetWarningObject());
+
+    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
 //////////////////////////////////////////////////////////////////
 /// \brief
 /// Sets the connection properties for the Proxy Service.  This

Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyMappingService.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -524,6 +524,24 @@
 
     DECLARE_CREATE_SERVICE()
 
+    virtual MgByteReader* DescribeRuntimeMap(MgMap* map,
+                                             CREFSTRING iconFormat,
+                                             INT32 iconWidth,
+                                             INT32 iconHeight,
+                                             INT32 requestedFeatures,
+                                             INT32 iconsPerScaleRange,
+                                             INT32 schemaVersion);
+
+    virtual MgByteReader* CreateRuntimeMap(MgResourceIdentifier* mapDefinition,
+                                           CREFSTRING targetMapName,
+                                           CREFSTRING sessionId,
+                                           CREFSTRING iconFormat,
+                                           INT32 iconWidth,
+                                           INT32 iconHeight,
+                                           INT32 requestedFeatures,
+                                           INT32 iconsPerScaleRange,
+                                           INT32 schemaVersion);
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Sets the connection properties for the Proxy Service.  This

Modified: sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -54,23 +54,6 @@
 }
 
 //////////////////////////////////////////////////////////////
-// Construct a MgLayerGroup object with the specified name
-//
-MgLayerGroup::MgLayerGroup(CREFSTRING name, MgResourceIdentifier* tileSetDefId)
-    : m_type(MgLayerGroupType::BaseMapFromTileSet),
-      m_name(name),
-      m_group((MgLayerGroup*)NULL),
-      m_visible(true),
-      m_displayInLegend(false),
-      m_expandInLegend(false),
-      m_groups(NULL)
-{
-    //Generate a unique id for this group
-    MgUtil::GenerateUuid(m_objectId);
-    m_tileSetId = SAFE_ADDREF(tileSetDefId);
-}
-
-//////////////////////////////////////////////////////////////
 // Returns the group name
 //
 STRING MgLayerGroup::GetName()
@@ -257,7 +240,6 @@
     stream->WriteBoolean(m_displayInLegend);
     stream->WriteBoolean(m_expandInLegend);
     stream->WriteString(m_legendLabel);
-    stream->WriteObject((MgResourceIdentifier*)m_tileSetId);
 }
 
 
@@ -273,7 +255,6 @@
     stream->GetBoolean(m_displayInLegend);
     stream->GetBoolean(m_expandInLegend);
     stream->GetString(m_legendLabel);
-    m_tileSetId = (MgResourceIdentifier*)stream->GetObject();
 }
 
 
@@ -300,12 +281,4 @@
 void MgLayerGroup::SetContainer(MgLayerGroupCollection* cont)
 {
     m_groups = cont;
-}
-
-//////////////////////////////////////////////////////////////////
-// Returns the resource id of the Tile Set Definition that this group originates from.
-//
-MgResourceIdentifier* MgLayerGroup::GetTileSetDefinition()
-{
-    return SAFE_ADDREF((MgResourceIdentifier*)m_tileSetId);
 }
\ No newline at end of file

Modified: sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -435,28 +435,6 @@
     /// Returns nothing.
     virtual void SetExpandInLegend(bool expandInLegend);
 
-    //////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Returns the resource id of the Tile Set Definition that this group originates from.
-    /// Returns NULL if GetLayerGroupType() is not MgLayerGroupType::BaseMapFromTileSet 
-    ///
-    /// <!-- Syntax in .Net, Java, and PHP -->
-    /// \htmlinclude DotNetSyntaxTop.html
-    /// MgResourceIdentifier GetTileSetDefinition();
-    /// \htmlinclude SyntaxBottom.html
-    /// \htmlinclude JavaSyntaxTop.html
-    /// MgResourceIdentifier GetTileSetDefinition();
-    /// \htmlinclude SyntaxBottom.html
-    /// \htmlinclude PHPSyntaxTop.html
-    /// MgResourceIdentifier GetTileSetDefinition();
-    /// \htmlinclude SyntaxBottom.html
-    ///
-    /// \since 3.0
-    ///
-    /// \return
-    /// Returns the resource id of the Tile Set Definition. NULL if GetLayerGroupType() is not MgLayerGroupType::BaseMapFromTileSet
-    MgResourceIdentifier* GetTileSetDefinition();
-
 INTERNAL_API:
 
     //////////////////////////////////////////////////////////////////
@@ -467,18 +445,6 @@
 
     //////////////////////////////////////////////////////////////////
     /// \brief
-    /// Constructs an MgLayerGroup object with the specified name.
-    ///
-    /// \param name (String/string)
-    /// Name of the group
-    ///
-    /// \param tileSetDefId (MgResourceIdentifier)
-    /// The tile set definition id
-    ///
-    MgLayerGroup(CREFSTRING name, MgResourceIdentifier* tileSetDefId);
-
-    //////////////////////////////////////////////////////////////////
-    /// \brief
     /// Serialize data to a stream
     ///
     /// \param stream

Added: sandbox/jng/tiling/Common/Schema/RuntimeMap-3.0.0.xsd
===================================================================
--- sandbox/jng/tiling/Common/Schema/RuntimeMap-3.0.0.xsd	                        (rev 0)
+++ sandbox/jng/tiling/Common/Schema/RuntimeMap-3.0.0.xsd	2014-06-14 11:45:22 UTC (rev 8204)
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="RuntimeMap">
+    <xs:annotation>
+      <xs:documentation>Describes information about a Runtime Map, so that client applications can interact with it</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="SiteVersion" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>The MapGuide Site Version</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="Name" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>The name of the runtime map. This is the value required for any mapagent operation that require a MAPNAME parameter</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="MapDefinition" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>The resource id of the Map Definition from which this runtime map was created from</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="TileSetDefinition" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>The resource id of the Tile Set Definition that this Map Definition is linked from. If this Map Definition does not link to a tile set, this element is omitted</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="TileWidth" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>The tile width as defined by the settings in the Tile Set Definition. If this Map Definition does not link to a tile set, this element is omitted</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="TileHeight" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>The tile height as defined by the settings in the Tile Set Definition. If this Map Definition does not link to a tile set, this element is omitted</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="BackgroundColor" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>The map's background color in ARGB hex string format</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="DisplayDpi" type="xs:integer">
+          <xs:annotation>
+            <xs:documentation>The number of dots per inch of the map display</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="IconMimeType" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:documentation>The mime type of all inline icons</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="CoordinateSystem" type="CoordinateSystemType" />
+        <xs:element name="Extents" type="Envelope" />
+        <xs:element name="Group" type="RuntimeMapGroup" minOccurs="0" maxOccurs="unbounded" />
+        <xs:element name="Layer" type="RuntimeMapLayer" minOccurs="0" maxOccurs="unbounded" />
+        <xs:element name="FiniteDisplayScale" type="xs:double" minOccurs="0" maxOccurs="unbounded" />
+        <xs:attribute name="version" type="xs:string" use="required" fixed="3.0.0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="CoordinateSystemType">
+    <xs:annotation>
+      <xs:documentation>Describes the coordinate system of the runtime map</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="Wkt" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The WKT string of the coordinate system</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="MentorCode" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The CS-Map code of the coordinate system</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="EpsgCode" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The EPSG code of the coordinate system</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="MetersPerUnit" type="xs:double">
+        <xs:annotation>
+          <xs:documentation>The meters-per-unit value of the coordinate system</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="RuntimeMapGroup">
+    <xs:annotation>
+      <xs:documentation>Describes a group of Runtime Map Layers</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="Name" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The name of the group</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Type" type="xs:integer">
+        <xs:annotation>
+          <xs:documentation>The type of this group. Can be tiled or dynamic. Uses the value of MgLayerGroupType</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="LegendLabel" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The group's legend label</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ObjectId" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The group's unique id. Use this value for turning on/off this group in a GETDYNAMICMAPOVERLAYIMAGE request</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ParentId" type="xs:string" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>The group's parent group id. Use this value for determining parent-child relationships when building a layer/group hierarchy</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="DisplayInLegend" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this group should be displayed in the legend</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ExpandInLegend" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this group should be initially expanded in the legend</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Visible" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this group is potentially visible. Note that this may be true even though the group is not visible. This will occur if one of the groups this group is organized within is not visible.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ActuallyVisible" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates the actual visibility of the group. The visibility depends on the visible property of the group, and the visible property of each group this group is organized within.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="RuntimeMapLayer">
+    <xs:annotation>
+      <xs:documentation>Describes a runtime instance of a Layer Definition</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="Name" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The name of the layer</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Type" type="xs:integer">
+        <xs:annotation>
+          <xs:documentation>The type of this layer. Can be tiled or dynamic. Uses the value of MgLayerType</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="LegendLabel" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The layer's legend label</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ObjectId" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The layer's unique id. Use this value for turning on/off this layer in a GETDYNAMICMAPOVERLAYIMAGE request</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ParentId" type="xs:string" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>The layer's parent group id. Use this value for determining parent-child relationships when building a layer/group hierarchy</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="DisplayInLegend" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this layer should be displayed in the legend</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ExpandInLegend" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this layer should be initially expanded (if layer is themed) in the legend</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Visible" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates whether this layer is potentially visible. Note that this may be true even though the layer is not visible. This will occur if the visible flag of one of the groups this layer is organized within is not visible or when the current viewScale property of the map is outside the scale ranges defined for this layer.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ActuallyVisible" type="xs:boolean">
+        <xs:annotation>
+          <xs:documentation>Indicates the actual visibility of the layer. The visibility depends on the visible property of the group, and the visible property of each group this group is organized within.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="LayerDefinition" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The Layer Definition from which this runtime layer was created from</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="FeatureSource" type="FeatureSourceInfo" minOccurs="0" />
+      <xs:element name="ScaleRange" type="ScaleRangeInfo" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="FeatureSourceInfo">
+    <xs:annotation>
+      <xs:documentation>Describe the Feature Source information for a runtime layer</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="ResourceId" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The Feature Source resource id</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="ClassName" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The qualified FDO class name</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Geometry" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The name of the default Geometry property</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="ScaleRangeInfo">
+    <xs:annotation>
+      <xs:documentation>Describes a scale range of the runtime layer</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="MinScale" type="xs:double">
+        <xs:annotation>
+          <xs:documentation>The minimum scale of this scale range</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="MaxScale" type="xs:double">
+        <xs:annotation>
+          <xs:documentation>The maximum scale of this scale range</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="FeatureStyle" type="FeatureStyleInfo" minOccurs="0" maxOccurs="unbounded">
+        <xs:annotation>
+          <xs:documentation>The feature style for a given geometry type.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="FeatureStyleInfo">
+    <xs:annotation>
+      <xs:documentation>Defines the style rules for a given geometry type</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="Type" type="xs:integer">
+        <xs:annotation>
+          <xs:documentation>The geometry type that this rule is applicable to (1=point, 2=line, 3=area, 4=composite)</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Rule" type="RuleInfo" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="RuleInfo">
+    <xs:annotation>
+      <xs:documentation>Describes a stylization rule in a layer's scale range</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="LegendLabel" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The legend label for this rule</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Filter" type="xs:string">
+        <xs:annotation>
+          <xs:documentation>The FDO filter that features must match in order for them to be stylized using this particular rule</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Icon" type="xs:string" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>Defines the icon for this rule. The icon's image content is in base64 format</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="Envelope">
+    <xs:annotation>
+      <xs:documentation>Specifies an envelope (a rectangle) using two corner points.</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="LowerLeftCoordinate">
+        <xs:annotation>
+          <xs:documentation>Specifies the lower left corner of the envelope.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="X" type="xs:string"/>
+            <xs:element name="Y" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="UpperRightCoordinate">
+        <xs:annotation>
+          <xs:documentation>Specifies the upper right corner of the envelope.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="X" type="xs:string"/>
+            <xs:element name="Y" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file

Modified: sandbox/jng/tiling/Server/src/Services/Mapping/MappingOperationFactory.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Mapping/MappingOperationFactory.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/Services/Mapping/MappingOperationFactory.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -77,7 +77,7 @@
     MG_TRY()
     switch (operationId)
     {
-    case MgMappingService::opIdGenerateMap:
+    case MgMappingServiceOpId::GenerateMap:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -89,7 +89,7 @@
         }
         break;
 
-    case MgMappingService::opIdGenerateMapUpdate:
+    case MgMappingServiceOpId::GenerateMapUpdate:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -101,7 +101,7 @@
         }
         break;
 
-    case MgMappingService::opIdGeneratePlot:
+    case MgMappingServiceOpId::GeneratePlot:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -113,7 +113,7 @@
         }
         break;
 
-    case MgMappingService::opIdGeneratePlot2:
+    case MgMappingServiceOpId::GeneratePlot2:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -125,7 +125,7 @@
         }
         break;
 
-    case MgMappingService::opIdGeneratePlot3:
+    case MgMappingServiceOpId::GeneratePlot3:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -137,7 +137,7 @@
         }
         break;
 
-    case MgMappingService::opIdGenerateMultiPlot:
+    case MgMappingServiceOpId::GenerateMultiPlot:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -149,7 +149,7 @@
         }
         break;
 
-    case MgMappingService::opIdGenerateLegendPlot:
+    case MgMappingServiceOpId::GenerateLegendPlot:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -161,7 +161,7 @@
         }
         break;
 
-    case MgMappingService::opIdGenerateLegendImage:
+    case MgMappingServiceOpId::GenerateLegendImage:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -173,7 +173,7 @@
         }
         break;
 
-    case MgMappingService::opIdQueryFeatures:
+    case MgMappingServiceOpId::QueryFeatures:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -185,7 +185,7 @@
         }
         break;
 
-    case MgMappingService::opIdQueryFeaturesWms:
+    case MgMappingServiceOpId::QueryFeatures2:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
@@ -197,7 +197,7 @@
         }
         break;
 
-    case MgMappingService::opIdCreateRuntimeMap:
+    case MgMappingServiceOpId::CreateRuntimeMap:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(2,6):
@@ -209,7 +209,7 @@
         }
         break;
 
-    case MgMappingService::opIdCreateRuntimeMap2:
+    case MgMappingServiceOpId::CreateRuntimeMap2:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(2,6):
@@ -221,9 +221,21 @@
         }
         break;
 
-    case MgMappingService::opIdDescribeRuntimeMap:
+    case MgMappingServiceOpId::CreateRuntimeMap3:
         switch (VERSION_NO_PHASE(operationVersion))
         {
+        case VERSION_SUPPORTED(3,0):
+            handler.reset(new MgOpCreateRuntimeMap());
+            break;
+        default:
+            throw new MgInvalidOperationVersionException(
+                L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+        break;
+
+    case MgMappingServiceOpId::DescribeRuntimeMap:
+        switch (VERSION_NO_PHASE(operationVersion))
+        {
         case VERSION_SUPPORTED(2,6):
             handler.reset(new MgOpDescribeRuntimeMap());
             break;
@@ -233,7 +245,7 @@
         }
         break;
 
-    case MgMappingService::opIdDescribeRuntimeMap2:
+    case MgMappingServiceOpId::DescribeRuntimeMap2:
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(2,6):
@@ -245,6 +257,18 @@
         }
         break;
 
+    case MgMappingServiceOpId::DescribeRuntimeMap3:
+        switch (VERSION_NO_PHASE(operationVersion))
+        {
+        case VERSION_SUPPORTED(3,0):
+            handler.reset(new MgOpDescribeRuntimeMap());
+            break;
+        default:
+            throw new MgInvalidOperationVersionException(
+                L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+        break;
+
     default:
         throw new MgInvalidOperationException(
             L"MgMappingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: sandbox/jng/tiling/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -103,6 +103,53 @@
 
         EndExecution(byteReader);
     }
+    else if (9 == m_packet.m_NumArguments)
+    {
+        STRING targetMapName;
+        STRING sessionId;
+        STRING iconFormat;
+        INT32 iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange;
+        INT32 schemaVersion;
+
+        Ptr<MgResourceIdentifier> mapDefinition = (MgResourceIdentifier*)m_stream->GetObject();
+        m_stream->GetString(targetMapName);
+        m_stream->GetString(sessionId);
+        m_stream->GetString(iconFormat);
+        m_stream->GetInt32(iconWidth);
+        m_stream->GetInt32(iconHeight);
+        m_stream->GetInt32(requestedFeatures);
+        m_stream->GetInt32(iconsPerScaleRange);
+        m_stream->GetInt32(schemaVersion);
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == mapDefinition) ? L"MgResourceIdentifier" : mapDefinition->ToString().c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(targetMapName);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(sessionId);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(iconFormat);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconWidth);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconHeight);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(requestedFeatures);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconsPerScaleRange);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(schemaVersion);
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        Validate();
+
+        Ptr<MgByteReader> byteReader =
+            m_service->CreateRuntimeMap(mapDefinition, targetMapName, sessionId, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange, schemaVersion);
+
+        EndExecution(byteReader);
+    }
     else if (4 == m_packet.m_NumArguments)
     {
         STRING sessionId;

Modified: sandbox/jng/tiling/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -100,6 +100,50 @@
 
         EndExecution(byteReader);
     }
+    else if (7 == m_packet.m_NumArguments)
+    {
+        STRING targetMapName;
+        STRING sessionId;
+        STRING iconFormat;
+        INT32 iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange;
+        INT32 schemaVersion;
+
+        Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
+        map->SetDelayedLoadResourceService(m_resourceService);
+        Ptr<MgResourceIdentifier> resource = map->GetResourceId();
+
+        m_stream->GetString(iconFormat);
+        m_stream->GetInt32(iconWidth);
+        m_stream->GetInt32(iconHeight);
+        m_stream->GetInt32(requestedFeatures);
+        m_stream->GetInt32(iconsPerScaleRange);
+        m_stream->GetInt32(schemaVersion);
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(iconFormat);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconWidth);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconHeight);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(requestedFeatures);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconsPerScaleRange);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(schemaVersion);
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        Validate();
+
+        Ptr<MgByteReader> byteReader =
+            m_service->DescribeRuntimeMap(map, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange, schemaVersion);
+
+        EndExecution(byteReader);
+    }
     else if (3 == m_packet.m_NumArguments)
     {
         STRING sessionId;

Modified: sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -1761,7 +1761,17 @@
     assert(m_svcDrawing != NULL);
 }
 
+//gets an instance of the tile service using the service manager
+void MgServerMappingService::InitializeTileService()
+{
+    MgServiceManager* serviceMan = MgServiceManager::GetInstance();
+    assert(NULL != serviceMan);
 
+    m_svcTile = dynamic_cast<MgTileService*>(
+        serviceMan->RequestService(MgServiceType::TileService));
+    assert(m_svcTile != NULL);
+} 
+
 // Returns true if the supplied feature type style is compatible with the
 // supplied geometry type: 1=Point, 2=Line, 3=Area, 4=Composite
 bool MgServerMappingService::FeatureTypeStyleSupportsGeomType(MdfModel::FeatureTypeStyle* fts, INT32 geomType)
@@ -1877,6 +1887,17 @@
                                                          INT32 requestedFeatures,
                                                          INT32 iconsPerScaleRange)
 {
+    return DescribeRuntimeMap(map, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange, MG_API_VERSION(3, 0, 0) /* Latest and greatest */);
+}
+
+MgByteReader* MgServerMappingService::DescribeRuntimeMap(MgMap* map,
+                                                         CREFSTRING iconFormat,
+                                                         INT32 iconWidth,
+                                                         INT32 iconHeight,
+                                                         INT32 requestedFeatures,
+                                                         INT32 iconsPerScaleRange,
+                                                         INT32 schemaVersion)
+{
     LayerDefinitionMap layerDefinitionMap;
     if (MgImageFormats::Png != iconFormat &&
         MgImageFormats::Gif != iconFormat &&
@@ -1897,10 +1918,14 @@
     STRING sessionId = map->GetSessionId();
     STRING targetMapName = map->GetName();
     Ptr<MgResourceIdentifier> mapDefinition = map->GetMapDefinition();
+    Ptr<MgResourceIdentifier> tileSetDefinition = map->GetTileSetDefinition();
 
     //TODO: Possible future caching opportunity?
     std::string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";  // NOXLATE
-    xml.append("<RuntimeMap xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"RuntimeMap-2.6.0.xsd\">\n");
+    if (schemaVersion == MG_API_VERSION(2, 6, 0))
+        xml.append("<RuntimeMap xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"RuntimeMap-2.6.0.xsd\">\n");
+    else
+        xml.append("<RuntimeMap xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"RuntimeMap-3.0.0.xsd\" version=\"3.0.0\">\n");
     // ------------------------------ Site Version ----------------------------------//
     xml.append("<SiteVersion>");
     MgServerManager* serverMgr = MgServerManager::GetInstance();
@@ -1918,6 +1943,30 @@
     xml.append("<MapDefinition>");
     xml.append(MgUtil::WideCharToMultiByte(mapDefinition->ToString()));
     xml.append("</MapDefinition>\n");
+    //Write tile set definition if requesting a v3.0.0 response
+    if (NULL != (MgResourceIdentifier*)tileSetDefinition && schemaVersion == MG_API_VERSION(3, 0, 0))
+    {
+        if (m_svcTile == NULL)
+            InitializeTileService();
+
+        std::string sWidth;
+        std::string sHeight;
+        MgUtil::Int32ToString(m_svcTile->GetDefaultTileSizeX(tileSetDefinition), sWidth);
+        MgUtil::Int32ToString(m_svcTile->GetDefaultTileSizeY(tileSetDefinition), sHeight);
+
+        // ------------------------------ Tile Set Definition ID --------------------------------- //
+        xml.append("<TileSetDefinition>");
+        xml.append(MgUtil::WideCharToMultiByte(tileSetDefinition->ToString()));
+        xml.append("</TileSetDefinition>\n");
+        // ------------------------------ Tile Width ---------------------------------- //
+        xml.append("<TileWidth>");
+        xml.append(sWidth);
+        xml.append("</TileWidth>\n");
+        // ------------------------------ Tile Height --------------------------------- //
+        xml.append("<TileHeight>");
+        xml.append(sHeight);
+        xml.append("</TileHeight>\n");
+    }
     // ------------------------------ Background Color ---------------------------------- //
     xml.append("<BackgroundColor>");
     xml.append(MgUtil::WideCharToMultiByte(map->GetBackgroundColor()));
@@ -2097,6 +2146,19 @@
                                                        INT32 requestedFeatures,
                                                        INT32 iconsPerScaleRange)
 {
+    return CreateRuntimeMap(mapDefinition, targetMapName, sessionId, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange, MG_API_VERSION(3, 0, 0) /* Latest and greatest */);
+}
+
+MgByteReader* MgServerMappingService::CreateRuntimeMap(MgResourceIdentifier* mapDefinition,
+                                                       CREFSTRING targetMapName,
+                                                       CREFSTRING sessionId,
+                                                       CREFSTRING iconFormat,
+                                                       INT32 iconWidth,
+                                                       INT32 iconHeight,
+                                                       INT32 requestedFeatures,
+                                                       INT32 iconsPerScaleRange,
+                                                       INT32 schemaVersion)
+{
     CHECKARGUMENTNULL(mapDefinition, L"MgServerMappingService.CreateRuntimeMap");
     LayerDefinitionMap layerDefinitionMap;
     if (MgImageFormats::Png != iconFormat &&
@@ -2135,7 +2197,7 @@
     sel->Save(m_svcResource, sessionId, targetMapName);
     map->Save(m_svcResource, mapStateId);
 
-    byteReader = DescribeRuntimeMap(map, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange);
+    byteReader = DescribeRuntimeMap(map, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange, schemaVersion);
 
     MG_SERVER_MAPPING_SERVICE_CATCH_AND_THROW(L"MgServerMappingService.CreateRuntimeMap")
 

Modified: sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/Services/Mapping/ServerMappingService.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -130,6 +130,16 @@
                                                INT32 requestedFeatures,
                                                INT32 iconsPerScaleRange);
 
+        virtual MgByteReader* CreateRuntimeMap(MgResourceIdentifier* mapDefinition,
+                                               CREFSTRING targetMapName,
+                                               CREFSTRING sessionId,
+                                               CREFSTRING iconFormat,
+                                               INT32 iconWidth,
+                                               INT32 iconHeight,
+                                               INT32 requestedFeatures,
+                                               INT32 iconsPerScaleRange,
+                                               INT32 schemaVersion);
+
         virtual MgByteReader* DescribeRuntimeMap(MgMap* map,
                                                  INT32 requestedFeatures,
                                                  INT32 iconsPerScaleRange);
@@ -141,6 +151,14 @@
                                                  INT32 requestedFeatures,
                                                  INT32 iconsPerScaleRange);
 
+        virtual MgByteReader* DescribeRuntimeMap(MgMap* map,
+                                                 CREFSTRING iconFormat,
+                                                 INT32 iconWidth,
+                                                 INT32 iconHeight,
+                                                 INT32 requestedFeatures,
+                                                 INT32 iconsPerScaleRange,
+                                                 INT32 schemaVersion);
+
         void SetConnectionProperties(MgConnectionProperties* connProp);
 
 // Data Members
@@ -154,10 +172,12 @@
         void InitializeFeatureService();
         void InitializeResourceService();
         void InitializeDrawingService();
+        void InitializeTileService();
 
         Ptr<MgFeatureService> m_svcFeature;
         Ptr<MgResourceService> m_svcResource;
         Ptr<MgDrawingService> m_svcDrawing;
+        Ptr<MgTileService> m_svcTile;
         Ptr<MgCoordinateSystemFactory> m_pCSFactory;
 
         INT32 m_rasterGridSize;

Modified: sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -128,6 +128,16 @@
         Ptr<MgByteReader> ldfrdr4 = ldfsrc4->GetReader();
         m_svcResource->SetResource(ldfres4, ldfrdr4, NULL);
 
+        Ptr<MgResourceIdentifier> ldfres5 = new MgResourceIdentifier(L"Library://UnitTests/Layers/RoadCenterLines.LayerDefinition");
+        Ptr<MgByteSource> ldfsrc5 = new MgByteSource(L"../UnitTestFiles/UT_RoadCenterLines.ldf", false);
+        Ptr<MgByteReader> ldfrdr5 = ldfsrc5->GetReader();
+        m_svcResource->SetResource(ldfres5, ldfrdr5, NULL);
+
+        Ptr<MgResourceIdentifier> ldfres6 = new MgResourceIdentifier(L"Library://UnitTests/Layers/VotingDistricts.LayerDefinition");
+        Ptr<MgByteSource> ldfsrc6 = new MgByteSource(L"../UnitTestFiles/UT_VotingDistricts.ldf", false);
+        Ptr<MgByteReader> ldfrdr6 = ldfsrc6->GetReader();
+        m_svcResource->SetResource(ldfres6, ldfrdr6, NULL);
+
         //publish the feature sources
         Ptr<MgResourceIdentifier> fsres1 = new MgResourceIdentifier(L"Library://UnitTests/Data/HydrographicPolygons.FeatureSource");
         Ptr<MgByteSource> fssrc1 = new MgByteSource(L"../UnitTestFiles/UT_HydrographicPolygons.fs", false);
@@ -176,6 +186,16 @@
         Ptr<MgByteSource> datasrc = new MgByteSource(L"../UnitTestFiles/UT_Symbols.dwf", false);
         Ptr<MgByteReader> datardr = datasrc->GetReader();
         m_svcResource->SetResourceData(slres1, L"symbols.dwf", L"File", datardr);
+
+        Ptr<MgResourceIdentifier> mapres2 = new MgResourceIdentifier(L"Library://UnitTests/Maps/LinkedTileSet.MapDefinition");
+        Ptr<MgByteSource> mdfsrc2 = new MgByteSource(L"../UnitTestFiles/UT_LinkedTileSet.mdf", false);
+        Ptr<MgByteReader> mdfrdr2 = mdfsrc2->GetReader();
+        m_svcResource->SetResource(mapres2, mdfrdr2, NULL);
+
+        Ptr<MgResourceIdentifier> tilesetres1 = new MgResourceIdentifier(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition");
+        Ptr<MgByteSource> tsdsrc1 = new MgByteSource(L"../UnitTestFiles/UT_BaseMap.tsd", false);
+        Ptr<MgByteReader> tsdrdr1 = tsdsrc1->GetReader();
+        m_svcResource->SetResource(tilesetres1, tsdrdr1, NULL);
     }
     catch (MgException* e)
     {
@@ -216,6 +236,12 @@
         Ptr<MgResourceIdentifier> ldfres4 = new MgResourceIdentifier(L"Library://UnitTests/Layers/RotatedPointStyles.LayerDefinition");
         m_svcResource->DeleteResource(ldfres4);
 
+        Ptr<MgResourceIdentifier> ldfres5 = new MgResourceIdentifier(L"Library://UnitTests/Layers/RoadCenterLines.LayerDefinition");
+        m_svcResource->DeleteResource(ldfres5);
+
+        Ptr<MgResourceIdentifier> ldfres6 = new MgResourceIdentifier(L"Library://UnitTests/Layers/VotingDistricts.LayerDefinition");
+        m_svcResource->DeleteResource(ldfres6);
+
         //delete the feature sources
         Ptr<MgResourceIdentifier> fsres1 = new MgResourceIdentifier(L"Library://UnitTests/Data/HydrographicPolygons.FeatureSource");
         m_svcResource->DeleteResource(fsres1);
@@ -237,6 +263,12 @@
         Ptr<MgResourceIdentifier> slres1 = new MgResourceIdentifier(L"Library://UnitTests/Symbols/SymbolMart.SymbolLibrary");
         m_svcResource->DeleteResource(slres1);
 
+        Ptr<MgResourceIdentifier> mapres2 = new MgResourceIdentifier(L"Library://UnitTests/Maps/LinkedTileSet.MapDefinition");
+        m_svcResource->DeleteResource(mapres2);
+
+        Ptr<MgResourceIdentifier> tilesetres1 = new MgResourceIdentifier(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition");
+        m_svcResource->DeleteResource(tilesetres1);
+
         #ifdef _DEBUG
         MgFdoConnectionManager* pFdoConnectionManager = MgFdoConnectionManager::GetInstance();
         if(pFdoConnectionManager)
@@ -459,6 +491,34 @@
     }
 }
 
+void TestMappingService::TestCase_CreateAndDescribeLinkedRuntimeMap()
+{
+    try
+    {
+        Ptr<MgResourceIdentifier> mdfId = new MgResourceIdentifier(L"Library://UnitTests/Maps/LinkedTileSet.MapDefinition");
+        STRING format = MgImageFormats::Png;
+        Ptr<MgByteReader> rtMap = m_svcMapping->CreateRuntimeMap(mdfId, L"TestCase_CreateAndDescribeLinkedRuntimeMap", m_session, format, 16, 16, 0, 25);
+        Ptr<MgByteSink> sink = new MgByteSink(rtMap);
+        sink->ToFile(L"../UnitTestFiles/TestCase_CreateLinkedRuntimeMap.xml");
+
+        Ptr<MgMap> map = new MgMap(m_siteConnection);
+        map->Open(L"TestCase_CreateAndDescribeLinkedRuntimeMap");
+        rtMap = m_svcMapping->DescribeRuntimeMap(map, format, 16, 16, 0, 25);
+        sink = new MgByteSink(rtMap);
+        sink->ToFile(L"../UnitTestFiles/TestCase_DescribeLinkedRuntimeMap.xml");
+    }
+    catch(MgException* e)
+    {
+        STRING message = e->GetDetails(TEST_LOCALE);
+        SAFE_RELEASE(e);
+        CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+    }
+    catch(...)
+    {
+        throw;
+    }
+}
+
 void TestMappingService::TestCase_GetMap()
 {
     try

Modified: sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.h
===================================================================
--- sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.h	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/UnitTesting/TestMappingService.h	2014-06-14 11:45:22 UTC (rev 8204)
@@ -38,6 +38,7 @@
     CPPUNIT_TEST(TestCase_GetLegendImagePointStyleWithConstRotations);
     CPPUNIT_TEST(TestCase_CreateRuntimeMap);
     CPPUNIT_TEST(TestCase_DescribeRuntimeMap);
+    CPPUNIT_TEST(TestCase_CreateAndDescribeLinkedRuntimeMap);
     //CPPUNIT_TEST(TestCase_QueryFeaturesImageMap);
 
     CPPUNIT_TEST(TestEnd); // This must be the very last unit test
@@ -60,6 +61,7 @@
     void TestCase_SaveMap();
     void TestCase_GetPlot();
     void TestCase_GetMultiPlot();
+    void TestCase_CreateAndDescribeLinkedRuntimeMap();
     void TestCase_GetPlotUsingCurrentCenterAndScale();
     void TestCase_GetPlotUsingOverriddenCenterAndScale();
     void TestCase_GetPlotUsingExtents();

Modified: sandbox/jng/tiling/Server/src/UnitTesting/TestTileService.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/UnitTesting/TestTileService.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Server/src/UnitTesting/TestTileService.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -562,7 +562,7 @@
         Ptr<MgResourceIdentifier> tsId;
         Ptr<MgLayerGroupCollection> groups = map->GetLayerGroups();
         Ptr<MgLayerGroup> group = groups->GetItem(L"BaseLayers");
-        tsId = group->GetTileSetDefinition();
+        tsId = map->GetTileSetDefinition();
 
         // set up the tile indices
         INT32 numTileRows = tileRowMax - tileRowMin + 1;
@@ -1313,7 +1313,8 @@
 {
     try
     {
-        Ptr<MgMap> map = CreateMap();
+        STRING mapName = L"TestCase_MgMap_Inline";
+        Ptr<MgMap> map = CreateMap(mapName);
 
         Ptr<MgEnvelope> extents = map->GetMapExtent();
         Ptr<MgCoordinate> ll = extents->GetLowerLeftCoordinate();
@@ -1322,15 +1323,60 @@
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181,   ll->GetY(), 0.000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.66452777186925, ur->GetX(), 0.00000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.8037962206133,  ur->GetY(), 0.0000000000001);
+        Ptr<MgResourceIdentifier> tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL == (MgResourceIdentifier*)tsId);
 
         Ptr<MgLayerGroupCollection> groups = map->GetLayerGroups();
         for (INT32 i = 0; i < groups->GetCount(); i++)
         {
             Ptr<MgLayerGroup> group = groups->GetItem(i);
             CPPUNIT_ASSERT(MgLayerGroupType::BaseMap == group->GetLayerGroupType());
-            Ptr<MgResourceIdentifier> tsId = group->GetTileSetDefinition();
-            CPPUNIT_ASSERT(NULL == (MgResourceIdentifier*)tsId);
         }
+
+        // Initialize service objects.
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        Ptr<MgServerSiteService> svcSite = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
+        Ptr<MgResourceService> svcRes = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
+        assert(svcSite != NULL);
+        assert(svcRes != NULL);
+        // Set the current MgUserInformation
+        // This must be done before calling CreateSession()
+        Ptr<MgUserInformation> userInfo = new MgUserInformation(
+            L"Administrator", L"admin");
+        userInfo->SetLocale(TEST_LOCALE);
+        MgUserInformation::SetCurrentUserInfo(userInfo);
+        STRING session = svcSite->CreateSession();
+
+        Ptr<MgResourceIdentifier> mapStateId = new MgResourceIdentifier(MgRepositoryType::Session, session, L"", map->GetName(), MgResourceType::Map);
+        map->Save(svcRes, mapStateId);
+
+        map = NULL;
+
+        Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
+        userInfo = new MgUserInformation(session);
+        siteConn->Open(userInfo);
+        map = new MgMap(siteConn);
+        map->Open(mapName);
+
+        //Re-check. All should be the same
+        extents = map->GetMapExtent();
+        ll = extents->GetLowerLeftCoordinate();
+        ur = extents->GetUpperRightCoordinate();
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.79786601383196, ll->GetX(), 0.00000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181,   ll->GetY(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.66452777186925, ur->GetX(), 0.00000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.8037962206133,  ur->GetY(), 0.0000000000001);
+        tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL == (MgResourceIdentifier*)tsId);
+
+        groups = map->GetLayerGroups();
+        for (INT32 i = 0; i < groups->GetCount(); i++)
+        {
+            Ptr<MgLayerGroup> group = groups->GetItem(i);
+            CPPUNIT_ASSERT(MgLayerGroupType::BaseMap == group->GetLayerGroupType());
+        }
+
+        svcSite->DestroySession(session);
     }
     catch (MgException* e)
     {
@@ -1348,7 +1394,8 @@
 {
     try
     {
-        Ptr<MgMap> map = CreateMapLinked();
+        STRING mapName = L"TestCase_MgMap_Linked";
+        Ptr<MgMap> map = CreateMapLinked(mapName);
 
         //Bounds should be that of the tile set
         Ptr<MgEnvelope> extents = map->GetMapExtent();
@@ -1358,16 +1405,62 @@
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181, ll->GetY(), 0.000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.664527771869, ur->GetX(), 0.000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.803796220613, ur->GetY(), 0.000000000001);
+        Ptr<MgResourceIdentifier> tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
+        CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
 
         Ptr<MgLayerGroupCollection> groups = map->GetLayerGroups();
         for (INT32 i = 0; i < groups->GetCount(); i++)
         {
             Ptr<MgLayerGroup> group = groups->GetItem(i);
             CPPUNIT_ASSERT(MgLayerGroupType::BaseMapFromTileSet == group->GetLayerGroupType());
-            Ptr<MgResourceIdentifier> tsId = group->GetTileSetDefinition();
-            CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
-            CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
         }
+
+        // Initialize service objects.
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        Ptr<MgServerSiteService> svcSite = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
+        Ptr<MgResourceService> svcRes = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
+        assert(svcSite != NULL);
+        assert(svcRes != NULL);
+        // Set the current MgUserInformation
+        // This must be done before calling CreateSession()
+        Ptr<MgUserInformation> userInfo = new MgUserInformation(
+            L"Administrator", L"admin");
+        userInfo->SetLocale(TEST_LOCALE);
+        MgUserInformation::SetCurrentUserInfo(userInfo);
+        STRING session = svcSite->CreateSession();
+
+        Ptr<MgResourceIdentifier> mapStateId = new MgResourceIdentifier(MgRepositoryType::Session, session, L"", map->GetName(), MgResourceType::Map);
+        map->Save(svcRes, mapStateId);
+
+        map = NULL;
+
+        Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
+        userInfo = new MgUserInformation(session);
+        siteConn->Open(userInfo);
+        map = new MgMap(siteConn);
+        map->Open(mapName);
+
+        //Re-check. All should be the same
+        extents = map->GetMapExtent();
+        ll = extents->GetLowerLeftCoordinate();
+        ur = extents->GetUpperRightCoordinate();
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.797866013831, ll->GetX(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181, ll->GetY(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.664527771869, ur->GetX(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.803796220613, ur->GetY(), 0.000000000001);
+        tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
+        CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
+
+        groups = map->GetLayerGroups();
+        for (INT32 i = 0; i < groups->GetCount(); i++)
+        {
+            Ptr<MgLayerGroup> group = groups->GetItem(i);
+            CPPUNIT_ASSERT(MgLayerGroupType::BaseMapFromTileSet == group->GetLayerGroupType());
+        }
+
+        svcSite->DestroySession(session);
     }
     catch (MgException* e)
     {
@@ -1432,10 +1525,12 @@
 {
     try
     {
+        STRING mapName = L"TestCase_MgMapFromTileSet";
+
         // make a runtime map
         Ptr<MgResourceIdentifier> tsdres = new MgResourceIdentifier(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition");
         MgMap* map = new MgMap(m_siteConnection);
-        map->Create(tsdres, L"LinkedTileSet");
+        map->Create(tsdres, mapName);
 
         Ptr<MgResourceIdentifier> mdfId = map->GetMapDefinition();
         CPPUNIT_ASSERT(NULL == (MgResourceIdentifier*)mdfId);
@@ -1448,16 +1543,62 @@
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181, ll->GetY(), 0.000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.664527771869, ur->GetX(), 0.000000000001);
         CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.803796220613, ur->GetY(), 0.000000000001);
+        Ptr<MgResourceIdentifier> tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
+        CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
 
         Ptr<MgLayerGroupCollection> groups = map->GetLayerGroups();
         for (INT32 i = 0; i < groups->GetCount(); i++)
         {
             Ptr<MgLayerGroup> group = groups->GetItem(i);
             CPPUNIT_ASSERT(MgLayerGroupType::BaseMapFromTileSet == group->GetLayerGroupType());
-            Ptr<MgResourceIdentifier> tsId = group->GetTileSetDefinition();
-            CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
-            CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
         }
+
+        // Initialize service objects.
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        Ptr<MgServerSiteService> svcSite = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
+        Ptr<MgResourceService> svcRes = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
+        assert(svcSite != NULL);
+        assert(svcRes != NULL);
+        // Set the current MgUserInformation
+        // This must be done before calling CreateSession()
+        Ptr<MgUserInformation> userInfo = new MgUserInformation(
+            L"Administrator", L"admin");
+        userInfo->SetLocale(TEST_LOCALE);
+        MgUserInformation::SetCurrentUserInfo(userInfo);
+        STRING session = svcSite->CreateSession();
+
+        Ptr<MgResourceIdentifier> mapStateId = new MgResourceIdentifier(MgRepositoryType::Session, session, L"", map->GetName(), MgResourceType::Map);
+        map->Save(svcRes, mapStateId);
+
+        map = NULL;
+
+        Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
+        userInfo = new MgUserInformation(session);
+        siteConn->Open(userInfo);
+        map = new MgMap(siteConn);
+        map->Open(mapName);
+
+        //Re-check. All should be the same
+        extents = map->GetMapExtent();
+        ll = extents->GetLowerLeftCoordinate();
+        ur = extents->GetUpperRightCoordinate();
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.797866013831, ll->GetX(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.686857862181, ll->GetY(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(-87.664527771869, ur->GetX(), 0.000000000001);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.803796220613, ur->GetY(), 0.000000000001);
+        tsId = map->GetTileSetDefinition();
+        CPPUNIT_ASSERT(NULL != (MgResourceIdentifier*)tsId);
+        CPPUNIT_ASSERT(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition" == tsId->ToString());
+
+        groups = map->GetLayerGroups();
+        for (INT32 i = 0; i < groups->GetCount(); i++)
+        {
+            Ptr<MgLayerGroup> group = groups->GetItem(i);
+            CPPUNIT_ASSERT(MgLayerGroupType::BaseMapFromTileSet == group->GetLayerGroupType());
+        }
+
+        svcSite->DestroySession(session);
     }
     catch (MgException* e)
     {

Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -118,7 +118,7 @@
     }
 
     Ptr<MgMappingService> mappingService = (MgMappingService*)CreateService(MgServiceType::MappingService);
-    byteReader = mappingService->CreateRuntimeMap(mdfId, mapName, sessionId, m_iconFormat, m_iconWidth, m_iconHeight, m_requestDataMask, m_iconLimitPerScaleRange);
+    byteReader = mappingService->CreateRuntimeMap(mdfId, mapName, sessionId, m_iconFormat, m_iconWidth, m_iconHeight, m_requestDataMask, m_iconLimitPerScaleRange, m_userInfo->GetApiVersion());
     // Convert to requested response format, if necessary
     ProcessFormatConversion(byteReader);
 
@@ -138,11 +138,12 @@
 
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
-    if (version != MG_API_VERSION(2,6,0))
+    if (version != MG_API_VERSION(2,6,0) &&
+        version != MG_API_VERSION(3,0,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpCreateRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpCreateRuntimeMap.ValidateOperationVersion");
-}
+}
\ No newline at end of file

Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2014-06-14 11:45:22 UTC (rev 8204)
@@ -98,7 +98,7 @@
     map->Open(m_mapName);
 
     Ptr<MgMappingService> mappingService = (MgMappingService*)CreateService(MgServiceType::MappingService);
-    byteReader = mappingService->DescribeRuntimeMap(map, m_iconFormat, m_iconWidth, m_iconHeight, m_requestDataMask, m_iconLimitPerScaleRange);
+    byteReader = mappingService->DescribeRuntimeMap(map, m_iconFormat, m_iconWidth, m_iconHeight, m_requestDataMask, m_iconLimitPerScaleRange, m_userInfo->GetApiVersion());
     // Convert to requested response format, if necessary
     ProcessFormatConversion(byteReader);
 
@@ -118,11 +118,12 @@
 
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
-    if (version != MG_API_VERSION(2,6,0))
+    if (version != MG_API_VERSION(2,6,0) &&
+        version != MG_API_VERSION(3,0,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpDescribeRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpDescribeRuntimeMap.ValidateOperationVersion");
-}
+}
\ No newline at end of file

Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters	2014-06-14 01:05:50 UTC (rev 8203)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters	2014-06-14 11:45:22 UTC (rev 8204)
@@ -386,10 +386,12 @@
     <ClCompile Include="ReaderByteSourceImpl.cpp">
       <Filter>Byte Source Adapters</Filter>
     </ClCompile>
-    <ClCompile Include="HttpDescribeRuntimeMap.cpp" />
     <ClCompile Include="HttpGetTileProviders.cpp">
       <Filter>Tile Service</Filter>
     </ClCompile>
+    <ClCompile Include="HttpDescribeRuntimeMap.cpp">
+      <Filter>Mapping Service</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="HttpApplyResourcePackage.h">
@@ -761,10 +763,12 @@
     <ClInclude Include="ReaderByteSourceImpl.h">
       <Filter>Byte Source Adapters</Filter>
     </ClInclude>
-    <ClInclude Include="HttpDescribeRuntimeMap.h" />
     <ClInclude Include="HttpGetTileProviders.h">
       <Filter>Tile Service</Filter>
     </ClInclude>
+    <ClInclude Include="HttpDescribeRuntimeMap.h">
+      <Filter>Mapping Service</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="HttpHandler.rc" />



More information about the mapguide-commits mailing list