Plugin Introduction:
This sample is used to locate to a point and zoom in the map with the point as the center.
Control/Object/Interface:
Control/Object/Interface |
Properties |
Methods |
Plugin |
|
Initialize(), ExitInstance() |
CtrlAction |
FormClass |
Run() |
Application |
ActiveApplication, Output, MainForm |
|
IFormMain |
FormManager |
|
IFormManager |
ActiveForm |
|
IFormMap |
MapControl |
|
MapControl |
Map |
Refresh() |
Map |
TrackingLayer, Center, Scale |
Refresh() |
TrackingLayer |
|
Add() |
Basic Steps:
- Open LocationTo.sln in the SuperMap iDesktop 8C\SampleCode\LocationTo folder with Microsoft Visual Studio 2008 and compile it.
- When succeeded, you can find two files generated: SuperMap.Desktop.LocationTo.dll located in the SuperMap iDesktop 8C\Bin\Plugins\LocationTo folder and SuperMap.Desktop.LocationTo.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 in the SuperMap iDesktop 8C\SampleData\World folder. When you open the WorldMap_Day map, you will see the Map Location tab with the Locate To button on the Ribbon.
- On the Map Location tab, in the Location group, click the Locate To button to display the Locate To dialog box.
- In the Locate To dialog box, input the x and y coordinates in the corresponding boxes and click Locate. Here we set X to 116 and Y to 39, then click Locate.
- The point is shown blinking on the map and the map is zoomed in with the point as the center.
Data:
SuperMap iDesktop 8C\SampleData\World\World.smwu.
Note:
When you successfully compile LocationTo.sln, SuperMap.Desktop.LocationTo.dll and SuperMap.Desktop.LocationTo..config will be generated and copied to SuperMap iDesktop 8C\Bin\Plugins\LocationTo and SuperMap iDesktop 8C\WorkEnvironment\Default respectively. Each time you start SuperMap iDesktop 8C, the LocateTo plugin will be loaded.
If you want to remove the LocateTo plugin from SuperMap iDesktop 8C, you only need to delete SuperMap.Desktop.LocationTo.config in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.