The most common implementation of eagleeye is to add a mapcontrol, display the full graph, and interact with the master map control.
Axmapcontrol1 main map control axmapcontrol2 eagleeye map control
1. Load the map to the eagleeye Control
When a map is loaded to the main map control, the eagleeye control is also loaded. Add the corresponding function to the axmapcontrolpoliconmapreplaced event.
Traverse all layers in the axmapcontrol1 control cyclically, add them to mapcontrol2, and set the extent attribute of mapcontrol2 to fullextent.
2. Draw an eagleeye rectangle
When the range of the main map control is changed, the rectangle is re-drawn.CodeAdd to axmapcontrolpoliconextentupdated event
3. Interaction between eagleeye and the main map control
In the axmapcontrol2_onmousedown event,
Move the rectangular box with a left click. Set ipoint type variables using event parameters, and obtain the envelope object through the main map control.
Sets the ipoint object obtained by the envelope object centerat. Then, set the extent attribute of the master map control to the configured envelope object, and then the onextentupdated event is triggered.
This event is triggered to redraw the rectangle of the eagleeye control.
If you right-click an object, use the axmapcontrol2.trackrectangle () method to obtain the envelope object, set the extent attribute of the master map control to the envelope object, trigger the onextentupdated event, and re-draw the rectangle of the eagleeye control.
In the mousemove event of the eagleeye control,
Click the left mouse button to obtain the position of the mouse click to generate an ipoint object. Set the axmapcontrol1.centerat object. Trigger onextentupdated event