Implementation of eagleeye function (step, no code)

Source: Internet
Author: User
Tags ipoint

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.