[mapguide-commits] r8176 - in sandbox/jng/tiling/Common: MapGuideCommon/MapLayer MdfModel MdfParser PlatformBase/MapLayer PlatformBase/Services Schema
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri May 30 02:44:22 PDT 2014
Author: jng
Date: 2014-05-30 02:44:22 -0700 (Fri, 30 May 2014)
New Revision: 8176
Added:
sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.cpp
sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.h
sandbox/jng/tiling/Common/MdfModel/TileSetSource.cpp
sandbox/jng/tiling/Common/MdfModel/TileSetSource.h
sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp
sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h
sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.cpp
sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.h
sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.cpp
sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.h
sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp
sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.h
sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd
sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd
Modified:
sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp
sandbox/jng/tiling/Common/MdfModel/MapDefinition.cpp
sandbox/jng/tiling/Common/MdfModel/MapDefinition.h
sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj
sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj.filters
sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp
sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.h
sandbox/jng/tiling/Common/MdfParser/IOExtra.cpp
sandbox/jng/tiling/Common/MdfParser/IOExtra.h
sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.cpp
sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.h
sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.cpp
sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.h
sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp
sandbox/jng/tiling/Common/MdfParser/IONameStringPair.h
sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj
sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj.filters
sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp
sandbox/jng/tiling/Common/MdfParser/SAX2Parser.h
sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp
sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h
sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroupType.h
sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.cpp
sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.h
Log:
Add new resource type: TileSetDefinition
A Tile Set Definition is essentially the BaseMapDefinition component of the Map Definition document, separated out to a separate resource, with ability to also specify:
* Tile Image Format
* Tile Width
* Tile Height
The Tile Set Definition schema also supports a FDO-style provider model where a provider can be specified via a provider name and set of name/value parameters.
MgMap is updated to handle TileSetDefinition resources if referenced.
Nothing uses this new resource type yet. That will come in future submissions
Modified: sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MapGuideCommon/MapLayer/Map.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -146,6 +146,7 @@
}
// build the runtime map object from the parsed definition
+ std::auto_ptr<MdfModel::TileSetDefinition> tdef;
std::auto_ptr<MdfModel::MapDefinition> mdef(parser.DetachMapDefinition());
assert(mdef.get() != NULL);
@@ -161,8 +162,39 @@
Ptr<MgCoordinate> coordCenter = gf.CreateCoordinateXY(extent.GetMinX() + (extent.GetMaxX() - extent.GetMinX()) / 2,
extent.GetMinY() + (extent.GetMaxY() - extent.GetMinY()) / 2);
m_center = gf.CreatePoint(coordCenter);
- m_srs = mdef->GetCoordinateSystem();
+ Ptr<MgResourceIdentifier> tileSetDefId;
+ //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
+ 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
+ MdfParser::SAX2Parser parser;
+ parser.ParseString((const char*)tdBytes->Bytes(), tdBytes->GetLength());
+
+ if (!parser.GetSucceeded())
+ {
+ STRING errorMsg = parser.GetErrorMessage();
+ MgStringCollection arguments;
+ arguments.Add(errorMsg);
+ throw new MgInvalidMapDefinitionException(L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
+ }
+
+ tdef.reset(parser.DetachTileSetDefinition());
+ assert(tdef.get() != NULL);
+
+ m_srs = tdef->GetCoordinateSystem();
+ }
+ else
+ {
+ m_srs = mdef->GetCoordinateSystem();
+ }
+
//Calculate the meter per unit for the given coordinate system
m_metersPerUnit = 1.0; // assume a default value
if (m_srs.length() > 0)
@@ -187,8 +219,9 @@
map<STRING, MgLayerGroup*>::const_iterator itKg;
+ //Process dynamic layer groups
MapLayerGroupCollection* groups = mdef->GetLayerGroups();
- if(groups)
+ if (groups)
{
for(int i = 0; i < groups->GetCount(); i++)
{
@@ -227,7 +260,7 @@
}
//resolve group links if required
- if(unresolvedGroupLinks.size() > 0)
+ if (unresolvedGroupLinks.size() > 0)
{
map<MgLayerGroup*, STRING>::const_iterator itUnres;
for(itUnres = unresolvedGroupLinks.begin(); itUnres != unresolvedGroupLinks.end(); ++itUnres)
@@ -255,15 +288,19 @@
//Get all the layers (normal layer or base layer) and get the contents of them in a single request.
Ptr<MgStringCollection> layerIds = new MgStringCollection();
MapLayerCollection* normalLayers = mdef->GetLayers();
- if(normalLayers)
+ if (normalLayers)
{
for(int i = 0; i < normalLayers->GetCount(); i ++)
{
layerIds->Add(normalLayers->GetAt(i)->GetLayerResourceID());
}
}
- BaseMapLayerGroupCollection* baseLayerGroups = mdef->GetBaseMapLayerGroups();
- if(baseLayerGroups)
+ BaseMapLayerGroupCollection* baseLayerGroups = NULL;
+ if (NULL != tdef.get())
+ baseLayerGroups = tdef->GetBaseMapLayerGroups();
+ else
+ baseLayerGroups = mdef->GetBaseMapLayerGroups();
+ if (baseLayerGroups)
{
for(int i = 0; i < baseLayerGroups->GetCount(); i ++)
{
@@ -279,7 +316,7 @@
}
}
std::map<STRING, STRING> layerContentPair;
- if(layerIds->GetCount() != 0)
+ if (layerIds->GetCount() != 0)
{
Ptr<MgStringCollection> layerContents = m_resourceService->GetResourceContents(layerIds, NULL);
for(int i = 0; i < layerIds->GetCount(); i ++)
@@ -291,7 +328,7 @@
//build the runtime layers and attach them to their groups
SCALERANGES scaleRanges;
MapLayerCollection* layers = mdef->GetLayers();
- if(layers)
+ if (layers)
{
for(int i = 0; i < layers->GetCount(); i++, displayOrder += LAYER_ZORDER_INCR)
{
@@ -313,7 +350,7 @@
m_layers->Add(rtLayer);
STRING groupName = layer->GetGroup();
- if(groupName.length())
+ if (groupName.length())
{
//attach the layer to its group
itKg = knownGroups.find(groupName);
@@ -329,8 +366,12 @@
knownGroups.clear();
// BaseMapLayerGroups and BaseMapLayers come at the end
- BaseMapLayerGroupCollection* baseGroups = mdef->GetBaseMapLayerGroups();
- if(baseGroups)
+ BaseMapLayerGroupCollection* baseGroups = NULL;
+ if (NULL != tdef.get())
+ baseGroups = tdef->GetBaseMapLayerGroups();
+ else
+ baseGroups = mdef->GetBaseMapLayerGroups();
+ if (baseGroups)
{
for(int i = 0; i < baseGroups->GetCount(); i++)
{
@@ -338,7 +379,11 @@
//create a runtime group from this group and add it to the group collection
STRING groupName = baseGroup->GetName();
- Ptr<MgLayerGroup> rtGroup = new MgLayerGroup(groupName);
+ Ptr<MgLayerGroup> rtGroup;
+ if (NULL != (MgResourceIdentifier*)tileSetDefId)
+ rtGroup = new MgLayerGroup(groupName, tileSetDefId);
+ else
+ rtGroup = new MgLayerGroup(groupName);
rtGroup->SetVisible(baseGroup->IsVisible());
rtGroup->SetLayerGroupType(MgLayerGroupType::BaseMap);
rtGroup->SetDisplayInLegend(baseGroup->IsShowInLegend());
@@ -402,8 +447,12 @@
// build the sorted list of finite display scales
SORTEDSCALES sortedScales;
- DisplayScaleCollection* displayScales = mdef->GetFiniteDisplayScales();
- if(displayScales)
+ DisplayScaleCollection* displayScales = NULL;
+ if (NULL != tdef.get())
+ displayScales = tdef->GetFiniteDisplayScales();
+ else
+ displayScales = mdef->GetFiniteDisplayScales();
+ if (displayScales)
{
for(int i = 0; i < displayScales->GetCount(); i++)
{
Modified: sandbox/jng/tiling/Common/MdfModel/MapDefinition.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/MapDefinition.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfModel/MapDefinition.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -47,6 +47,7 @@
: m_strName(strName)
, m_strCoordSys(strCoordinateSystem)
, m_boxExtents(0.0, 0.0)
+, m_tileSourceType(Inline)
{
// default values
this->m_strBkGrnd = L"ffffffff"; // NOXLATE
@@ -219,6 +220,21 @@
return &this->m_baseMapLayerGroups;
}
+MapDefinition::TileSourceType MapDefinition::GetTileSourceType() const
+{
+ return this->m_tileSourceType;
+}
+
+void MapDefinition::SetTileSourceType(TileSourceType tileSourceType)
+{
+ this->m_tileSourceType = tileSourceType;
+}
+
+TileSetSource* MapDefinition::GetTileSetSource()
+{
+ return &this->m_tileSetSource;
+}
+
#ifdef _WIN32
#ifdef _DEBUG
int MapDefinition::DumpMemoryLeaks()
Modified: sandbox/jng/tiling/Common/MdfModel/MapDefinition.h
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/MapDefinition.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfModel/MapDefinition.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -25,6 +25,7 @@
#include "MapLayerGroup.h"
#include "BaseMapLayerGroup.h"
#include "WatermarkInstance.h"
+#include "TileSetSource.h"
#include "DisplayScale.h"
BEGIN_NAMESPACE_MDFMODEL
@@ -37,6 +38,13 @@
class MDFMODEL_API MapDefinition : public MdfRootObject
{
public:
+ // Describes the source of the tiled layers
+ enum TileSourceType
+ {
+ Inline,
+ TileSetDefinition
+ };
+
// Construction, destruction, initialization.
MapDefinition(const MdfString& strName, const MdfString& strCoordinateSystem);
virtual ~MapDefinition();
@@ -87,6 +95,15 @@
// The base map groups; used to define tiles for the HTML viewer.
BaseMapLayerGroupCollection* GetBaseMapLayerGroups();
+ // Property : TileSetSource
+ // Gets the reference to the external TileSetDefinition
+ TileSetSource* GetTileSetSource();
+
+ // Property : TileSourceType
+ // Indicates the tile source type (inside the Map Definition or referencing a Tile Set Definition)
+ TileSourceType GetTileSourceType() const;
+ void SetTileSourceType(TileSourceType tileSourceType);
+
//#ifdef _WIN32
#if _DEBUG
// for memory leak testing
@@ -111,6 +128,8 @@
Box2D m_boxExtents;
DisplayScaleCollection m_finiteDisplayScales;
BaseMapLayerGroupCollection m_baseMapLayerGroups;
+ TileSetSource m_tileSetSource;
+ TileSourceType m_tileSourceType;
};
END_NAMESPACE_MDFMODEL
Modified: sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj 2014-05-30 09:44:22 UTC (rev 8176)
@@ -232,6 +232,9 @@
<ClCompile Include="HillShade.cpp" />
<ClCompile Include="FeatureSource.cpp" />
<ClCompile Include="SupplementalSpatialContextInfo.cpp" />
+ <ClCompile Include="TileSetDefinition.cpp" />
+ <ClCompile Include="TileSetSource.cpp" />
+ <ClCompile Include="TileStoreParameters.cpp" />
<ClCompile Include="URLData.cpp" />
<ClCompile Include="VectorLayerDefinition.cpp" />
<ClCompile Include="VectorScaleRange.cpp" />
@@ -347,6 +350,9 @@
<ClInclude Include="HillShade.h" />
<ClInclude Include="FeatureSource.h" />
<ClInclude Include="SupplementalSpatialContextInfo.h" />
+ <ClInclude Include="TileSetDefinition.h" />
+ <ClInclude Include="TileSetSource.h" />
+ <ClInclude Include="TileStoreParameters.h" />
<ClInclude Include="URLData.h" />
<ClInclude Include="VectorLayerDefinition.h" />
<ClInclude Include="VectorScaleRange.h" />
Modified: sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj.filters 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfModel/MdfModel.vcxproj.filters 2014-05-30 09:44:22 UTC (rev 8176)
@@ -40,6 +40,9 @@
<Filter Include="ProfileResult">
<UniqueIdentifier>{117f7c46-7bea-4de3-887b-c162c15359d5}</UniqueIdentifier>
</Filter>
+ <Filter Include="TileSetDefinition">
+ <UniqueIdentifier>{e5dae237-fc68-4fca-b0ff-cf0377111684}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AreaUsage.cpp">
@@ -355,6 +358,15 @@
<ClCompile Include="NameStringPair.cpp" />
<ClCompile Include="UnicodeString.cpp" />
<ClCompile Include="Version.cpp" />
+ <ClCompile Include="TileSetSource.cpp">
+ <Filter>TileSetDefinition</Filter>
+ </ClCompile>
+ <ClCompile Include="TileSetDefinition.cpp">
+ <Filter>TileSetDefinition</Filter>
+ </ClCompile>
+ <ClCompile Include="TileStoreParameters.cpp">
+ <Filter>TileSetDefinition</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AreaUsage.h">
@@ -683,6 +695,15 @@
<ClInclude Include="stdafx.h" />
<ClInclude Include="UnicodeString.h" />
<ClInclude Include="Version.h" />
+ <ClInclude Include="TileSetDefinition.h">
+ <Filter>TileSetDefinition</Filter>
+ </ClInclude>
+ <ClInclude Include="TileSetSource.h">
+ <Filter>TileSetDefinition</Filter>
+ </ClInclude>
+ <ClInclude Include="TileStoreParameters.h">
+ <Filter>TileSetDefinition</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MdfModel.rc" />
Added: sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,76 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#include "stdafx.h"
+#include "TileSetDefinition.h"
+
+// Construction, destruction, initialization.
+TileSetDefinition::TileSetDefinition(const MdfString& strCoordinateSystem)
+ : m_strCoordSys(strCoordinateSystem),
+ m_boxExtents(0.0, 0.0)
+{
+
+}
+
+TileSetDefinition::~TileSetDefinition()
+{
+
+}
+
+// Property: TileStoreParameters
+// Defines the parameters to access the tile cache
+TileStoreParameters* TileSetDefinition::GetTileStoreParameters()
+{
+ return &this->m_parameters;
+}
+
+// Property : CoordinateSystem
+// The WKT string that represents the coordinate system for the MapDefinition.
+const MdfString& TileSetDefinition::GetCoordinateSystem() const
+{
+ return this->m_strCoordSys;
+}
+
+void TileSetDefinition::SetCoordinateSystem(const MdfString& strCoordinateSystem)
+{
+ this->m_strCoordSys = strCoordinateSystem;
+}
+
+// Property : Extents
+// The extents to be used by the MapDefinition
+const Box2D& TileSetDefinition::GetExtents() const
+{
+ return this->m_boxExtents;
+}
+
+void TileSetDefinition::SetExtents(const Box2D& boxExtents)
+{
+ this->m_boxExtents = boxExtents;
+}
+
+// Property : FiniteDisplayScales
+// The scales that the base map tiles can be displayed at
+DisplayScaleCollection* TileSetDefinition::GetFiniteDisplayScales()
+{
+ return &this->m_finiteDisplayScales;
+}
+
+// Property : BaseMapLayerGroups
+// The base map groups; used to define tiles for the HTML viewer.
+BaseMapLayerGroupCollection* TileSetDefinition::GetBaseMapLayerGroups()
+{
+ return &this->m_baseMapLayerGroups;
+}
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.h
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileSetDefinition.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,74 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#ifndef TILESETDEFINITION_H_
+#define TILESETDEFINITION_H_
+
+#include "MdfModel.h"
+#include "MdfRootObject.h"
+#include "Box2D.h"
+#include "DisplayScale.h"
+#include "BaseMapLayerGroup.h"
+#include "TileStoreParameters.h"
+
+BEGIN_NAMESPACE_MDFMODEL
+
+ class MDFMODEL_API TileSetDefinition : public MdfRootObject
+ {
+ public:
+ // Construction, destruction, initialization.
+ TileSetDefinition(const MdfString& strCoordinateSystem);
+ virtual ~TileSetDefinition();
+
+ // Property: TileStoreParameters
+ // Defines the parameters to access the tile cache
+ TileStoreParameters* GetTileStoreParameters();
+
+ // Property : CoordinateSystem
+ // The WKT string that represents the coordinate system for the MapDefinition.
+ const MdfString& GetCoordinateSystem() const;
+ void SetCoordinateSystem(const MdfString& strCoordinateSystem);
+
+ // Property : Extents
+ // The extents to be used by the MapDefinition
+ const Box2D& GetExtents() const;
+ void SetExtents(const Box2D& boxExtents);
+
+ // Property : FiniteDisplayScales
+ // The scales that the base map tiles can be displayed at
+ DisplayScaleCollection* GetFiniteDisplayScales();
+
+ // Property : BaseMapLayerGroups
+ // The base map groups; used to define tiles for the HTML viewer.
+ BaseMapLayerGroupCollection* GetBaseMapLayerGroups();
+
+ private:
+ // Hidden MapDefinition copy constructor and assignment operator.
+ TileSetDefinition(const TileSetDefinition&);
+ TileSetDefinition& operator=(const TileSetDefinition&);
+
+ // Data members
+ // See corresponding properties for descriptions
+ TileStoreParameters m_parameters;
+ MdfString m_strCoordSys;
+ Box2D m_boxExtents;
+ DisplayScaleCollection m_finiteDisplayScales;
+ BaseMapLayerGroupCollection m_baseMapLayerGroups;
+ };
+
+END_NAMESPACE_MDFMODEL
+
+#endif //TILESETDEFINITION_H_
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfModel/TileSetSource.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileSetSource.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileSetSource.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,39 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#include "stdafx.h"
+#include "TileSetSource.h"
+
+TileSetSource::TileSetSource()
+{
+
+}
+
+TileSetSource::~TileSetSource()
+{
+
+}
+
+// Property : ResourceId
+const MdfString& TileSetSource::GetResourceId() const
+{
+ return this->m_resourceId;
+}
+
+void TileSetSource::SetResourceId(const MdfString& strResourceId)
+{
+ this->m_resourceId = strResourceId;
+}
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfModel/TileSetSource.h
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileSetSource.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileSetSource.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#ifndef TILESETSOURCE_H_
+#define TILESETSOURCE_H_
+
+#include "MdfModel.h"
+#include "MdfRootObject.h"
+
+BEGIN_NAMESPACE_MDFMODEL
+
+ class MDFMODEL_API TileSetSource : public MdfRootObject
+ {
+ public:
+ TileSetSource();
+ virtual ~TileSetSource();
+
+ // Property : ResourceId
+ const MdfString& GetResourceId() const;
+ void SetResourceId(const MdfString& strResourceId);
+
+ private:
+ // Hidden copy constructor and assignment operator.
+ TileSetSource(const TileSetSource&);
+ TileSetSource& operator=(const TileSetSource&);
+
+ MdfString m_resourceId;
+ };
+
+END_NAMESPACE_MDFMODEL
+
+#endif //TILESETSOURCE_H_
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,82 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#include "stdafx.h"
+#include "TileStoreParameters.h"
+
+TileStoreParameters::TileStoreParameters()
+ : m_imageFormat(L"PNG"),
+ m_width(300),
+ m_height(300)
+{
+
+}
+
+TileStoreParameters::~TileStoreParameters()
+{
+
+}
+
+// Operations
+// Property : Parameters
+NameStringPairCollection* TileStoreParameters::GetParameters()
+{
+ return &this->m_parameters;
+}
+
+// Property : TileProvider
+const MdfString& TileStoreParameters::GetTileProvider() const
+{
+ return this->m_provider;
+}
+
+void TileStoreParameters::SetTileProvider(const MdfString &provider)
+{
+ this->m_provider = provider;
+}
+
+// Property : TileWidth
+int TileStoreParameters::GetTileWidth() const
+{
+ return this->m_width;
+}
+
+void TileStoreParameters::SetTileWidth(const int &width)
+{
+ this->m_width = width;
+}
+
+// Property : TileHeight
+int TileStoreParameters::GetTileHeight() const
+{
+ return this->m_height;
+}
+
+void TileStoreParameters::SetTileHeight(const int &height)
+{
+ this->m_height = height;
+}
+
+// Property : ImageFormat
+const MdfString& TileStoreParameters::GetImageFormat() const
+{
+ return this->m_imageFormat;
+}
+
+void TileStoreParameters::SetImageFormat(const MdfString &imageFormat)
+{
+ this->m_imageFormat = imageFormat;
+}
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,67 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#ifndef TILESTOREPARAMETERS_H_
+#define TILESTOREPARAMETERS_H_
+
+#include "MdfModel.h"
+#include "NameStringPair.h"
+#include "MdfRootObject.h"
+
+BEGIN_NAMESPACE_MDFMODEL
+
+ class MDFMODEL_API TileStoreParameters : public MdfRootObject
+ {
+ public:
+ TileStoreParameters();
+ virtual ~TileStoreParameters();
+
+ // Operations
+ // Property : Parameters
+ NameStringPairCollection* GetParameters();
+
+ // Property : TileProvider
+ const MdfString& GetTileProvider() const;
+ void SetTileProvider(const MdfString &provider);
+
+ // Property : TileWidth
+ int GetTileWidth() const;
+ void SetTileWidth(const int &width);
+
+ // Property : TileHeight
+ int GetTileHeight() const;
+ void SetTileHeight(const int &height);
+
+ // Property : ImageFormat
+ const MdfString& GetImageFormat() const;
+ void SetImageFormat(const MdfString &imageFormat);
+
+ private:
+
+ // Hidden copy constructor and assignment operator.
+ TileStoreParameters(const TileStoreParameters&);
+ TileStoreParameters& operator=(const TileStoreParameters&);
+
+ int m_width;
+ int m_height;
+ MdfString m_provider;
+ MdfString m_imageFormat;
+ NameStringPairCollection m_parameters;
+ };
+
+END_NAMESPACE_MDFMODEL
+
+#endif //TILESTOREPARAMETERS_H_
\ No newline at end of file
Modified: sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -44,7 +44,11 @@
{
}
+IOBaseMapLayerGroup::IOBaseMapLayerGroup(TileSetDefinition* tileset, Version& version) : IOMapLayerGroupCommon(tileset, version)
+{
+}
+
IOBaseMapLayerGroup::~IOBaseMapLayerGroup()
{
}
Modified: sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -21,6 +21,7 @@
#include "SAX2ElementHandler.h"
#include "BaseMapLayerGroup.h"
#include "MapDefinition.h"
+#include "TileSetDefinition.h"
#include "IOMapLayerGroupCommon.h"
#include "Version.h"
@@ -34,6 +35,7 @@
public:
IOBaseMapLayerGroup(Version& version);
IOBaseMapLayerGroup(MapDefinition* map, Version& version);
+ IOBaseMapLayerGroup(TileSetDefinition* tileset, Version& version);
virtual ~IOBaseMapLayerGroup();
virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
Modified: sandbox/jng/tiling/Common/MdfParser/IOExtra.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOExtra.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOExtra.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -38,6 +38,7 @@
this->m_minY = +DBL_MAX;
this->m_maxY = -DBL_MAX;
this->m_map = NULL;
+ this->m_tileset = NULL;
}
@@ -48,9 +49,20 @@
this->m_minY = +DBL_MAX;
this->m_maxY = -DBL_MAX;
this->m_map = map;
+ this->m_tileset = NULL;
}
+IOExtra::IOExtra(TileSetDefinition* tileset, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_minX = +DBL_MAX;
+ this->m_maxX = -DBL_MAX;
+ this->m_minY = +DBL_MAX;
+ this->m_maxY = -DBL_MAX;
+ this->m_map = NULL;
+ this->m_tileset = tileset;
+}
+
IOExtra::~IOExtra()
{
}
@@ -97,8 +109,16 @@
{
if (this->m_startElemName == name)
{
- this->m_map->SetExtents(Box2D(this->m_minX, this->m_minY, this->m_maxX, this->m_maxY));
- this->m_map = NULL;
+ if (NULL != this->m_map)
+ {
+ this->m_map->SetExtents(Box2D(this->m_minX, this->m_minY, this->m_maxX, this->m_maxY));
+ this->m_map = NULL;
+ }
+ else if (NULL != this->m_tileset)
+ {
+ this->m_tileset->SetExtents(Box2D(this->m_minX, this->m_minY, this->m_maxX, this->m_maxY));
+ this->m_tileset;
+ }
this->m_startElemName = L"";
handlerStack->pop();
delete this;
Modified: sandbox/jng/tiling/Common/MdfParser/IOExtra.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOExtra.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOExtra.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -21,6 +21,7 @@
#include "SAX2ElementHandler.h"
#include "Box2D.h"
#include "MapDefinition.h"
+#include "TileSetDefinition.h"
#include "Version.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -33,6 +34,7 @@
public:
IOExtra(Version& version);
IOExtra(MapDefinition* map, Version& version);
+ IOExtra(TileSetDefinition* map, Version& version);
virtual ~IOExtra();
virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
@@ -47,6 +49,7 @@
double m_minY;
double m_maxY;
MapDefinition* m_map;
+ TileSetDefinition* m_tileset;
};
END_NAMESPACE_MDFPARSER
Modified: sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -23,6 +23,7 @@
#include "IOMapLayerGroup.h"
#include "IOWatermarkInstance.h"
#include "IOBaseMapDefinition.h"
+#include "IOTileSetSource.h"
#include "IOUnknown.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -39,17 +40,18 @@
ELEM_MAP_ENTRY(7, MapLayer);
ELEM_MAP_ENTRY(8, MapLayerGroup);
ELEM_MAP_ENTRY(9, BaseMapDefinition);
-ELEM_MAP_ENTRY(10, Watermarks);
-ELEM_MAP_ENTRY(11, Watermark);
-ELEM_MAP_ENTRY(12, ExtendedData1);
+ELEM_MAP_ENTRY(10, TileSetSource);
+ELEM_MAP_ENTRY(11, Watermarks);
+ELEM_MAP_ENTRY(12, Watermark);
+ELEM_MAP_ENTRY(13, ExtendedData1);
-IOMapDefinition::IOMapDefinition(Version& version) : SAX2ElementHandler(version)
+IOMapDefinition::IOMapDefinition(Version& version) : SAX2ElementHandler(version), m_bReadBaseMapDef(false)
{
this->m_map = NULL;
}
-IOMapDefinition::IOMapDefinition(MapDefinition* map, Version& version) : SAX2ElementHandler(version)
+IOMapDefinition::IOMapDefinition(MapDefinition* map, Version& version) : SAX2ElementHandler(version), m_bReadBaseMapDef(false)
{
this->m_map = map;
}
@@ -100,9 +102,23 @@
IOBaseMapDefinition* IO = new IOBaseMapDefinition(this->m_map, this->m_version);
handlerStack->push(IO);
IO->StartElement(name, handlerStack);
+ this->m_map->SetTileSourceType(MapDefinition::Inline);
+ m_bReadBaseMapDef = true;
}
break;
+ case eTileSetSource:
+ {
+ if (!m_bReadBaseMapDef) //Only read this element if no BaseMapDefinition element was read
+ {
+ IOTileSetSource* IO = new IOTileSetSource(this->m_map->GetTileSetSource(), this->m_version);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ this->m_map->SetTileSourceType(MapDefinition::TileSetDefinition);
+ }
+ }
+ break;
+
case eWatermark:
{
Version wdVersion;
@@ -170,7 +186,7 @@
// Determine which WatermarkDefinition schema version to use based
// on the supplied MapDefinition version:
-// * MDF version == 2.4.0 => WD version 2.4.0
+// * MDF version >= 2.4.0 => WD version 2.4.0
// * MDF version <= 2.3.0 => WD version 2.3.0
bool IOMapDefinition::GetWatermarkDefinitionVersion(Version* mdfVersion, Version& wdVersion)
{
@@ -189,7 +205,7 @@
MdfString strVersion;
if (version)
{
- if ((*version >= Version(1, 0, 0)) && (*version <= Version(2, 4, 0)))
+ if ((*version >= Version(1, 0, 0)) && (*version <= Version(3, 0, 0)))
{
// MDF in MapGuide 2006 - current
strVersion = version->ToString();
@@ -205,7 +221,7 @@
else
{
// use the current highest version
- strVersion = L"2.4.0";
+ strVersion = L"3.0.0";
}
if (!version || (*version > Version(1, 0, 0)))
@@ -248,9 +264,17 @@
for (int i=0; i<map->GetLayerGroups()->GetCount(); ++i)
IOMapLayerGroup::Write(fd, map->GetLayerGroups()->GetAt(i), version, tab);
- // Property: BaseMapDefinition
- if (map->GetFiniteDisplayScales()->GetCount() > 0)
- IOBaseMapDefinition::Write(fd, map, version, tab);
+ if (map->GetTileSourceType() == MapDefinition::Inline)
+ {
+ // Property: BaseMapDefinition
+ if (map->GetFiniteDisplayScales()->GetCount() > 0)
+ IOBaseMapDefinition::Write(fd, map, version, tab);
+ }
+ else
+ {
+ // Property: TileSetSource
+ IOTileSetSource::Write(fd, map->GetTileSetSource(), version, tab);
+ }
// Property: Watermarks (optional)
int watermarkCount = map->GetWatermarks()->GetCount();
Modified: sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOMapDefinition.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -43,6 +43,7 @@
private:
static bool GetWatermarkDefinitionVersion(Version* mdfVersion, Version& wdVersion);
MapDefinition* m_map;
+ bool m_bReadBaseMapDef;
};
END_NAMESPACE_MDFPARSER
Modified: sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -27,6 +27,7 @@
{
this->m_layerGroup = NULL;
this->m_map = NULL;
+ this->m_tileset = NULL;
}
@@ -34,9 +35,18 @@
{
this->m_layerGroup = NULL;
this->m_map = map;
+ this->m_tileset = NULL;
}
+IOMapLayerGroupCommon::IOMapLayerGroupCommon(TileSetDefinition* tileset, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_layerGroup = NULL;
+ this->m_map = NULL;
+ this->m_tileset = tileset;
+}
+
+
IOMapLayerGroupCommon::~IOMapLayerGroupCommon()
{
}
Modified: sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IOMapLayerGroupCommon.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -21,6 +21,7 @@
#include "SAX2ElementHandler.h"
#include "MapLayerGroupCommon.h"
#include "MapDefinition.h"
+#include "TileSetDefinition.h"
#include "Version.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -35,6 +36,7 @@
public:
IOMapLayerGroupCommon(MapDefinition* map, Version& version);
+ IOMapLayerGroupCommon(TileSetDefinition* tileset, Version& version);
virtual ~IOMapLayerGroupCommon();
virtual void ElementChars(const wchar_t* ch);
@@ -44,6 +46,7 @@
protected:
MapLayerGroupCommon* m_layerGroup;
MapDefinition* m_map;
+ TileSetDefinition* m_tileset;
};
END_NAMESPACE_MDFPARSER
Modified: sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -35,6 +35,7 @@
this->m_nameStringPair = NULL;
this->m_layer = NULL;
this->m_overrides = NULL;
+ this->m_tileStoreParams = NULL;
}
@@ -44,6 +45,7 @@
this->m_nameStringPair = NULL;
this->m_layer = layer;
this->m_overrides = NULL;
+ this->m_tileStoreParams = NULL;
}
@@ -53,9 +55,19 @@
this->m_nameStringPair = NULL;
this->m_layer = NULL;
this->m_overrides = NULL;
+ this->m_tileStoreParams = NULL;
}
+IONameStringPair::IONameStringPair(TileStoreParameters* params, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_featureSource = NULL;
+ this->m_nameStringPair = NULL;
+ this->m_layer = NULL;
+ this->m_overrides = NULL;
+ this->m_tileStoreParams = params;
+}
+
IONameStringPair::~IONameStringPair()
{
}
@@ -130,6 +142,7 @@
this->m_layer = NULL;
this->m_featureSource = NULL;
this->m_nameStringPair = NULL;
+ this->m_tileStoreParams = NULL;
this->m_startElemName = L"";
handlerStack->pop();
delete this;
Modified: sandbox/jng/tiling/Common/MdfParser/IONameStringPair.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IONameStringPair.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/IONameStringPair.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -22,6 +22,7 @@
#include "NameStringPair.h"
#include "VectorLayerDefinition.h"
#include "FeatureSource.h"
+#include "TileStoreParameters.h"
#include "Version.h"
using namespace XERCES_CPP_NAMESPACE;
@@ -35,6 +36,7 @@
IONameStringPair(Version& version);
IONameStringPair(VectorLayerDefinition* layer, Version& version);
IONameStringPair(FeatureSource* featureSource, Version& version);
+ IONameStringPair(TileStoreParameters* params, Version& version);
virtual ~IONameStringPair();
virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
@@ -47,6 +49,7 @@
NameStringPair* m_nameStringPair;
VectorLayerDefinition* m_layer;
FeatureSource* m_featureSource;
+ TileStoreParameters* m_tileStoreParams;
NameStringPairCollection* m_overrides;
};
Added: sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,183 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#include "stdafx.h"
+#include "IOTileSetDefinition.h"
+#include "IOExtra.h"
+#include "IOTileStoreParameters.h"
+#include "IOBaseMapLayerGroup.h"
+#include "IOUnknown.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+CREATE_ELEMENT_MAP;
+ELEM_MAP_ENTRY(1, TileSetDefinition);
+ELEM_MAP_ENTRY(2, TileStoreParameters);
+ELEM_MAP_ENTRY(3, CoordinateSystem);
+ELEM_MAP_ENTRY(4, Extents);
+ELEM_MAP_ENTRY(5, FiniteDisplayScale);
+ELEM_MAP_ENTRY(6, BaseMapLayerGroup);
+ELEM_MAP_ENTRY(7, ExtendedData1);
+
+IOTileSetDefinition::IOTileSetDefinition(Version& version) : SAX2ElementHandler(version)
+{
+ this->m_tileset = NULL;
+}
+
+
+IOTileSetDefinition::IOTileSetDefinition(TileSetDefinition* tileset, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_tileset = tileset;
+}
+
+
+IOTileSetDefinition::~IOTileSetDefinition()
+{
+}
+
+
+void IOTileSetDefinition::StartElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ this->m_currElemName = name;
+ this->m_currElemId = _ElementIdFromName(name);
+
+ switch (this->m_currElemId)
+ {
+ case eTileSetDefinition:
+ this->m_startElemName = name;
+ break;
+
+ case eTileStoreParameters:
+ {
+ IOTileStoreParameters* IO = new IOTileStoreParameters(this->m_tileset->GetTileStoreParameters(), this->m_version);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eExtents:
+ {
+ IOExtra* IO = new IOExtra(this->m_tileset, this->m_version);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eBaseMapLayerGroup:
+ {
+ IOBaseMapLayerGroup* IO = new IOBaseMapLayerGroup(this->m_tileset, this->m_version);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ break;
+
+ case eExtendedData1:
+ this->m_procExtData = true;
+ break;
+
+ case eUnknown:
+ ParseUnknownXml(name, handlerStack);
+ break;
+ }
+}
+
+
+void IOTileSetDefinition::ElementChars(const wchar_t* ch)
+{
+ switch (this->m_currElemId)
+ {
+ case eCoordinateSystem:
+ this->m_tileset->SetCoordinateSystem(ch);
+ break;
+
+ case eFiniteDisplayScale:
+ double val = wstrToDouble(ch);
+ this->m_tileset->GetFiniteDisplayScales()->Adopt(new DisplayScale(val));
+ break;
+ }
+}
+
+
+void IOTileSetDefinition::EndElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ if (this->m_startElemName == name)
+ {
+ this->m_tileset = NULL;
+ this->m_startElemName = L"";
+ handlerStack->pop();
+ delete this;
+ }
+}
+
+
+void IOTileSetDefinition::Write(MdfStream& fd, TileSetDefinition* tileset, Version* version, MgTab& tab)
+{
+ // verify the MDF version
+ MdfString strVersion;
+ if (version)
+ {
+ if (*version == Version(3, 0, 0))
+ {
+ strVersion = version->ToString();
+ }
+ else
+ {
+ // unsupported MDF version
+ // TODO - need a way to return error information
+ _ASSERT(false);
+ return;
+ }
+ }
+ else
+ {
+ // use the current highest version
+ strVersion = L"3.0.0";
+ }
+
+ fd << tab.tab() << "<TileSetDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"TileSetDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+ tab.inctab();
+
+ // Property: TileStoreParameters
+ IOTileStoreParameters::Write(fd, tileset->GetTileStoreParameters(), version, tab);
+
+ // Property: CoordinateSystem
+ fd << tab.tab() << startStr(sCoordinateSystem);
+ fd << EncodeString(tileset->GetCoordinateSystem());
+ fd << endStr(sCoordinateSystem) << std::endl;
+
+ // Property: Extents
+ IOExtra::WriteBox2D(fd, tileset->GetExtents(), false, version, tab);
+
+ // Property: FiniteDisplayScales
+ DisplayScaleCollection* finiteDisplayScales = tileset->GetFiniteDisplayScales();
+ for (int i=0; i<finiteDisplayScales->GetCount(); ++i)
+ {
+ fd << tab.tab() << "<FiniteDisplayScale>"; // NOXLATE
+ fd << DoubleToStr((static_cast<DisplayScale*>(finiteDisplayScales->GetAt(i)))->GetValue());
+ fd << "</FiniteDisplayScale>" << std::endl; // NOXLATE
+ }
+
+ // Property: BaseMapLayerGroups
+ BaseMapLayerGroupCollection* baseMapGroups = tileset->GetBaseMapLayerGroups();
+ for (int i=0; i<baseMapGroups->GetCount(); ++i)
+ IOBaseMapLayerGroup::Write(fd, static_cast<BaseMapLayerGroup*>(baseMapGroups->GetAt(i)), version, tab);
+
+ tab.dectab();
+ fd << tab.tab() << "</TileSetDefinition>" << std::endl; // NOXLATE
+}
Added: sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileSetDefinition.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef _IOTILESETDEFINITION_H
+#define _IOTILESETDEFINITION_H
+
+#include "SAX2ElementHandler.h"
+#include "Version.h"
+#include "TileSetDefinition.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+
+BEGIN_NAMESPACE_MDFPARSER
+
+ class IOTileSetDefinition : public SAX2ElementHandler
+ {
+ private:
+ IOTileSetDefinition(Version& version);
+
+ public:
+ IOTileSetDefinition(TileSetDefinition* tileset, Version& version);
+ virtual ~IOTileSetDefinition();
+
+ virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
+ virtual void ElementChars(const wchar_t* ch);
+ virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
+
+ static void Write(MdfStream& fd, TileSetDefinition* tileset, Version* version, MgTab& tab);
+
+ private:
+ TileSetDefinition* m_tileset;
+ };
+
+END_NAMESPACE_MDFPARSER
+
+#endif //_IOTILESETDEFINITION_H
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,79 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#include "stdafx.h"
+#include "IOTileSetSource.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+IOTileSetSource::IOTileSetSource(Version& version) : SAX2ElementHandler(version)
+{
+ this->m_source = NULL;
+}
+
+IOTileSetSource::IOTileSetSource(TileSetSource* source, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_source = source;
+}
+
+IOTileSetSource::~IOTileSetSource()
+{
+
+}
+
+void IOTileSetSource::StartElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ this->m_currElemName = name;
+ if (this->m_currElemName == L"TileSetSource") // NOXLATE
+ {
+ this->m_startElemName = name;
+ }
+}
+
+void IOTileSetSource::ElementChars(const wchar_t* ch)
+{
+ if (this->m_currElemName == L"ResourceId") // NOXLATE
+ {
+ this->m_source->SetResourceId(ch);
+ }
+}
+
+void IOTileSetSource::EndElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ if (this->m_startElemName == name)
+ {
+ this->m_source = NULL;
+ this->m_startElemName = L"";
+ handlerStack->pop();
+ delete this;
+ }
+}
+
+void IOTileSetSource::Write(MdfStream& fd, TileSetSource* source, Version* version, MgTab& tab)
+{
+ fd << tab.tab() << "<TileSetSource>" << std::endl; // NOXLATE
+ tab.inctab();
+
+ fd << tab.tab() << startStr("ResourceId"); //NOXLATE
+ fd << EncodeString(source->GetResourceId());
+ fd << endStr("ResourceId") << std::endl; //NOXLATE
+
+ tab.dectab();
+ fd << tab.tab() << "</TileSetSource>" << std::endl; // NOXLATE
+}
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileSetSource.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef _IOTILESETSOURCE_H
+#define _IOTILESETSOURCE_H
+
+#include "SAX2ElementHandler.h"
+#include "Version.h"
+#include "TileSetSource.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+
+BEGIN_NAMESPACE_MDFPARSER
+
+ class IOTileSetSource : public SAX2ElementHandler
+ {
+ private:
+ IOTileSetSource(Version& version);
+
+ public:
+ IOTileSetSource(TileSetSource* source, Version& version);
+ virtual ~IOTileSetSource();
+
+ virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
+ virtual void ElementChars(const wchar_t* ch);
+ virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
+
+ static void Write(MdfStream& fd, TileSetSource* source, Version* version, MgTab& tab);
+
+ private:
+ TileSetSource* m_source;
+ };
+
+END_NAMESPACE_MDFPARSER
+
+#endif //_IOTILESETSOURCE_H
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,123 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#include "stdafx.h"
+#include "IOTileStoreParameters.h"
+#include "IONameStringPair.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+using namespace MDFPARSER_NAMESPACE;
+
+IOTileStoreParameters::IOTileStoreParameters(Version& version) : SAX2ElementHandler(version)
+{
+ this->m_params = NULL;
+}
+
+IOTileStoreParameters::IOTileStoreParameters(TileStoreParameters* params, Version& version) : SAX2ElementHandler(version)
+{
+ this->m_params = params;
+}
+
+IOTileStoreParameters::~IOTileStoreParameters()
+{
+
+}
+
+void IOTileStoreParameters::StartElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ this->m_currElemName = name;
+ if (this->m_currElemName == L"TileStoreParameters") // NOXLATE
+ {
+ this->m_startElemName = name;
+ }
+ else
+ {
+ if (this->m_currElemName == L"Parameter")
+ {
+ IONameStringPair* IO = new IONameStringPair(this->m_params, this->m_version);
+ handlerStack->push(IO);
+ IO->StartElement(name, handlerStack);
+ }
+ }
+}
+
+void IOTileStoreParameters::ElementChars(const wchar_t* ch)
+{
+ if (this->m_currElemName == L"TileProvider") // NOXLATE
+ {
+ this->m_params->SetTileProvider(ch);
+ }
+ else if (this->m_currElemName == L"TileWidth") // NOXLATE
+ {
+ int val = wstrToInt(ch);
+ this->m_params->SetTileWidth(val);
+ }
+ else if (this->m_currElemName == L"TileHeight") // NOXLATE
+ {
+ int val = wstrToInt(ch);
+ this->m_params->SetTileHeight(val);
+ }
+ else if (this->m_currElemName == L"ImageFormat") // NOXLATE
+ {
+ this->m_params->SetImageFormat(ch);
+ }
+}
+
+void IOTileStoreParameters::EndElement(const wchar_t* name, HandlerStack* handlerStack)
+{
+ if (this->m_startElemName == name)
+ {
+ this->m_params = NULL;
+ this->m_startElemName = L"";
+ handlerStack->pop();
+ delete this;
+ }
+}
+
+void IOTileStoreParameters::Write(MdfStream& fd, TileStoreParameters* params, Version* version, MgTab& tab)
+{
+ fd << tab.tab() << "<TileStoreParameters>" << std::endl; // NOXLATE
+ tab.inctab();
+
+ // Property: TileProvider
+ fd << tab.tab() << startStr("TileProvider"); //NOXLATE
+ fd << EncodeString(params->GetTileProvider());
+ fd << endStr("TileProvider") << std::endl; //NOXLATE
+
+ // Property: TileWidth
+ fd << tab.tab() << startStr("TileWidth"); //NOXLATE
+ fd << IntToStr(params->GetTileWidth());
+ fd << endStr("TileWidth") << std::endl; //NOXLATE
+
+ // Property: TileHeight
+ fd << tab.tab() << startStr("TileHeight"); //NOXLATE
+ fd << IntToStr(params->GetTileHeight());
+ fd << endStr("TileHeight") << std::endl; //NOXLATE
+
+ // Property: ImageFormat
+ fd << tab.tab() << startStr("ImageFormat"); //NOXLATE
+ fd << EncodeString(params->GetTileProvider());
+ fd << endStr("ImageFormat") << std::endl; //NOXLATE
+
+ // Property: Parameters
+ for (int i=0; i<params->GetParameters()->GetCount(); ++i)
+ IONameStringPair::Write(fd, "Parameter", params->GetParameters()->GetAt(i), version, tab); //NOXLATE
+
+ tab.dectab();
+ fd << tab.tab() << "</TileStoreParameters>" << std::endl; // NOXLATE
+}
\ No newline at end of file
Added: sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.h (rev 0)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef _IOTILESTOREPARAMETERS_H
+#define _IOTILESTOREPARAMETERS_H
+
+#include "SAX2ElementHandler.h"
+#include "Version.h"
+#include "TileStoreParameters.h"
+
+using namespace XERCES_CPP_NAMESPACE;
+using namespace MDFMODEL_NAMESPACE;
+
+BEGIN_NAMESPACE_MDFPARSER
+
+ class IOTileStoreParameters : public SAX2ElementHandler
+ {
+ private:
+ IOTileStoreParameters(Version& version);
+
+ public:
+ IOTileStoreParameters(TileStoreParameters* params, Version& version);
+ virtual ~IOTileStoreParameters();
+
+ virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
+ virtual void ElementChars(const wchar_t* ch);
+ virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
+
+ static void Write(MdfStream& fd, TileStoreParameters* params, Version* version, MgTab& tab);
+
+ private:
+ TileStoreParameters* m_params;
+ };
+
+END_NAMESPACE_MDFPARSER
+
+#endif //_IOTILESTOREPARAMETERS_H
\ No newline at end of file
Modified: sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj 2014-05-30 09:44:22 UTC (rev 8176)
@@ -201,6 +201,9 @@
<ClCompile Include="Common\IOSize2D.cpp" />
<ClCompile Include="Common\IOStringObjectCollection.cpp" />
<ClCompile Include="Common\IOVector3D.cpp" />
+ <ClCompile Include="IOTileSetDefinition.cpp" />
+ <ClCompile Include="IOTileSetSource.cpp" />
+ <ClCompile Include="IOTileStoreParameters.cpp" />
<ClCompile Include="IOURLData.cpp" />
<ClCompile Include="IOProfileRenderLabelsResult.cpp" />
<ClCompile Include="IOProfileRenderLayerResult.cpp" />
@@ -313,6 +316,9 @@
<ClInclude Include="Common\IOSize2D.h" />
<ClInclude Include="Common\IOStringObjectCollection.h" />
<ClInclude Include="Common\IOVector3D.h" />
+ <ClInclude Include="IOTileSetDefinition.h" />
+ <ClInclude Include="IOTileSetSource.h" />
+ <ClInclude Include="IOTileStoreParameters.h" />
<ClInclude Include="IOURLData.h" />
<ClInclude Include="IOProfileRenderLabelsResult.h" />
<ClInclude Include="IOProfileRenderLayerResult.h" />
Modified: sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj.filters 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/MdfParser.vcxproj.filters 2014-05-30 09:44:22 UTC (rev 8176)
@@ -172,6 +172,9 @@
<ClCompile Include="MdfParser.cpp" />
<ClCompile Include="SAX2ElementHandler.cpp" />
<ClCompile Include="SAX2Parser.cpp" />
+ <ClCompile Include="IOTileSetDefinition.cpp" />
+ <ClCompile Include="IOTileSetSource.cpp" />
+ <ClCompile Include="IOTileStoreParameters.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Common\IOColor.h">
@@ -334,6 +337,9 @@
<ClInclude Include="SAX2ElementHandler.h" />
<ClInclude Include="SAX2Parser.h" />
<ClInclude Include="stdafx.h" />
+ <ClInclude Include="IOTileSetDefinition.h" />
+ <ClInclude Include="IOTileSetSource.h" />
+ <ClInclude Include="IOTileStoreParameters.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MdfParser.rc" />
Modified: sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -23,6 +23,7 @@
#include "IOGridLayerDefinition.h"
#include "IOSimpleSymbolDefinition.h"
#include "IOCompoundSymbolDefinition.h"
+#include "IOTileSetDefinition.h"
#include "UnicodeString.h"
#include "PrintLayout/IOPrintLayoutDefinition.h"
#include "PrintLayout/IOPrintLayoutElementDefinition.h"
@@ -266,7 +267,14 @@
return ret;
}
+TileSetDefinition* SAX2Parser::DetachTileSetDefinition()
+{
+ TileSetDefinition* ret = m_tileset;
+ m_tileset = NULL;
+ return ret;
+}
+
bool SAX2Parser::GetSucceeded() const
{
return m_succeeded;
@@ -547,7 +555,17 @@
return fd.str();
}
+std::string SAX2Parser::SerializeToXML(TileSetDefinition* tileset, MdfModel::Version* version)
+{
+ MdfStringStream fd;
+ MgTab tab;
+ if (NULL != tileset)
+ IOTileSetDefinition::Write(fd, tileset, version, tab);
+
+ return fd.str();
+}
+
void SAX2Parser::startElement(const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
@@ -889,7 +907,32 @@
}
}
+void SAX2Parser::SetTileSetDefinitionVersion(const Attributes& attributes)
+{
+ // Although right now we only have 3.0.0 here, this function is still
+ // needed for future expansion.
+ // check for a version attribute
+ int index = attributes.getIndex(W2X(L"version"));
+ const XMLCh* verValue = (index >= 0)? attributes.getValue(index) : NULL;
+
+ // according to the schema profile result elements require a version
+ // attribute, but users may generate XML which is missing this attribute
+ if (verValue)
+ {
+ std::wstring version = X2W(verValue);
+
+ if (_wcsicmp(version.c_str(), L"3.0.0") == 0)
+ m_version = MdfModel::Version(3, 0, 0);
+ }
+ else
+ {
+ // assume the latest version if the attribute is missing
+ m_version = MdfModel::Version(3, 0, 0);
+ }
+}
+
+
MapDefinition* SAX2Parser::CreateClone(MapDefinition* map)
{
_ASSERT(NULL != map);
@@ -993,3 +1036,18 @@
return parser.DetachProfileResult();
}
+
+
+TileSetDefinition* SAX2Parser::CreateClone(TileSetDefinition* tileset)
+{
+ _ASSERT(NULL != tileset);
+ if (NULL == tileset)
+ return NULL;
+
+ SAX2Parser parser;
+ std::string xmlOfTD("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); // NOXLATE
+ xmlOfTD.append(parser.SerializeToXML(tileset, NULL));
+ parser.ParseString(xmlOfTD.c_str(), xmlOfTD.size());
+
+ return parser.DetachTileSetDefinition();
+}
Modified: sandbox/jng/tiling/Common/MdfParser/SAX2Parser.h
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/SAX2Parser.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/MdfParser/SAX2Parser.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -19,6 +19,7 @@
#define _SAX2PARSER_H
#include "MapDefinition.h"
+#include "TileSetDefinition.h"
#include "VectorLayerDefinition.h"
#include "DrawingLayerDefinition.h"
#include "GridLayerDefinition.h"
@@ -95,6 +96,7 @@
std::string SerializeToXML(PrintLayoutElementDefinition* printLayoutElem, MdfModel::Version* version);
std::string SerializeToXML(WatermarkDefinition* watermark, MdfModel::Version* version);
std::string SerializeToXML(ProfileResult* profileResult, MdfModel::Version* version);
+ std::string SerializeToXML(TileSetDefinition* tileset, MdfModel::Version* version);
// Detaches the most recently parsed object from the parser.
// The calling method is then responsible for disposing the object,
@@ -112,6 +114,7 @@
MapViewportDefinition* DetachMapViewportDefinition();
WatermarkDefinition* DetachWatermarkDefinition();
ProfileResult* DetachProfileResult();
+ TileSetDefinition* DetachTileSetDefinition();
// Creates a clone of the given map/layer/symbol/print layout/print layout element definition.
// The object is serialized and parsed into a new object, which is returned.
@@ -122,6 +125,7 @@
static PrintLayoutElementDefinition* CreateClone(PrintLayoutElementDefinition* printLayoutElem);
static WatermarkDefinition* CreateClone(WatermarkDefinition* watermark);
static ProfileResult* CreateClone(ProfileResult* profileResult);
+ static TileSetDefinition* CreateClone(TileSetDefinition* tileset);
// Success State
bool GetSucceeded() const;
@@ -162,6 +166,7 @@
void SetPrintLayoutElementDefinitionVersion(const Attributes& attributes);
void SetWatermarkDefinitionVersion(const Attributes& attributes);
void SetProfileResultVersion(const Attributes& attributes);
+ void SetTileSetDefinitionVersion(const Attributes& attributes);
protected:
// The objects to be generated by the parser.
@@ -174,6 +179,7 @@
PrintLayoutDefinition* m_printLayout;
MapViewportDefinition* m_mapViewport;
WatermarkDefinition* m_watermark;
+ TileSetDefinition* m_tileset;
ProfileResult* m_profileResult;
// Succeeded is true if the parse has succeeded. As of now,
Modified: sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -26,6 +26,7 @@
: m_type(MgLayerGroupType::Normal),
m_name(L""),
m_group((MgLayerGroup*)NULL),
+ m_tileSetId((MgResourceIdentifier*)NULL),
m_visible(true),
m_displayInLegend(false),
m_expandInLegend(false),
@@ -52,6 +53,22 @@
MgUtil::GenerateUuid(m_objectId);
}
+//////////////////////////////////////////////////////////////
+// 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
@@ -240,6 +257,7 @@
stream->WriteBoolean(m_displayInLegend);
stream->WriteBoolean(m_expandInLegend);
stream->WriteString(m_legendLabel);
+ stream->WriteObject(m_tileSetId);
}
@@ -255,6 +273,7 @@
stream->GetBoolean(m_displayInLegend);
stream->GetBoolean(m_expandInLegend);
stream->GetString(m_legendLabel);
+ m_tileSetId = (MgResourceIdentifier*)stream->GetObject();
}
@@ -282,3 +301,11 @@
{
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-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroup.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -435,6 +435,28 @@
/// 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
+ /// bool SetExpandInLegend(bool expandInLegend);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// boolean SetExpandInLegend(boolean expandInLegend);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// bool SetExpandInLegend(bool expandInLegend);
+ /// \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:
//////////////////////////////////////////////////////////////////
@@ -445,6 +467,18 @@
//////////////////////////////////////////////////////////////////
/// \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
@@ -522,6 +556,7 @@
STRING m_objectId;
INT32 m_type;
Ptr<MgLayerGroup> m_group;
+ Ptr<MgResourceIdentifier> m_tileSetId;
bool m_visible;
bool m_displayInLegend;
bool m_expandInLegend;
Modified: sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroupType.h
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroupType.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/PlatformBase/MapLayer/LayerGroupType.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -40,6 +40,12 @@
/// it contains base map layers).
///
static const INT32 BaseMap = 2;
+ /////////////////////////////////////////////////
+ /// \brief
+ /// Specifies that the layer is a base map layer from a TileSetDefinition resource
+ ///
+ /// \since 3.0
+ static const INT32 BaseMapFromTileSet = 3;
};
/// \}
Modified: sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.cpp
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.cpp 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.cpp 2014-05-30 09:44:22 UTC (rev 8176)
@@ -54,6 +54,7 @@
const STRING MgResourceType::PrintLayoutDefinition = L"PrintLayoutDefinition";
const STRING MgResourceType::PrintLayoutElementDefinition = L"PrintLayoutElementDefinition";
const STRING MgResourceType::WatermarkDefinition = L"WatermarkDefinition";
+const STRING MgResourceType::TileSetDefinition = L"TileSetDefinition";
const STRING MgResourceType::User = L"User";
Modified: sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.h
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.h 2014-05-30 07:00:17 UTC (rev 8175)
+++ sandbox/jng/tiling/Common/PlatformBase/Services/ResourceDefs.h 2014-05-30 09:44:22 UTC (rev 8176)
@@ -277,6 +277,17 @@
///
static const STRING WatermarkDefinition; ///\if INTERNAL value("WatermarkDefinition") \endif
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// This resource is a tile set definition.
+ ///
+ /// \remarks
+ /// It represents a tile cache that can be referenced by a Map Definition.
+ ///
+ /// \see \ref TileSetDefinition_schema "TileSetDefinition schema"
+ ///
+ static const STRING TileSetDefinition; ///\if INTERNAL value("TileSetDefinition") \endif
+
INTERNAL_API:
///////////////////////////////////////////////////////////////////////////
Added: sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd
===================================================================
--- sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd (rev 0)
+++ sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.0.0">
+ <xs:include schemaLocation="WatermarkDefinition-2.4.0.xsd"/>
+ <xs:complexType name="Box2DType">
+ <xs:annotation>
+ <xs:documentation>Box2D encapsulates the the coordinates of a box in 2-D space</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="MinX" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Minimum x-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MaxX" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Maximum x-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MinY" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Minimum y-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MaxY" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Maximum y-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="MapLayerCommonType">
+ <xs:annotation>
+ <xs:documentation>MapLayerCommonType is a common superclass of MapLayerType and BaseMapLayerType.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Name of the MapLayer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ResourceId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>ResourceId of the MapLayer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Selectable" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer can be selected</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ShowInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer should be shown in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="LegendLabel" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Label to be shown for the Layer in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExpandInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer should be expanded in the legend.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="MapLayerType">
+ <xs:annotation>
+ <xs:documentation>MapLayerType encapsulates the properties of a map layer, including its group and options about how it should be displayed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="MapLayerCommonType">
+ <xs:sequence>
+ <xs:element name="Visible" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether this layer's visiblity should be visible or not when it first comes into range</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Group" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Group of which the MapLayer is a member of</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="BaseMapLayerType">
+ <xs:annotation>
+ <xs:documentation>BaseMapLayerType encapsulates the properties of a BaseMapLayer.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="MapLayerCommonType">
+ <xs:sequence>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="MapLayerGroupCommonType">
+ <xs:annotation>
+ <xs:documentation>MapLayerGroupCommonType is a common superclass of MapLayerGroupType and BaseMapLayerGroupType.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The name of this LayerGroup</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Visible" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether this group's visiblity should be visible or not when it first comes into range</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ShowInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the LayerGroup should be shown in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExpandInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the LayerGroup should be initially expanded in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="LegendLabel" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Label to be shown for the LayerGroup in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="MapLayerGroupType">
+ <xs:annotation>
+ <xs:documentation>MapLayerGroupType encapsulates the properties of a MapLayerGroup. Its extension to MapLayerGroupCommonType is that the MapLayerGroup itself can also be in a MapLayerGroup.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="MapLayerGroupCommonType">
+ <xs:sequence>
+ <xs:element name="Group" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The group that contains the MapLayerGroup</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="BaseMapLayerGroupType">
+ <xs:annotation>
+ <xs:documentation>BaseMapLayerGroupType encapsulates the properties of a BaseMapLayerGroup. It extends MapLayerGroupCommonType by holding the layers in the group. The base map layer groups defines what layers are used to render a tile set in the HTML viewer.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="MapLayerGroupCommonType">
+ <xs:sequence>
+ <xs:element name="BaseMapLayer" type="BaseMapLayerType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The layers that are part of this group. The order of the layers represents the draw order, layers first is the list are drawn over top of layers later in the list.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="MapDefinitionType">
+ <xs:annotation>
+ <xs:documentation>MapDefinitionType encapsulates a MapDefinition, which houses a collection of MapLayers and their groups.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The name of the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="CoordinateSystem" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The coordinate system as WKT used by the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Extents" type="Box2DType">
+ <xs:annotation>
+ <xs:documentation>A bounding box around the area of the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="BackgroundColor" type="xs:hexBinary">
+ <xs:annotation>
+ <xs:documentation>The background color to be used with the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Metadata" type="xs:string" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Metadata regarding the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MapLayer" type="MapLayerType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Zero or more MapLayers that make up the MapDefinition. The order of the layers represents the draw order, layers first is the list are drawn over top of layers later in the list.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MapLayerGroup" type="MapLayerGroupType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Zero or more MapLayerGroups that make up the MapDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="BaseMapDefinition" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The base map.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="FiniteDisplayScale" type="xs:double" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The display scales that the base map layers will have tiles available. Applies to the HTML viewer.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="BaseMapLayerGroup" type="BaseMapLayerGroupType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>A group of layers that is used to compose a tiled layer in the HTML viewer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="TileSetSource" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>A reference to the tile set source to use</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ResourceId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>ResourceId of the TileSetDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Watermarks" type="WatermarkInstanceCollectionType" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The collection of watermarks used in the map.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="MapDefinition">
+ <xs:annotation>
+ <xs:documentation>A MapDefinition defines the collection of layers, groupings of layers, and base map</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="MapDefinitionType">
+ <xs:attribute name="version" type="xs:string" use="required" fixed="2.4.0"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
Added: sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd
===================================================================
--- sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd (rev 0)
+++ sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd 2014-05-30 09:44:22 UTC (rev 8176)
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name="TileSetDefinition" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Defines a tile cache</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="TileStoreParameters" type="TileStoreParametersType">
+ <xs:annotation>
+ <xs:documentation>Defines the parameters to access the tile cache</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="CoordinateSystem" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The coordinate system as WKT used by the TileSetDefinition</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Extents" type="Box2DType">
+ <xs:annotation>
+ <xs:documentation>A bounding box around the area of the tile cache</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="FiniteDisplayScale" type="xs:double" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The display scales that the base map layers will have tiles available. Applies to the HTML viewer.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="BaseMapLayerGroup" type="BaseMapLayerGroupCommonType" minOccurs="1" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>A group of layers that is used to compose a tiled layer in the HTML viewer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="TileStoreParametersType">
+ <xs:annotation>
+ <xs:documentation>TileStoreParameters defines the parameters of this tile cache.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="TileProvider" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The tile image provider</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TileWidth" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The width of tile images in this tile cache</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TileHeight" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The height of tile images in this tile cache</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ImageFormat" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The image format of tile images in this tile cache</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Parameter" type="NameValuePairType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Collection of name value pairs for connecting to the tile image provider</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="NameValuePairType">
+ <xs:annotation>
+ <xs:documentation>A type describing name and value pairs</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Text for the name of parameter</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Value" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Text for value of parameter</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExtendedData1" type="ExtendedDataType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Box2DType">
+ <xs:annotation>
+ <xs:documentation>Box2D encapsulates the the coordinates of a box in 2-D space</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="MinX" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Minimum x-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MaxX" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Maximum x-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MinY" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Minimum y-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MaxY" type="xs:double">
+ <xs:annotation>
+ <xs:documentation>Maximum y-coordinate</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="BaseMapLayerType">
+ <xs:annotation>
+ <xs:documentation>BaseMapLayerType encapsulates the properties of a BaseMapLayer.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Name of the MapLayer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ResourceId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>ResourceId of the MapLayer</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Selectable" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer can be selected</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ShowInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer should be shown in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="LegendLabel" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Label to be shown for the Layer in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExpandInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the Layer should be expanded in the legend.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="MapLayerGroupCommonType">
+ <xs:annotation>
+ <xs:documentation>MapLayerGroupCommonType is a common subclass of MapLayerGroupCommonType and BaseMapLayerGroupCommonType</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The name of this LayerGroup</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Visible" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether this group's visiblity should be visible or not when it first comes into range</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ShowInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the LayerGroup should be shown in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ExpandInLegend" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>Whether or not the LayerGroup should be initially expanded in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="LegendLabel" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Label to be shown for the LayerGroup in the legend</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="BaseMapLayerGroupCommonType">
+ <xs:annotation>
+ <xs:documentation>BaseMapLayerGroupCommonType encapsulates the properties of a BaseMapLayerGroup. It extends MapLayerGroupCommonType by holding the layers in the group. The base map layer groups defines what layers are used to render a tile set in the HTML viewer.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="MapLayerGroupCommonType">
+ <xs:sequence>
+ <xs:element name="BaseMapLayer" type="BaseMapLayerType" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The layers that are part of this group. The order of the layers represents the draw order, layers first is the list are drawn over top of layers later in the list.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
More information about the mapguide-commits
mailing list