Example: Copying and Reusing Shapes between Maps
|Top Previous Next|
This example shows you how to use MPSuperShape's import and export operations to copy shapes between map files. It is assumed that you know how to activate MPSuperShape and how to select shapes in MPSuperShape.
This example copies the red shape from the example_territory_NA.ptm map file to the example_NA.ptm map file. This requires MapPoint North America. Both map files can be found in the MPSuperShape examples file:
Load the example_territory_NA.ptm into MapPoint. For clarity, the map has been set to a terrain map with the smallest font size. The shape will be copied is red. It is imagined that this could be the territory of a salesperson. The other map file contains drive time zones around two depots. By copying the territory shape to this latter map, we can compare it with depot accessibility. The territory map looks like this:
Activate MPSuperShape, and select the red shape. Right click on the map to display the popup menu, and select Export. MPSuperShape will display a standard Windows File Selection dialog box. Select an appropriate path and enter the name "territory". Make sure the file extension is set to the GML option. Press OK and MPSuperShape will export the shape to a file called territory.gml.
Re-open MapPoint with the example_NA.ptm map file that contains the drive time zones. These drive time zones look like this:
On the MapPoint Tools menu, select the MPSuperShape: Import menu item. MPSuperShape will display a standard Windows File Selection dialog box. Select the territory.gml file that you have just created. Make sure the file extension is set to ".gml". Press OK. MPSuperShape will import the shape from the file and draw it on the current map. The end result should look like this:
The red territory shape has been copied to the drive time map, allowing an easy comparison to be made.
The GML file can be retained, allowing the import process to be repeated with other map files at a future date. For example, here it has been imported into the example_NA2.ptm map file: