Plugin Introduction:
This sample is used to guide you to navigate a map. You can control the visible extent with a rectangle on the navigation map associated with the map.
Control/Object/Interface:
Control/Object/Interface |
Properties |
Methods |
Plugin |
|
Initialize(), ExitInstance() |
CtrlAction |
FormClass |
Run() |
IFormMap |
MapControl |
|
MapControl |
Map |
Refresh() |
Map |
Layers, TrackingLayer, ViewBounds |
Refresh(), Add() |
Layer |
Dataset |
|
TrackingLayer |
|
Add(), Clear() |
GeoRectangle |
Center, Width, Height |
|
Application |
ActiveApplication, Output |
|
Basic Steps:
- Open OverViewMap.sln in the SuperMap Deskpro .NET\SampleCode\OverViewMap folder with Microsoft Visual Studio 2008 and compile it.
- When succeeded, you can find two files generated: SuperMap.Desktop.OverViewMap.dll located in the SuperMap iDesktop 8C\Bin\Plugins\OverViewMap folder and SuperMap.Desktop.OverViewMap.config located in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.
- Copy the SampleIcons folder from the SuperMap iDesktop 8C\SampleCode folder to SuperMap iDesktop 8C\SampleCode\Resources.
- Start SuperMap iDesktop 8C.
- Open World.smwu provided in the SuperMap iDesktop 8C\SampleData\World folder. When you oopen the WorldMap_Day map, you will find the Navigation Map tab on the Ribbon.
- On the Navigation tab, in the Map Navigation group, click the Display Navigation Map button to show the Navigation Map, which displays the full extent of the map.
- The rectangle on the Navigation Map changes when you browse the map in the map window. The rectangle indicates the visible extent of the map.
- Click in the navigation map to move the rectangle. The map window is instantly refreshed to display the extent of the rectangle.
Data:
SuperMap iDesktop 8C\SampleData\World\World.smwu.
Note:
When you successfully compile OverViewMap.sln, SuperMap.Desktop.OverViewMap.dll and SuperMap.Desktop.OverViewMap.config will be generated and copied to SuperMap iDesktop 8C\Bin\Plugins\OverViewMap and SuperMap iDesktop 8C\WorkEnvironment\Default respectively. Each time you start SuperMap iDesktop 8C, the OverViewMap plugin will be loaded.
If you want to remove the OverViewMap plugin from SuperMap iDesktop 8C, you only need to delete SuperMap.Desktop.OverViewMap.config in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.