How to get the map coordinates of the mouse point in pagelayoutcontrol, especially the latitude and longitude values (collected articles)

Source: Internet
Author: User
Content summary
When obtaining the map coordinates in pagelayoutcontrol, developers only get the coordinate values of the page. This is because the activeview of pagelayout is used. When obtaining idisplaytransformation, you should use the activeview of map instead of pagelayout.
Process description

Private sub pagelayoutcontrolpoliconmousedown (byval button as long, byval shift as long, byval X as long, byval y as long, byval pagex as double, byval Pagey as double)

Dim ppagelayout as ipagelayout

Set ppagelayout = pagelayoutcontrol1.pagelayout
Dim pav as iactiveview
Set pav = ppagelayout
Dim pav1 as iactiveview
Set pav1 = Pav. focusmap 'use the activeview of IMAP to obtain the map coordinates.
Dim Ppoint as ipoint
Set Ppoint = pav1.screendisplay. displaytransformation. tomappoint (x, y)
'If you want to get the coordinate values of longitude and latitude, and the original map is the projection coordinate system, you need to project the coordinates to the geographic coordinate system.

Dim ppoint1 as ipoint

Set ppoint1 = Ppoint. Project (......) 'For projection, see the example in ipoint: Project in the development help documentation.

End sub

 

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.