Use ArcGIS Engine to query and flash map clicks

Source: Internet
Author: User
ArcGIS Engine does not provide the click query command in mapcontrol, but only provides the click query command used in readercontrol. The following Code Click to query and flash the code.
Process description
Private sub mapcontrolpoliconmousedown (byval button as long, byval shift as long, byval X as long, byval y as long, byval MapX as double, byval mapy as double)
Dim pmap as IMAP

Dim I as integer
Dim Ppoint as ipoint
Set pmap = mapcontrol1.map
Set Ppoint = mapcontrol1.activeview. screendisplay. displaytransformation. tomappoint (x, y)

Dim pidentify as iidentify

Dim pidarray as iarray
Dim pfeatidobj as ifeatureidentifyobj
Dim pidobj as iidentifyobj
Set pidentify = pmap. layer (1)

Dim penv as ienvelope
Set penv = new envelope
Set penv = mapcontrol1.activeview. Extent
Penv. Height = 100
Penv. width = 100
Penv. centerat Ppoint

Set pidarray = pidentify. Identify (penv)

If not pidarray is nothing then
Set pfeatidobj = pidarray. element (0)
Set pidobj = pfeatidobj
Pidobj. Flash mapcontrol1.activeview. screendisplay
'Message display query target information
Msgbox "layer:" & pidobj. layer. Name & vbnewline & "feature:" & pidobj. Name
Else
Msgbox "No feature identified ."
End if
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.