72 | Chapter 6 Using Buzzsaw with Autodesk MapGuide Viewer
■ MGMap.getLat
■ MGMap.getLon
■ MGMap.getWidth
■ MGMap.getUnits
3 Save the list of layers, groups, and their corresponding visibility by using
the following APIs:
■ MgMap.getMapLayersEx
■ MgMap.getMapLayerGroups
■ MgMapLayer.getVisibility
■ MgMapLayerGroup.getVisibility
4 Save the feature selection state by using the following API:
■ MgMap.getSelection
To restore the map state
1 When the HTML page loads, restore the current view and selection state
using the PARAMs to the HTML OBJECT tag that specifies the MapGuide
map.
2 Use Document.write to specify the PARAMs dynamically when the page
loads, setting the following PARAMS:
■ Selobjs
■ Lat
■ Lon
■ MapWidth
■ Units
Note All parameters are described in Autodesk MapGuide Viewer Help,
Advanced Topics ➤URL Parameters
3 Set the layer and group visibility using the following MapGuide Viewer
APIs:
■ MGMap.getMapLayerEx
■ MGMapLayer.setVisibility
■ MGMap.getMapLayerGroups
■ MGMapLayerGroup.setVisibility
Note Use the onMapLoaded event to get the list of layers and groups and
change their visibility.