Skip to content

TWebLeafletMaps

Description

Below is a list of the most important properties methods and events for TWebLeafletMaps.

Designtime Runtime

HTML template tag

The HTML tag the component can be associated with in an HTML template. Assign the ID attribute with a unique value and set the identical value to the ElementID property. Detailed information can be found in the Use of HTML templates topic.

HTML tag <DIV ID=”UniqueID”></DIV>
ElementID UniqueID

Properties for TWebLeafletMaps

Property Description
Center Sets whether the map control centers vertically and/or horizontally within its parent control
ElementClassName Optionally sets the CSS classname for the map when styling via CSS is used
ElementID Optionally sets the HTML element ID for a HTML element in the form HTML file the component needs to be connected with. When connected, no new object is created but the Delphi class is connected with the existing HTML element in the form HTML file
Options Sets various options for the map

Methods for TWebLeafletMaps

Property Description
AddPolyline(Points: TJSArray; AColor: TColor; AWidth: integer; AOpacity: double); Adds a polyline with a specific color, width and opacity on the map
AddPolygon(Points: TJSArray; AFillColor: TColor; AColor: TColor; AWidth: integer; AOpacity: double); Adds a polygon with a specific fill color, stroke color, width and opacity on the map
AddCircle(Lat,Lon: double; Radius: integer; AFillColor: TColor; AColor: TColor; AWidth: integer; AOpacity: double); Adds a circle with a specific fill color, stroke color, width and opacity on the map
AddRectangle(NELat,NELon,SWLat,SWLon: double; AFillColor: TColor; AColor: TColor; AWidth: integer; AOpacity: double); Adds a rectangle with a specific fill color, stroke color, width and opacity on the map
AddMarker(Lat,Lon: double; Title: string; Popup: string); Adds a marker with a specific title as hint and HTML as popup when clicked on the map and
ClearMarkers; Removes markers from the map
ClearPolylines; Removes the polylines from the map
ClearPolygons; Removes the polygons from the map
ClearCircles; Removes the circles from the map
ClearRectangles; Removes the rectangles from the map
GetCenter(var Lat,Lon: double); Gets the center coordinates of the map
SetCenter(Lat,Lon: double); Sets the center coordinates of the map
SetZoom(Zoom: integer); Sets the zoom level of the map
LatLonToXY(Lat,Lon: double; var X, Y: integer) Converts longitude, latitude coordinates to pixel coordinates
XYToLatLon(X,Y: integer; var Lat,Lon: double) Converts pixel coordinates to longitude, latitude coordinates
Distance(Lon1,Lat1,Lon2,Lat2: double): double; Gets the distance in meters between two points

Events for TWebLeafletMaps

Property Description
OnKeyDown Event triggered when a key was clicked
OnKeyPress Event triggered when a key was pressed
OnKeyUp Event triggered when a key click finished
OnMapClick Event triggered when the map is clicked
OnMapDblClick Event triggered when the map is double-clicked
OnMapPan Event triggered when the map is panned
OnMapZoom Event triggered when the map is zoomed
OnMarkerClick Event triggered when a marker on the map is clicked
OnMouseDown Event triggered when the mouse is down on the map
OnMouseMove Event triggered when the mouse moves over the map
OnMouseUp Event triggered when the mouse is up on the map