TTMSFNCLeaflet Class
Provides a Leaflet-based interactive map component.
API unit family: TMSFNCLeaflet
Inherits from: TTMSFNCCustomLeaflet
Syntax
TTMSFNCLeaflet = class(TTMSFNCCustomLeaflet)
class PASCALIMPLEMENTATION TTMSFNCLeaflet : public TTMSFNCCustomLeaflet
Properties
| Name | Description |
|---|---|
| HeatMaps | Provides the heat map collection. (inherited from TTMSFNCCustomLeaflet) |
| Markers | Provides the marker collection. (inherited from TTMSFNCCustomLeaflet) |
| Options | Provides access to map provider options. (inherited from TTMSFNCCustomLeaflet) |
| Polygons | Provides the polygon collection. (inherited from TTMSFNCCustomLeaflet) |
| Polylines | Provides the polyline collection. (inherited from TTMSFNCCustomLeaflet) |
| TileLayers | Provides the custom tile layer collection. (inherited from TTMSFNCCustomLeaflet) |
Methods
| Name | Description |
|---|---|
| AddBridge | Adds an object bridge for browser script communication. |
| AddCircle | Adds a circle to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddHeatMap | Adds a heat map layer to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddMarker | Adds a marker to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddPolygon | Adds a polygon to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddPolyline | Adds a polyline to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddRectangle | Adds a rectangle to the map. (inherited from TTMSFNCCustomLeaflet) |
| AddTileLayer | Adds a custom tile layer to the map. (inherited from TTMSFNCCustomLeaflet) |
| CanGoBack | Returns whether the embedded browser can navigate back. |
| CanGoForward | Returns whether the embedded browser can navigate forward. |
| CaptureScreenShot | Captures a screenshot of the embedded browser. |
| Clear | Removes all items from the collection. (inherited from TTMSFNCCustomLeaflet) |
| ClearCache | Clears the embedded browser cache. |
| ClearHeatMaps | Removes all heat map layers from the map. (inherited from TTMSFNCCustomLeaflet) |
| ClearTileLayers | Removes all custom tile layers from the map. (inherited from TTMSFNCCustomLeaflet) |
| DeInitialize | Deinitializes the embedded browser and map runtime. |
| EndUpdate | Ends an update block and applies pending map changes. (inherited from TTMSFNCCustomLeaflet) |
| ExecuteJavaScript | Executes JavaScript in the embedded map browser. |
| ExecuteJavaScriptSync | Executes JavaScript synchronously in the embedded map browser. |
| GetBridgeCommunicationLayer | Returns the script communication layer for a bridge. |
| GetWebBrowserInstance | Returns the native web browser instance interface. |
| GoBack | Navigates back in the embedded browser history. |
| GoForward | Navigates forward in the embedded browser history. |
| Initialize | Initializes the embedded browser and map runtime. |
| IsFMXBrowser | Returns whether the active browser is the native FMX browser. |
| LoadFile | Loads an HTML file into the embedded browser. |
| LoadHTML | Loads HTML content into the embedded browser. |
| NativeBrowser | Returns the native browser handle. |
| NativeDialog | Returns the native dialog handle used by the browser. |
| NativeEnvironment | Returns the native browser environment handle. |
| Navigate | Navigates the embedded browser to the map document or URL. |
| Reload | Reloads the embedded browser content. |
| RemoveBridge | Removes an object bridge from browser script communication. |
| ShowDebugConsole | Shows the browser debug console. |
| StopLoading | Stops the current browser load operation. |
Events
| Name | Description |
|---|---|
| OnMarkerDragEnd | Occurs when marker dragging ends. (inherited from TTMSFNCCustomLeaflet) |
Usage examples
Handle Leaflet right-click events
Wires OnMapRightClick, OnMarkerRightClick, and OnPolyElementRightClick to context actions.
procedure TForm1.ConfigureLeafletContextEvents;
begin
TMSFNCLeaflet1.OnMapRightClick := TMSFNCLeaflet1MapRightClick;
TMSFNCLeaflet1.OnMarkerRightClick := TMSFNCLeaflet1MarkerRightClick;
TMSFNCLeaflet1.OnPolyElementRightClick := TMSFNCLeaflet1PolyElementRightClick;
end;
procedure TForm1.TMSFNCLeaflet1MapRightClick(Sender: TObject;
AEventData: TTMSFNCMapsEventData);
begin
{ Show a map-level context menu at AEventData.Coordinate. }
end;
procedure TForm1.TMSFNCLeaflet1MarkerRightClick(Sender: TObject;
AEventData: TTMSFNCMapsEventData);
begin
if Assigned(AEventData.Marker) then
AEventData.Marker.Title := 'Selected marker';
end;
procedure TForm1.TMSFNCLeaflet1PolyElementRightClick(Sender: TObject;
AEventData: TTMSFNCMapsEventData);
begin
if Assigned(AEventData.PolyElement) then
AEventData.PolyElement.DataString := 'Selected poly element';
end;