WebMapViewer.Click

From Xojo Documentation

Event


WebMapViewer.Click(Latitude as Double, Longitude as Double, Location as WebMapLocation)

New in 2011r2

Supported for all project types and targets.

Called when the user clicks a location on the map. If the location was also the icon associated with a WebMapLocation, that object will also be included in Location, otherwise it will be Nil.


Example

This example drops a pin where the user clicks on the map. If the user clicks on an existing pin, it is removed:

If Location Is Nil Then
Var newLocation As New WebMapLocation(Latitude, Longitude)
newLocation.Animated = True
MapViewer1.AddLocation(newLocation)
Else
MapViewer1.RemoveLocation(Location)
End If