Coordinates of mouse click in map window

This example shows you how to capture real world coordinates when the mouse is clicked in the map window.

On your web form, add a Label called coordsLabel.

Double-click the map image button to create an event handler and fill in the code as below:

Copy
Private Sub ImageButton1_Click(ByVal sender As System.Object
ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
   ' e contains the coordinates of where the user clicked, in pixels   
' Use GeognoSIS to convert them to real-world coordinates   
Dim v As SisVector = oSis.GetViewPos(e.X, e.Y, ImageButton1.Width.Value, 
ImageButton1.Height.Value)   
    Write them into the label   
    coordsLabel.Text = "Coordinates: (" & v.x & ", " & v.y & ")"
End Sub

Although this is a very simple example, once you have the real-world coordinates of the click they can be used for almost any purpose.