Thursday, 18 August 2016

MapGuide/AIMS - modifying maps and layers as XML

Often I export MapGuide map definitions or layers as XML in order to add or remove content. Most often it is faster than using Studio. The modified XML file is uploaded with MapAgent and "SetResource". Specifically map definitions contain hundreds of layers and often layers need to be added or removed. I just realized that instead of deleting layers and uploading the map definition I can just put the layers in questions within XML comment tags and upload the file again. In case I have made a mistake and "deleted" a layer which I didn't want to delete I can go back to my XML file, remove the comment tags and upload the file again. Unfortunately the comments are filtered out when uploading - so when you save the map definition again as XML file from Studio all comments are gone. 
By the way - when you put comments into Map layer definition files and open and save the DisplayModel with Map the comments are retained.




 </MapLayer>  
 -->  
  <MapLayer>  
  <Name>GR_Baum</Name>  
  <ResourceId>Library://FS_INFO/WT_GR_I/Layers/GR_Baumkataster/GR_Baum.LayerDefinition</ResourceId>  
  <Selectable>false</Selectable>  
  <ShowInLegend>true</ShowInLegend>  
  <LegendLabel>GR_Baum</LegendLabel>  
  <ExpandInLegend>false</ExpandInLegend>  
  <Visible>true</Visible>  
  <Group>GR_Baumkataster</Group>  
  </MapLayer>  
  <!--  
  <MapLayer>  
  <Name>SW_Projektperimeter</Name>  
  <ResourceId>Library://WMS_IN/IS/Layers/SW_Projektperimeter.LayerDefinition</ResourceId>  
  <Selectable>false</Selectable>  
  <ShowInLegend>true</ShowInLegend>  
  <LegendLabel>SW_Projektperimeter</LegendLabel>  
  <ExpandInLegend>false</ExpandInLegend>  
  <Visible>false</Visible>  
  <Group>Leitungskataster</Group>  
  </MapLayer>  
  -->  
  <MapLayer>  

No comments:

Post a Comment