[mapguide-users] Make changes to Map.MapDefinition.xml and add it to the session

Galois amihalas at yahoo.gr
Wed Oct 22 10:11:42 EDT 2008


Hello,

I was wondering if it is possible to change the runtime map via the
Map.MapDefinition.xml file.

Let's suppose that my map has the following xml file : 

<?xml version="1.0" encoding="UTF-8" ?> 
- <MapDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MapDefinition-1.0.0.xsd">
  <Name>New Map</Name> 
<CoordinateSystem>GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]</CoordinateSystem> 

<Extents>
  <MinX>8.4399882654120386</MinX> 
  <MaxX>13.284215393652543</MaxX> 
  <MinY>46.980067237965471</MinY> 
  <MaxY>44.094144693481766</MaxY> 
  </Extents>

  <BackgroundColor>ffffffff</BackgroundColor> 
  <Metadata><MapDescription>Italy Map</MapDescription></Metadata> 

<MapLayer>
  <Name>cities</Name> 
  <ResourceId>Library://GoSpatial/Layers/cities.LayerDefinition</ResourceId> 
  <Selectable>true</Selectable> 
  <ShowInLegend>true</ShowInLegend> 
  <LegendLabel>cities</LegendLabel> 
  <ExpandInLegend>true</ExpandInLegend> 
  <Visible>true</Visible> 
  <Group /> 
</MapLayer>


<MapLayerGroup>
  <Name>MainGroup</Name> 
  <Visible>true</Visible> 
  <ShowInLegend>true</ShowInLegend> 
  <ExpandInLegend>true</ExpandInLegend> 
  <LegendLabel>Main Group</LegendLabel> 
  <Group /> 
</MapLayerGroup>

Via Visual Studio I create a new MapLayer element with all the appropriate
information and save the file.
So my new Map.MapDefinition is the previous xml with the following layer
added:

<MapLayer>
  <Name>mountains</Name> 
 
<ResourceId>Library://GoSpatial/Layers/mountains.LayerDefinition</ResourceId> 
  <Selectable>true</Selectable> 
  <ShowInLegend>true</ShowInLegend> 
  <LegendLabel>LegendLabel</LegendLabel> 
  <ExpandInLegend>true</ExpandInLegend> 
  <Visible>true</Visible> 
  <Group /> 
</MapLayer>


So, how can I use this new .xml in order to update my map definition, and
ofcourse to see the changes in the runtime map?

Thank you in advance!

-- 
View this message in context: http://www.nabble.com/Make-changes-to-Map.MapDefinition.xml-and-add-it-to-the-session-tp20111547p20111547.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list