Ga naar inhoud

TP2WLeaflet

TP2WLeaflet is a Delphi wrapper for Leaflet, an open-source JavaScript library for mobile-friendly interactive maps.

Properties

property description
Attribution allows you to display attribution data in a small text box on the map
Value string to be shown in the attribution control, e.g. "© OpenStreetMap contributors"
Visible whether the attribution control is added to the map
Center initial geographic center of the map
Lat latitude, for example 51.505
Lng longitude, for example -0.09
Markers one or more TLeafletMarkers. markers are used to display clickable icons on the map
Zoom initial map zoom level
Level zoom level, valid values are between 0 and 19
Visible whether the zoom control is added to the map

Events

event description
OnClick fired when the user clicks (or taps) the map
OnDblClick fired when the user double-clicks (or double-taps) the map
OnMouseDown fired when the user pushes the mouse button on the map
OnMouseUp fired when the user releases the mouse button on the map
OnMouseMove fired while the mouse moves over the map
OnMouseEnter fired when the mouse enters the map
OnMouseLeave fired when the mouse leaves the map
OnMarkerClick fired when the user clicks (or taps) on a marker
OnMarkerDblClick fired when the user double-clicks (or double-taps) on a marker
OnMarkerMouseDown fired when the user pushes the mouse button on a marker
OnMarkerMouseUp fired when the user releases the mouse button on a marker
OnMarkerMouseMove fired while the mouse moves over a marker
OnMarkerMouseEnter fired when the mouse enters a marker
OnMarkerMouseLeave fired when the mouse leaves a marker

The following arguments are included with the above events:

name type description
Sender TObject TP2WLeaflet or TLeafletMarker
Target TJSEventTarget the object that fired the event
LatLng TLeafletLatLng detected geographical location of the user
Origin TJSEvent the original JavaScript event that triggered this event

TLeafletMarker

property description
Popup string that is shown inside a popup above the marker when clicked upon the marker
Position geographic position of the marker on the map
method description
OpenPopup shows the bound popup at the marker's icon
ClosePopup hides the popup bound to this marker if it is open