Map Components for Delphi – documentation (EN)
Wersja polska · help site: https://help.imetroll.com/
Map components for RAD Studio 12 Athens (VCL and FireMonkey) built on MapLibre GL JS: raster tile maps, 3D vector maps served by our own server, an appearance editor, GeoJSON areas (world → continents → countries) and pluggable address-search providers.
Status: written for RAD Studio 12, not yet compiled in Delphi. Unit tests of the framework-neutral parts pass under FPC 3.2 (
tests/fpc/run_fpc_check.py). Please report compile errors with the line number.
Contents
- Components
- Installation
- Quick start
- Tile maps TTileMapVCL / TTileMapFMX
- 3D maps T3DMapVCL / T3DMapFMX
- Zero point, main marker, radius
- Navigation buttons
- Address search and providers
- Area selection and search inside an area
- TEditMap – appearance of the 3D map
- TMapAreas – world, continents, countries
- TEditMapRaster – raster tiles
- DEM terrain and elevation (T3DTerrain / T3DMap.Terrain)
- Reference
- Recipes
- Migrating from the previous version
- Limitations and open issues
- Troubleshooting
1. Components
Palette page: Maps.
| Component | Framework | Description |
|---|---|---|
TTileMapVCL |
VCL (WebView2) | Raster map: OpenStreetMap, satellite (Esri), terrain (OpenTopoMap) |
TTileMapFMX |
FMX (TWebBrowser) | The same for Windows, Android, macOS, iOS |
T3DMapVCL |
VCL | 3D vector map from mapa.imetroll.com: 2D/3D, pitch, buildings, theme |
T3DMapFMX |
FMX | The same in FireMonkey |
TEditMap (alias TEdit3DMap) |
non-visual | Colours, opacity, visibility, widths and per-zoom values of the 111 layers of the 3D map |
TMapAreas |
non-visual | GeoJSON areas: whole world / continents / countries + own files |
TNominatimSearchProvider |
non-visual | Search via Nominatim 5.1 (geoloc.imetroll.com + token) |
TCustomUrlSearchProvider |
non-visual | Any JSON geocoder (URL template) |
TWeather |
non-visual | Weather (Open-Meteo server): data for an area / voivodeship, gradient / pixel overlay + legend on the map |
One shared core (MapCommon.Core) drives all four maps, so they have the same properties,
methods and events. The 3D maps add 2D/3D mode, theme and EditMap.
| Unit | Contents |
|---|---|
MapCommon.Types |
types, style enums, events, helpers |
MapCommon.Core |
map logic (state, replay after reload, search, areas) |
MapCommon.MapVCL / MapCommon.MapFMX |
the map components |
MapCommon.Bridge, MapCommon.PageHtml |
JS ↔ Delphi bridge (protocol v2), HTML page |
MapCommon.Search, MapCommon.Nominatim |
search providers |
MapCommon.EditMap, MapCommon.StyleSettings, MapCommon.LayerInfo, MapCommon.StyleDefaults |
TEditMap |
MapCommon.EditMapVCL / MapCommon.EditMapFMX |
editor window |
MapCommon.Areas, MapCommon.AreasData, MapCommon.AreasCatalog |
TMapAreas |
MapCommon.Location |
device location (System.Sensors) |
MapCommon.Weather, MapCommon.Weather.* (Types, Area, Client, Colors, Overlay, AreaResolve) |
TWeather |
MapCommon.Reg |
registration, property and component editors |
2. Installation
- Open
MapComponents.groupproj. - Build
MapComponentsRT,MapComponentsVCL,MapComponentsFMX. - Install
MapComponentsDsgn(Win32, design-time). The components appear on the Maps palette page. - Add
Sourceto the Library path or the project search path (the demos compile from source). - Windows: copy
WebView2Loader.dllof the matching bitness ($(BDS)\Redist\win32orwin64) next to the EXE. The WebView2 Runtime is required (preinstalled on Windows 10/11).
| Package | Kind | Contents |
|---|---|---|
MapComponentsRT |
runtime, all platforms | core, bridge, search, TEditMap, TEditMapRaster, TMapAreas |
MapComponentsVCL |
runtime, Win32/Win64 | TTileMapVCL, T3DMapVCL, VCL editor window |
MapComponentsFMX |
runtime, Win/Android/macOS/iOS | TTileMapFMX, T3DMapFMX, FMX editor window |
MapComponentsDsgn |
design-time | Maps palette, property editors, verbs |
Demos (Demos): DemoTileVCL (tiles, zero point, radius, area), Demo3DVCL (3D + TEditMap),
DemoAreasVCL (TMapAreas), Demo3DTerritoryVCL / Demo3DTerritoryFMX (DEM + provinces), DemoSearchVCL (providers), DemoFMX (FMX: tiles + areas, 3D + editor).
3. Quick start
Drop a TTileMapVCL (or TTileMapFMX) on a form, set Align = alClient and run.
A TNominatimSearchProvider, TMapAreas or TEditMap on the same form is linked automatically
to the empty SearchProvider, Areas, EditMap property (AutoLinkComponents = True).
uses MapCommon.Types, MapCommon.MapVCL;
procedure TForm1.FormCreate(Sender: TObject);
begin
TileMap1.Style := tmsOpenStreetMap; // tmsSatellite, tmsTerrain
TileMap1.ZeroLat := 52.2297; // zero point (Home button)
TileMap1.ZeroLon := 21.0122;
TileMap1.Zoom := 13;
TileMap1.SearchToken := GetEnvironmentVariable('MAP_SEARCH_TOKEN');
end;uses MapCommon.Types, MapCommon.MapFMX;
procedure TForm1.FormCreate(Sender: TObject);
begin
TileMap1.Style := tmsOpenStreetMap;
TileMap1.ZeroLat := 52.2297;
TileMap1.ZeroLon := 21.0122;
TileMap1.Zoom := 13;
TileMap1.SearchToken := GetEnvironmentVariable('MAP_SEARCH_TOKEN');
end;4. Tile maps TTileMapVCL / TTileMapFMX
The style is picked from an enum (Style: TTileMapStyle). Tile URLs are not in the Object
Inspector: an own source is set in code only (CustomTileURL, CustomAttribution,
CustomTileMaxZoom) together with Style := tmsCustom.
Style |
Source | Max zoom | Attribution (always shown) |
|---|---|---|---|
tmsOpenStreetMap |
tile.openstreetmap.org | 19 | © OpenStreetMap contributors |
tmsSatellite |
Esri World Imagery (server.arcgisonline.com) | 19 | Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, … |
tmsTerrain |
OpenTopoMap | 17 | © OpenStreetMap contributors, SRTM; style © OpenTopoMap (CC-BY-SA) |
tmsCustom |
CustomTileURL (code only) |
CustomTileMaxZoom |
CustomAttribution |
Tile terms of use (important for deployment):
- OpenStreetMap (
tile.openstreetmap.org): the OSMF Tile Usage Policy applies – donation-funded servers without SLA; bulk downloading (prefetch, offline) is forbidden, an identifying User-Agent/Referer and visible attribution are required. For heavy traffic use a commercial provider or your own tile server (tmsCustom). - Esri World Imagery: without an API key only limited use is allowed (per Esri terms, essentially non-commercial); commercial use needs an ArcGIS account/licence. Esri attribution is mandatory.
- OpenTopoMap: OSM + SRTM data, CC-BY-SA style; a private service with limited capacity – not suitable for heavy production traffic.
5. 3D maps T3DMapVCL / T3DMapFMX
Vector map with tiles from mapa.imetroll.com (style liberty, 111 layers). Everything the tile
maps have plus 2D/3D mode, pitch, 3D buildings and a day/night theme. Colours are not edited in the
map itself – use a TEditMap linked through EditMap.
Style: TMap3DStyle |
Description |
|---|---|
m3sVector |
3D vector style from mapa.imetroll.com (default) |
m3sSatelliteHybrid |
Esri satellite + 3D buildings and labels |
m3sTerrainHybrid |
OpenTopoMap terrain + 3D buildings |
m3sServerStyle |
Style saved on the server (ServerStyleName, e.g. via TEditMap.SaveToServer) |
m3sCustom |
CustomStyleURL (code only) or LoadStyleJSON |
Map3D.Style := m3sVector; // own 3D vector tiles (mapa.imetroll.com)
Map3D.Mode := mm3D; // or Map3D.ToggleMode
Map3D.Pitch3D := 55;
Map3D.Theme := mtNight;
Map3D.Buildings3D := True;
// a style saved on the map server:
Map3D.ServerStyleName := 'moj-styl';
Map3D.Style := m3sServerStyle;
// custom URL - code only (public, not in the Object Inspector):
Map3D.CustomStyleURL := 'https://example.com/style.json';
Map3D.Style := m3sCustom;
StyleURL is no longer published. The only URLs left in the Object Inspector are BoundariesURL
(a boundaries data source, not a style) and SearchProviderURL (fallback search address).
6. Zero point, main marker, radius
The zero point (ZeroLat, ZeroLon, default Warsaw 52.2297, 21.0122) is the reference point:
the Home button flies there (HomeUsesZeroPoint) and distances are measured from it
(MainMarkerDistanceFromZero, MainMarkerBearingFromZero, MainMarkerPixelOffsetFromZero – the
same pixel maths as the old OSMMapViewer). It may have its own icon (ZeroIcon).
Main marker – source MainMarkerSource:
| Value | Position |
|---|---|
mmsZeroPoint |
at the zero point (default) |
mmsManual |
MainMarkerLat, MainMarkerLon / SetMainMarker |
mmsDeviceLocation |
device location (GPS/network, UpdateMyLocation); if unavailable – the zero point (OnLocation(Success=False)) |
Own image: MainMarkerIcon (TPicture in VCL, TBitmap in FMX; sent as a PNG data URL).
Without an image a dot is drawn (MainMarkerColor, MainMarkerBorderColor, MainMarkerSize,
MainMarkerSquare, pulse PulseEnabled/PulseColor).
Map.ZeroLat := 52.2297;
Map.ZeroLon := 21.0122;
Map.ZeroPointVisible := True;
Map.ZeroIcon.LoadFromFile('zero.png'); // TPicture (VCL) / TBitmap (FMX)
Map.MainMarkerSource := mmsDeviceLocation; // GPS, falls back to the zero point
Map.MainMarkerIcon.LoadFromFile('pin.png'); // own image instead of the dot
Map.MainMarkerIconWidth := 32;
Map.MainMarkerIconHeight := 40;
Map.PulseEnabled := True;
ShowMessage(Format('%.0f m od punktu zerowego', [Map.MainMarkerDistanceFromZero]));
Radius – a circle around the main marker, the zero point or any point, with fill and outline colours and opacity:
Map.RadiusCenter := rcMainMarker;
Map.RadiusMeters := 1500;
Map.RadiusColor := clRed; // VCL TColor / FMX TAlphaColor
Map.RadiusFillOpacity := 0.12;
Map.RadiusLineColor := clMaroon;
Map.RadiusLineOpacity := 0.9;
Map.RadiusLineWidth := 2;
Map.RadiusLineStyle := mlsDashed;
Map.RadiusLabel := '1,5 km';
Map.RadiusVisible := True;
7. Navigation buttons
Button panel (NavVisible, NavPosition, NavOrientation, NavButtonSize) with the
NavButtons collection. Each button has Kind, Visible, Hint, Icon (own icon) and Action.
Kind |
Built-in action |
|---|---|
nbkSearch |
shows the search box |
nbkZoomIn / nbkZoomOut |
zoom in / out |
nbkHome |
fly to the zero point (or HomeLat/HomeLon) |
nbkMyLocation |
device location → main marker |
nbkSelectArea |
area selection (AreaShape) |
nbkStyle |
next style (NextStyle) |
nbkMode3D |
2D/3D (3D maps only) |
nbkResetNorth |
rotate to north |
Every click raises OnNavButtonClick(Kind); with Action = nbaEventOnly only the event runs.
// own icon and hint for a built-in button
with Map.NavButtons.Find(nbkHome) do
begin
Icon.LoadFromFile('home.png');
Hint := 'Wróć do punktu zerowego';
end;
// hide a button
Map.NavButtons.Find(nbkStyle).Visible := False;
// only the event, no built-in action
Map.NavButtons.Find(nbkMyLocation).Action := nbaEventOnly;
Map.NavPosition := bppTopRight;
Map.NavOrientation := bpoHorizontal;
8. Address search and providers
The map searches through the component in SearchProvider (linked automatically when it is on the
form). When empty, an internal TNominatimSearchProvider with SearchProviderURL (default
https://geoloc.imetroll.com) and SearchToken (never stored in the DFM) is used.
| Provider | Use |
|---|---|
TNominatimSearchProvider |
Nominatim 5.1: search, reverse, lookup, structured, status; geoloc gateway with token, continents (ContinentBaseURLs) |
TCustomUrlSearchProvider |
any JSON API: SearchURL, ReverseURL, AreaSearchURL with placeholders {query} {lang} {limit} {lat} {lon} {zoom} {south} {west} {north} {east} |
Pre-flight validation: missing token, bad token format, invalid URL, /status probe on first use
(result in LastCheck*), HTTP error classification. Errors go to OnSearchError with a
TMapProviderErrorKind and a PL/EN message:
ErrorKind |
Meaning |
|---|---|
pekNoToken |
no token although the server needs one (TokenRequired) |
pekInvalidToken |
401/403 – token rejected |
pekBadURL |
invalid address (scheme, host) |
pekUnreachable |
DNS / no connection |
pekTimeout |
ConnectTimeout / Timeout exceeded |
pekServerDown |
5xx or /status ≠ OK |
pekHTTPError |
other HTTP status |
pekBadResponse |
response is not the expected JSON |
pekRateLimited |
429 – too many requests |
pekUnsupported |
the provider does not support this request kind |
// drop TNominatimSearchProvider on the form: every map links it automatically
NominatimSearchProvider1.BaseURL := 'https://geoloc.imetroll.com';
NominatimSearchProvider1.Token := GetEnvironmentVariable('MAP_SEARCH_TOKEN');
NominatimSearchProvider1.Language := 'pl';
NominatimSearchProvider1.CountryCodes := 'pl';
NominatimSearchProvider1.CheckConnection(
procedure(Ok: Boolean; ErrorKind: TMapProviderErrorKind; const ErrorMessage, StatusJSON: string)
begin
if not Ok then
ShowMessage(ErrorMessage); // e.g. pekInvalidToken: "Token odrzucony (403)"
end);
// any JSON geocoder
CustomUrlSearchProvider1.SearchURL := 'https://photon.komoot.io/api/?q={query}&limit={limit}&lang={lang}';
TileMap1.SearchProvider := CustomUrlSearchProvider1;
Usage policy and data licence. Results come from OpenStreetMap – licence ODbL: the app must
show "© OpenStreetMap contributors", and derived databases you share are share-alike. The public
nominatim.openstreetmap.org server has its own policy (max. 1 request/s for the whole application,
identifying User-Agent, no autocomplete or systematic queries, caching required). The component
uses our own geoloc.imetroll.com gateway by default, but the address is configurable – per the OSMF
policy it must be changeable without a software update. Enable SearchLive (search while typing)
only on your own server.
Client-side rate limit. TNominatimSearchProvider.MinRequestIntervalMs (default 1000 ms) queues
requests so the provider sends at most one HTTP request per second (the /status probe counts too) –
nothing is dropped, later results simply arrive later. After a 429 response (pekRateLimited,
OnError event) the next request waits RateLimitBackoffMs (default 10000 ms). For
TCustomUrlSearchProvider the limit is off by default (0).
9. Area selection and search inside an area
AreaShape = masRectangle, masPolygon or masCircle. Selection starts with the nbkSelectArea
button or StartAreaSelection. Afterwards: OnAreaSelected(Area), HasArea, Area.
SearchInArea(Query) searches inside the area (viewbox + point-in-polygon filter); with
SearchOnAreaSelected = True the AreaSearchQuery runs automatically.
Map.AreaShape := masPolygon; // masRectangle, masCircle
Map.StartAreaSelection; // or the "select area" button
// ...
procedure TForm1.MapAreaSelected(Sender: TObject; const Area: TMapArea);
begin
Map.SearchInArea('hydraulik'); // results -> OnSearchResults
end;
10. TEditMap – appearance of the 3D map
Edit / Edit3D inheritance (like InfoWindow):
Edit=TEditMapRaster(2D/raster, Areas popup);Edit3D=TEditMap/TEdit3DMap(3D + terrain). Properties:TileMap.Edit,Map3D.Edit3D(aliasEditMap),Areas.Edit,Terrain.Edit3D. Seedocs/TEDIT_INHERITANCE_REQUIREMENTS.md.
TEditMap (the name TEdit3DMap works in code too) holds appearance changes of the 111 style
layers: colour, opacity, visibility, line width and per-zoom values. Changes are applied live on
every linked map (T3DMapVCL.EditMap, T3DMapFMX.EditMap) and again after every style load and
page reload.
- editing:
SetColor,SetPaintColor,SetOpacity,SetVisible,SetWidth,SetZoomStops,SetValueJSON,SetCategoryColor,SetCategoryVisible; readingGet*; BeginUpdate/EndUpdate– several changes as one undo step;Undo,Redo,CanUndo,CanRedo,UndoLimit;RestoreDefaults– back toDefaultSettingsFile(if valid) or the factory look; undoable, raisesOnRestoreDefaults;- files:
SettingsFile(loaded at start whenAutoLoad = True),LoadFromFile,SaveToFile,LoadFromJSON,SaveToJSON,ShowOpenDialog,ShowSaveDialog; - server:
SaveToServer(Name, Password)(base style + changes →styles_api.php),LoadFromServer; - editor window:
ShowEditor(category/layer tree, colour, opacity, width, visibility, Undo/Redo, Przywróć domyślne = restore defaults, load/save JSON).
In the IDE SettingsFile and DefaultSettingsFile have a "…" button with a *.json dialog;
double-click opens the editor, the context menu has "Przywróć domyślne". Settings are not stored
in the DFM – the editor offers to save them to SettingsFile.
An invalid file (bad JSON, unknown layer, bad colour, opacity outside 0..1) is not applied; the
error list goes to OnValidationError and LastErrors.
// T3DMapVCL1.EditMap := EditMap1 (automatic at design time)
EditMap1.SetColor('water', '#1a3a6b');
EditMap1.BeginUpdate; // one undo step
try
EditMap1.SetColor('road_trunk_primary', '#ff9800');
EditMap1.SetWidth('road_trunk_primary', 6);
EditMap1.SetOpacity('road_trunk_primary', 0.9);
finally
EditMap1.EndUpdate;
end;
EditMap1.SetCategoryVisible('etykiety', False);
EditMap1.Undo;
EditMap1.RestoreDefaults; // undoable, OnRestoreDefaults
EditMap1.SaveToFile('map-settings.json');
EditMap1.ShowEditor; // window: tree, colour, opacity, width, undo/redo
EditMap1.SaveToServer('moj-styl', Password); // asynchronous, OnSaved
// later, in any application:
T3DMapVCL1.ServerStyleName := 'moj-styl';
T3DMapVCL1.Style := m3sServerStyle;
procedure TForm1.EditMap1ValidationError(Sender: TObject; const Source: string; Errors: TStrings);
begin
Memo1.Lines.Add('Plik ustawień odrzucony (' + Source + '):');
Memo1.Lines.AddStrings(Errors); // e.g. "layers.water.color: not a colour"
end;
Layer categories (SetCategoryColor, SetCategoryVisible): tlo (background), teren (land use),
zielen (green), woda (water), lotniska (airports), tunele (tunnels), drogi (roads),
mosty (bridges), kolej (rail), budynki (buildings), obiekty (facilities), granice
(boundaries), poi, etykiety (labels), inne (other). Names and descriptions of all 111 layers:
MapCommon.LayerInfo (MAP_LAYER_CATEGORIES, MAP_LAYERS).
11. TMapAreas – world, continents, countries
Area edit on the map (RMB / long-press): right-click and, on mobile, long-press (~500 ms, cancelled on move) open the same feature style editor: fill colour, border colour/width, editable centre label (colour, font size). Property EditPopupEnabled (default True) disables that popup — then neither RMB nor long-press opens it. Page bridge command: setAreasEditEnabled ({"enabled":false}).
Areas1.EditPopupEnabled := False; // disable edit popup (e.g. read-only mode)
Areas1.EditPopupEnabled := True; // RMB + long-press open the editor again
Requirement (2026-10-05): after selecting a country on the list, its administrative units appear (e.g. voivodeships in Poland, US states; similarly for other countries).
TMapAreas shows GeoJSON areas on every linked map (Areas). Selection is hierarchical:
WholeWorld = True → whole world: countries.geojson (258 countries)
(WorldDetail = mwdProvinces → admin-1 regions of the world)
WholeWorld = False
Continents = [ ... ] → one *_full.geojson file per checked continent,
with country outlines and regions (ShowCountryOutlines / ShowRegions)
Countries = 'PL,DE,CZ' → optional country filter (ISO alpha-2 or alpha-3);
with an empty Continents the continents follow from the countries
Continents is a set (TMapAreaContinents) – in the Object Inspector every continent has its own
check box, and the "…" button opens the World › continents › countries tree with check boxes
(the same window opens from "…" at Countries and by double-clicking the component). Checking a
continent checks all its countries; checking only some countries stores them in Countries.
The continents (TMapAreaContinent) match the files on the server – hence a separate Central
America and no Antarctica (it is only in the world file, WholeWorld). The TMapContinent enum
(mcAuto, mcEurope …) in MapCommon.Types is for search routing, not for area files.
Files on the server – https://mapa.imetroll.com/geojson/ (version in versiongeojson.json, updated 2026-07-28):
| File | Size | Contents | Used by |
|---|---|---|---|
countries.geojson |
14,643,643 B | 258 countries of the world | WholeWorld, mwdCountries |
ne_10m_admin_1_states_provinces.geojson |
40,726,851 B | admin-1 regions of the world (Natural Earth) | WholeWorld, mwdProvinces |
europe_full.geojson |
33,763,583 B | Europe: countries + regions | macEurope |
africa_full.geojson |
21,513,435 B | Africa | macAfrica |
asia_full.geojson |
53,755,155 B | Asia | macAsia |
north_america_full.geojson |
23,195,198 B | North America | macNorthAmerica |
central_america_full.geojson |
3,939,342 B | Central America | macCentralAmerica |
south_america_full.geojson |
15,000,687 B | South America | macSouthAmerica |
oceania_full.geojson |
6,261,526 B | Australia and Oceania | macOceania |
Delphi downloads the files (background thread, Timeout), stores them in CacheFolder (default
<cache>\MapComponents\geojson) and refreshes them when versiongeojson.json changes
(CheckVersion). Offline, the cached copy is used. Data goes to the page in 256 KB chunks, so the
server needs no CORS.
MapAreas1.WholeWorld := True; // countries.geojson (258 countries)
MapAreas1.WorldDetail := mwdCountries; // mwdProvinces = admin-1 regions of the world
MapAreas1.WholeWorld := False;
MapAreas1.Continents := [macEurope, macAfrica]; // europe_full + africa_full
MapAreas1.ShowCountryOutlines := True;
MapAreas1.ShowRegions := True; // admin-1 regions inside the countries
MapAreas1.BeginUpdate; // one reload
try
MapAreas1.Continents := []; // derived from the countries
MapAreas1.Countries := 'PL,CZ,SK';
finally
MapAreas1.EndUpdate;
end;
MapAreas1.ShowCountry('PL'); // filter + zoom
Events: OnAreaClick / OnAreaHover (HoverEvents) with the ISO country code, name and all feature
properties, OnAreaLoaded (feature count or error), OnValidationError (e.g. unknown country code,
a file that is not GeoJSON, swapped coordinates).
procedure TForm1.MapAreas1AreaClick(Sender: TObject; const SetId: string;
const Lat, Lon: Double; const CountryISO2, FeatureName, PropertiesJSON: string);
begin
Caption := FeatureName + ' (' + CountryISO2 + ')';
end;
Own files: the Items collection (path or URL, Countries, Style) and LoadFromFile,
LoadFromURL, LoadFromString; hierarchy look – HierarchyStyle (CSS colours, opacity, line width
and style, hover, labels LabelProperty e.g. name_pl, zoom range).
Item := MapAreas1.LoadFromFile('C:\dane\strefy.geojson', 'Strefy dostaw');
Item.Style.FillColor := '#2e7d32';
Item.Style.FillOpacity := 0.2;
MapAreas1.FitToArea(Item);
Administrative boundaries (ShowAdministrative + AdminLevel)
On the map server (https://mapa.imetroll.com/geojson/):
| Level | Source | File |
|---|---|---|
| admin-0 (countries) | Natural Earth | countries.geojson |
| admin-1 (states / provinces / voivodeships) | Natural Earth | ne_10m_admin_1_states_provinces.geojson and continent *_full.geojson |
| admin-2 (counties / powiaty) | not on the map server | per-country GeoJSON from geoBoundaries (CC BY 4.0) |
Areas1.ShowAdministrative := True;
Areas1.AdminLevel := malAdmin1;
Areas1.Countries := 'PL'; // Poland -> 16 voivodeships
Areas1.ShowAdministrativeCountry('PL', malAdmin1);
Per-level style: CountryStyle, Admin1Style, Admin2Style.
Country + borders inside: with AdminLevel = malAdmin1 (and malAdmin2) the map shows the country outline
(CountryStyle, drawn on top, at least 1 px wider) and the admin unit borders inside it (Admin1Style: own
colour / width / LineStyle). Every voivodeship is its own area (hover, OnAreaClick); the country outline that
contains units does not cover them with its fill or hit-test. Zoom ladder = the styles' MinZoom/MaxZoom windows
(the same ones TWeather uses): outside the Admin1Style window only the country is shown / selectable, inside it the
voivodeships.
Areas1.ShowAdministrativeCountry('PL'); // Poland + 16 voivodeships
Areas1.CountryStyle.LineColor := '#1A237E'; // country outline
Areas1.Admin1Style.LineColor := '#7E57C2'; // voivodeship borders
Areas1.Admin1Style.MinZoom := 3.5; // below 3.5: country only
Persisting editor settings (SettingsFile / AutoSave / AutoLoad)
JSON format map-areas-settings v1 (same idea as TEditMap). The HTML page also
mirrors set options into localStorage. A server/DB endpoint is optional (same
pattern as TEditMap.SaveToServer).
12. TEditMapRaster – raster tiles {#editmapraster}
Links to TTileMapVCL / TTileMapFMX via Map (FreeNotification + AutoDetect).
- Pixel editing (
PaintMode): paint / crop / opacity on the tile canvas; results go to IndexedDB and an SQLite MBTiles-like store (modifiedflag). - Optional proxy:
tools/server/tile_proxy.py(or.php) — not deployed with the packages; seetools/server/README.md(OSM policy; do not proxy Google/Apple). The upstream URL and API key stay on the server (TILE_UPSTREAM,TILE_APIKEY); uploading edited tiles requiresTILE_TOKEN. WithProxyURLset, tiles are requested as<ProxyURL>/tile/{z}/{x}/{y}.png. - Styling: CSS filter + MapLibre raster paint + optional colour map; built-ins
neutral,google-like,apple-like,night+ custom JSON; switch at runtime without reload.ApiKeyis appended through{apikey}inUrlTemplate.RefreshTile(z,x,y)busts caches.
13. DEM terrain and elevation (T3DTerrain / T3DMap.Terrain) {#terrain}
Palette component T3DTerrain (MapCommon.Terrain, RT package, Maps palette) and the
nested Terrain property on T3DMapVCL / T3DMapFMX (MapLibre raster-dem + setTerrain)
show real elevation in metres above sea level worldwide. With Enabled the 3D map rises
with the DEM; “Show heights” (ShowElevation) reads elevation under the cursor / click
(OnElevation) and can mark spots (ShowElevationSpots). Satellite hybrid
m3sSatelliteHybrid on 3D maps is kept.
T3DTerrain – linking (auto-link)
| Property | Meaning |
|---|---|
Map |
T3DMapVCL / T3DMapFMX (auto-link) |
EditMap |
optional TEditMap (auto-link) |
AutoLinkComponents |
default True – fills empty Map / EditMap from the form |
Enabled |
turns terrain on the linked map (auto-True when Map is associated) |
Exaggeration |
vertical scale (default 1.3) |
SourceURL |
DEM source (default MAP_DEM_DEFAULT_URL) |
Encoding |
mteTerrarium / mteMapbox |
ShowElevation |
“Show heights” (default True on T3DTerrain) |
ShowElevationLabels |
“▲ N m a.s.l.” labels (independent of contours) |
ShowContourLines |
contour / height lines (independent of labels) |
ShowHillshade |
hillshade (highlights slopes) |
ShowObjectElevation |
building/POI: ground + object height + roof m a.s.l. |
ContourIntervalM / ContourColor / ContourWidth |
contour density and look |
TileBuffer |
XYZ prefetch ring (set 0 for pmtiles://) |
OnElevation / OnObjectElevation |
click: ground / object elevation |
When T3DTerrain is linked to a 3D map (and optionally TEditMap), 3D terrain turns on
automatically (Enabled := True + ApplyToMap). Nested T3DMap*.Terrain still works
without a separate component.
Standalone view: T3DTerrainVCL / T3DTerrainFMX (Maps palette) are 3D maps with terrain
defaults (EditSubjectKind = eskTerrain) — TEditMap can attach without a separate T3DMap*.
With both on the form, one TEditMap is enough: EditSubject switches map-layer editing
(eskMapLayers) vs terrain options (eskTerrain); SetTerrainContourLines /
SetTerrainElevationLabels / SetTerrainHillshade / SetTerrainObjectElevation toggle
overlays independently (labels only, lines only, both, or neither).
Elevation labels and contours are independent. Buildings and POIs stay on the DEM; with
ShowObjectElevation a click reports ground / object height / roof (OnObjectElevation).
DEM source (Mapterhorn planet.pmtiles)
Default (MAP_DEM_DEFAULT_URL):
pmtiles://https://mapa.imetroll.com/terrain/planet.pmtiles
Mapterhorn archive (~331 GB, WebP 512 px, Terrarium, zoom 0–12), served with CORS
and Range. MapLibre loads it as raster-dem via pmtiles:// (source url:, without
appending /{z}/{x}/{y}). PMTiles JS (MAP_DEFAULT_PMTILES_JS / PMTilesJSURL) is injected
automatically when SourceURL starts with pmtiles://.
- Tiles up to zoom ≤ 12 –
planet.pmtiles(worldwide); above that MapLibre overzooms z12. - Higher zooms – regional
6-x-y.pmtilesfrom the same Mapterhorn set. TileBufferis for http(s) XYZ; withpmtiles://set it to0.
{ Preferred: palette component (auto-link + auto-enable) }
Terrain1.Map := Map3D;
Terrain1.EditMap := EditMap1;
Terrain1.Exaggeration := 1.5;
Terrain1.ShowElevation := True;
{ Or nested map property: }
Map3D.Terrain.SourceURL := MAP_DEM_DEFAULT_URL; // no /{z}/{x}/{y}
Map3D.Terrain.Enabled := True;
Help page: T3DTerrain.
Live HTML demo: help.imetroll.com/demo/t3dterrain.html — the same map page the component uses, with Exaggeration / labels / contours / hillshade / object-elevation toggles and Tatras–Alps–Himalayas fly-tos.
Delphi demos: Demo3DTerritoryVCL, Demo3DTerritoryFMX.
13a. TWeather – weather middleware
TWeather is middleware only (not a chart module): builds GET to
https://weather.imetroll.com/v1/forecast, appends key=, returns JSON via
OnDataReady(JSON) / DataJSON. Require ApiKey. Fields include UV, wind speed+direction,
feels-like, and insolation (sunshine_duration [s], shortwave_radiation [W/m²]).
Map.WeatherInfo gates rendering; Display has icon+temp labels, DensityMode
(admin = one widget per admin unit at polygon centroid; temp = sample mean;
area icon is NOT a naive mean of WMO codes — binary states as powers of two
(WBS_CLEAR=1, WBS_SUN=2, WBS_CLOUDS=4, WBS_RAIN=8), sum votes in the polygon
(AreaBinaryVotes.SumBits), WinningBit assigns the icon;
grid = MaxPoints/PointsPerAdmin; auto by zoom: country→admin1 count, zoom-in→denser,
place→1), LabelDensity thin 0/1/2, WidgetStyle, CreateWidget / CreateWidgetsForAreas,
WeatherClickMode ladder, motion, ScaleFactor/MinScreenWidth, custom PNGs.
Roadmap 2c: precip/cloud gradients on 2D tiles; live 3D clouds + rain.
Votes := Weather1.Data.AreaBinaryVotes;
Icon := WeatherBinaryStateIcon(Votes.WinningBit, True,
Weather1.Data.AverageCurrent(wpTemperature2m));
// AverageCurrent(wpWeatherCode) = winning-bit WMO (0/1/3/61), not mean(codes)
13b. TWeatherScene – weather app background animation
TWeatherScene (MapCommon.Weather.Scene, Maps palette) is a light background scene (day/night, clouds, rain, sun, wind, stars) behind info panels. It is not a map and does not call the weather server.
| Link | Description |
|---|---|
| TWeather → Scene | Weather.Scene / Scene.Weather (AutoLink). On OnDataReady, Scene runs ApplyJSON. |
| Manual | ApplyJSON(Weather.DataJSON) / ApplyFromWeather. |
| Host | Panel / TImage / IWeatherSceneHost receives SceneJSON via OnStateChanged. |
Presets: wspAuto … wspNightCloudy. Options: Animated, ShowStarsAtNight, IntensityScale, SoftClouds.
Properties: Weather, Host, AutoLinkComponents, Active, Preset, Options, IsDay, CloudCover, PrecipIntensity, WindDirectionDeg, WindSpeedMs, SunVisible, StarsVisible, Overcast.
Public: LastSceneJSON, SceneJSON, ApplyJSON, ApplyFromWeather, RefreshHost, Clear, DetectLinkedComponents.
Events: OnStateChanged.
Link: Weather.Scene ↔ Scene.Weather (Scene never calls the weather server).
UI family (AutoLink to TWeather only)
Drop next to TWeather — they register via RegisterLinkedView and fill on OnDataReady (no GET):
| Component | Role |
|---|---|
TWeatherScene |
Background animation; Labels (caption, colours, fonts) |
TWeatherHourStrip |
Hourly WMO icons + temp; Style; built-in/custom icons |
TWeatherDayItems |
~7-day tiles |
TWeatherChart |
Chart with Series[] (Title/legend, Parameter, line/bar), ShowLegend, axis ticks, X/YValueFormat, points (ShowPoints, PointColor, PointOpacity, PointStyle filled/hollow) |
Demo: https://help.imetroll.com/demo/tweather-area-popup.html
14. Reference
Tables are generated from the same spec as the code (tools/gen_components.py).
14.1 Common properties (all four maps)
| Property | Type | Default | Description |
|---|---|---|---|
CenterLat |
Double |
– | Map centre latitude (start / current) |
CenterLon |
Double |
– | Map centre longitude |
Zoom |
Double |
– | Zoom 0..22 |
Pitch |
Double |
– | Tilt in degrees |
Bearing |
Double |
– | Rotation in degrees |
Language |
string |
– | Label language (pl, en, de …) |
ShowScale |
Boolean |
True |
Scale bar (applied on page load) |
ShowNavigationControl |
Boolean |
False |
MapLibre zoom/compass control next to the button panel |
LoadingText |
string |
– | Text shown while loading |
AllowPopupHTML |
Boolean |
False |
False = popups are plain text (XSS-safe) |
ZeroLat |
Double |
– | Zero point latitude (default Warsaw 52.2297) |
ZeroLon |
Double |
– | Zero point longitude (default 21.0122) |
ZeroPointVisible |
Boolean |
False |
Draw the zero-point marker |
ZeroTitle |
string |
– | Tooltip of the zero-point marker |
ZeroIconWidth |
Integer |
24 |
ZeroIcon width (px) |
ZeroIconHeight |
Integer |
24 |
ZeroIcon height (px) |
HomeUsesZeroPoint |
Boolean |
True |
Home button flies to the zero point |
HomeLat |
Double |
– | Home target when HomeUsesZeroPoint = False |
HomeLon |
Double |
– | same – longitude |
HomeZoom |
Double |
– | Zoom after Home |
MainMarkerSource |
TMapMainMarkerSource |
mmsZeroPoint |
mmsZeroPoint / mmsManual / mmsDeviceLocation (falls back to the zero point) |
MainMarkerVisible |
Boolean |
True |
Main marker visible |
MainMarkerLat |
Double |
– | Position with mmsManual – latitude |
MainMarkerLon |
Double |
– | Position with mmsManual – longitude |
MainMarkerSize |
Integer |
18 |
Dot size without icon, px |
MainMarkerSquare |
Boolean |
False |
Square instead of a circle |
MainMarkerBorderWidth |
Integer |
3 |
Border width |
MainMarkerBorderDashed |
Boolean |
False |
Dashed border |
MainMarkerOpacity |
Double |
– | Opacity 0..1 |
MainMarkerTitle |
string |
– | Tooltip |
MainMarkerDraggable |
Boolean |
False |
User can drag it (OnMainMarkerMoved) |
MainMarkerIconWidth |
Integer |
32 |
MainMarkerIcon width |
MainMarkerIconHeight |
Integer |
32 |
MainMarkerIcon height |
MainMarkerIconScale |
Double |
– | Icon scale |
PulseEnabled |
Boolean |
True |
Pulsing ring |
PulseDurationMs |
Integer |
1800 |
Duration of one pulse (ms) |
LocationTimeoutMs |
Integer |
5000 |
Location sensor timeout |
RadiusVisible |
Boolean |
False |
Radius circle |
RadiusMeters |
Double |
– | Radius in metres |
RadiusCenter |
TMapRadiusCenter |
rcMainMarker |
rcMainMarker / rcZeroPoint / rcManual |
RadiusLat |
Double |
– | Centre with rcManual – latitude |
RadiusLon |
Double |
– | Centre with rcManual – longitude |
RadiusFillOpacity |
Double |
– | Fill opacity 0..1 |
RadiusLineOpacity |
Double |
– | Outline opacity 0..1 |
RadiusLineWidth |
Double |
– | Outline width px (0 = none) |
RadiusLineStyle |
TMapLineStyle |
mlsSolid |
mlsSolid / mlsDashed / mlsDotted |
RadiusLabel |
string |
– | Text in the centre, e.g. "2 km" |
NavVisible |
Boolean |
True |
Navigation button panel |
NavPosition |
TMapButtonPanelPosition |
bppTopLeft |
Panel corner |
NavOrientation |
TMapButtonPanelOrientation |
bpoVertical |
Vertical / horizontal |
NavButtonSize |
Integer |
36 |
Button size px |
SearchPlaceholder |
string |
– | Search box placeholder |
SearchNoResultsText |
string |
– | "No results" text |
SearchSearchingText |
string |
– | "Searching…" text |
SearchMinChars |
Integer |
3 |
Minimum characters |
SearchLive |
Boolean |
False |
Search while typing (mind provider limits!) |
SearchShowDistance |
Boolean |
True |
Distance from the main marker in results |
SearchUseArea |
Boolean |
True |
Search box searches inside the selected area |
SearchProviderURL |
string |
– | Fallback Nominatim URL when SearchProvider is empty |
SearchToken |
string |
– | Token – NEVER in the DFM, set in code |
AreaShape |
TMapAreaShape |
masRectangle |
Shape of the Select-area button |
AreaFillOpacity |
Double |
– | Area fill opacity |
SearchOnAreaSelected |
Boolean |
False |
Run AreaSearchQuery after selection |
AreaSearchQuery |
string |
– | e.g. "restaurant", "plumber" |
BoundariesURL |
string |
– | Vector tiles / TileJSON / PMTiles with boundaries (data source, not a style) |
BoundariesKind |
TMapBoundariesKind |
mbkVectorTiles |
mbkVectorTiles / mbkTileJSON / mbkPMTiles |
BoundariesSourceLayer |
string |
– | Source layer |
BoundariesVisible |
Boolean |
False |
Show boundaries |
Also: MainMarkerIcon, ZeroIcon (TPicture / TBitmap), NavButtons, SearchProvider, Areas,
AutoLinkComponents; VCL: WebView2UserDataFolder, WebView2BrowserFolder, DevToolsEnabled,
OpenLinksExternally; FMX: BridgeTransport.
14.2 Colours
| Property | VCL (TColor) | FMX (TAlphaColor) | Description |
|---|---|---|---|
MainMarkerColor |
$00E5881E |
$FF1E88E5 |
Main marker colour |
MainMarkerBorderColor |
clWhite |
$FFFFFFFF |
Border colour |
PulseColor |
$00E5881E |
$FF1E88E5 |
Pulse colour |
RadiusColor |
$000080FF |
$FFFF8000 |
Radius fill colour |
RadiusLineColor |
clNone |
$00000000 |
Outline colour (clNone = RadiusColor) |
AreaColor |
$00E8731A |
$FF1A73E8 |
Selection area colour |
BoundariesColor |
$00B83D7A |
$FF7A3DB8 |
Boundaries colour |
14.3 3D maps only
| Property | Type | Default | Description |
|---|---|---|---|
Mode |
TMapMode |
mm2D |
mm2D / mm3D |
Pitch3D |
Double |
– | Pitch used in 3D mode |
Theme |
TMapTheme |
mtDay |
mtDay / mtNight |
Buildings3D |
Boolean |
True |
Extruded buildings in 3D |
ServerStyleName |
string |
– | Name of a style saved on the server (Style = m3sServerStyle) |
BaseRasterOpacity |
Double |
– | Opacity of the satellite / terrain background of hybrid styles |
Plus Style: TMap3DStyle and EditMap: TEditMap. Tile maps have Style: TTileMapStyle.
14.4 Public properties (code only)
CustomTileURL, CustomAttribution, CustomTileMaxZoom (tiles), CustomStyleURL (3D),
Core, Browser, IsMapReady, View, MarkerCount, LastResults, Area, HasArea.
14.5 Events
| Event | Type | Description |
|---|---|---|
OnMapReady |
TNotifyEvent |
Page and style ready |
OnMapClick |
TMapClickEvent |
Click (Lat, Lon) |
OnMarkerClick |
TMapMarkerClickEvent |
Marker click (Id) |
OnZoomChanged |
TMapZoomChangedEvent |
Zoom changed |
OnMoveEnd |
TMapMoveEndEvent |
Move ended (View) |
OnSearchResults |
TMapSearchResultsEvent |
Search results |
OnSearchError |
TMapSearchErrorEvent |
Search error (ErrorKind pek*, HTTP, PL/EN message) |
OnSearchResultSelected |
TMapSearchResultSelectedEvent |
Result picked in the search box |
OnJSError |
TMapJSErrorEvent |
Page / WebView2 / bridge error |
OnStyleLoaded |
TNotifyEvent |
Style loaded |
OnAreaSelected |
TMapAreaSelectedEvent |
Area selected (rectangle/polygon/circle) |
OnNavButtonClick |
TMapNavButtonClickEvent |
Panel button clicked (Kind) |
OnLocation |
TMapLocationEvent |
Device location result |
OnMainMarkerMoved |
TMapClickEvent |
Main marker dragged |
3D maps only:
| Event | Type | Description |
|---|---|---|
OnStyleJSON |
TMapStyleJSONEvent |
Answer of RequestStyleJSON |
OnStyleSaved |
TMapStyleSavedEvent |
SaveStyleJSON finished |
OnModeChanged |
TNotifyEvent |
2D/3D switched |
OnElevation |
TMapElevationEvent |
14.6 Methods
| Method |
|---|
procedure ExecuteJS(const Script: string); |
procedure RequestJSON(const Cmd, ArgsJSON: string; const Handler: TMapResultProc); |
procedure SetView(const Lat, Lon, AZoom: Double; Animate: Boolean = False); |
procedure FlyTo(const Lat, Lon: Double; const AZoom: Double = -1; DurationMs: Integer = 1500); |
procedure FitBounds(const South, West, North, East: Double; PaddingPx: Integer = 40; const MaxZoom: Double = 17); |
procedure FitMarkers(PaddingPx: Integer = 50; const MaxZoom: Double = 16; IncludeMainMarker: Boolean = False); |
procedure SetInteractive(Enabled: Boolean); |
procedure GoHome; |
procedure SetZeroPoint(const Lat, Lon: Double); |
procedure AddMarkerCSS(const Id: string; const Lat, Lon: Double; const CSSColor: string; const Title: string = ''; const PopupText: string = ''; const PopupHTML: string = ''); |
procedure RemoveMarker(const Id: string); |
procedure ClearMarkers; |
function HasMarker(const Id: string): Boolean; |
function TryGetMarker(const Id: string; out Marker: TMapMarker): Boolean; |
procedure OpenMarkerPopup(const Id: string); |
procedure SetMainMarker(const Lat, Lon: Double; Visible: Boolean = True); |
procedure UpdateMyLocation; |
procedure ShowRadius(const Meters: Double; const LabelText: string = ''); |
procedure ClearRadius; |
function MainMarkerDistanceFromZero: Double; |
function MainMarkerBearingFromZero: Double; |
procedure MainMarkerPixelOffsetFromZero(Zoom: Integer; out DX, DY: Double); |
function DistanceFromMainMarker(const Lat, Lon: Double): Double; |
procedure StartAreaSelection; overload; |
procedure StartAreaSelection(Shape: TMapAreaShape); overload; |
procedure CancelAreaSelection; |
procedure SetArea(const Area: TMapArea); |
procedure ClearArea; |
procedure ShowSearchBox(Show: Boolean = True; const Query: string = ''); |
procedure SearchAddress(const Query: string); |
procedure SearchStructured(const Q: TNominatimStructuredQuery); |
procedure SearchInArea(const Query: string); overload; |
procedure SearchInArea(const Query: string; const Area: TMapArea); overload; |
procedure ReverseGeocode(const Lat, Lon: Double; Zoom: Integer = 18); |
procedure LookupOsmIds(const OsmIds: string); |
procedure CheckSearchConnection; |
procedure NextStyle; |
procedure SetRasterEdit(const ArgsJSON: string); |
procedure RefreshTile(Z, X, Y: Integer); |
3D maps only:
| Method |
|---|
procedure Set2D; |
procedure Set3D; |
procedure ToggleMode; |
procedure LoadStyleJSON(const StyleJSON: string); |
procedure LoadStyleJSONFromFile(const FileName: string); |
procedure SaveStyleJSON(const FileName: string); |
procedure RequestStyleJSON; |
procedure SetLayerVisible(const LayerId: string; Visible: Boolean); |
procedure ClearStyleOverrides; |
procedure ShowElevationSpots(const Lats, Lons: array of Double; const Names: array of string); |
procedure ClearElevationSpots; |
procedure QueryElevation(const Lat, Lon: Double; const Callback: TMapResultProc); |
Plus AddMarker(Id, Lat, Lon, Color, Title, PopupText) and AddMarker(Id, Lat, Lon, Icon, …), Reload, DetectLinkedComponents.
14.7 Full API of all components (generated from the code)
The tables below are generated from the declarations in Source/*.pas (tools/api_ref.py) – every published property and event (inherited ones included), public properties and public methods.
TTileMapVCL (MapCommon.MapVCL)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Align |
(inherited) |
Standard VCL control property | |
Anchors |
(inherited) |
Standard VCL control property | |
Constraints |
(inherited) |
Standard VCL control property | |
Margins |
(inherited) |
Standard VCL control property | |
AlignWithMargins |
(inherited) |
Standard VCL control property | |
Padding |
(inherited) |
Standard VCL control property | |
TabOrder |
(inherited) |
Standard VCL control property | |
TabStop |
(inherited) |
Standard VCL control property | |
Visible |
(inherited) |
Standard VCL control property | |
Enabled |
(inherited) |
Standard VCL control property | |
Color |
(inherited) |
$00DCE4E8 |
Standard VCL control property |
ParentBackground |
(inherited) |
False |
Standard VCL control property |
Style |
TTileMapStyle |
tmsOpenStreetMap |
Map style (enum): OSM / satellite / terrain / custom tiles (TTileMap) or vector style (T3DMap) |
CenterLat |
(inherited) |
Map centre latitude (start / current) | |
CenterLon |
(inherited) |
Map centre longitude | |
Zoom |
(inherited) |
Zoom 0..22 | |
Pitch |
(inherited) |
Tilt in degrees | |
Bearing |
(inherited) |
Rotation in degrees | |
Language |
(inherited) |
Label language (pl, en, de …) | |
ShowScale |
(inherited) |
Scale bar (applied on page load) | |
ShowNavigationControl |
(inherited) |
MapLibre zoom/compass control next to the button panel | |
LoadingText |
(inherited) |
Text shown while loading | |
AllowPopupHTML |
(inherited) |
False = popups are plain text (XSS-safe) | |
ZeroLat |
(inherited) |
Zero point latitude (default Warsaw 52.2297) | |
ZeroLon |
(inherited) |
Zero point longitude (default 21.0122) | |
ZeroPointVisible |
(inherited) |
Draw the zero-point marker | |
ZeroTitle |
(inherited) |
Tooltip of the zero-point marker | |
ZeroIconWidth |
(inherited) |
ZeroIcon width (px) | |
ZeroIconHeight |
(inherited) |
ZeroIcon height (px) | |
HomeUsesZeroPoint |
(inherited) |
Home button flies to the zero point | |
HomeLat |
(inherited) |
Home target when HomeUsesZeroPoint = False | |
HomeLon |
(inherited) |
same – longitude | |
HomeZoom |
(inherited) |
Zoom after Home | |
MainMarkerSource |
(inherited) |
mmsZeroPoint / mmsManual / mmsDeviceLocation (falls back to the zero point) | |
MainMarkerVisible |
(inherited) |
Main marker visible | |
MainMarkerLat |
(inherited) |
Position with mmsManual – latitude | |
MainMarkerLon |
(inherited) |
Position with mmsManual – longitude | |
MainMarkerSize |
(inherited) |
Dot size without icon, px | |
MainMarkerSquare |
(inherited) |
Square instead of a circle | |
MainMarkerBorderWidth |
(inherited) |
Border width | |
MainMarkerBorderDashed |
(inherited) |
Dashed border | |
MainMarkerOpacity |
(inherited) |
Opacity 0..1 | |
MainMarkerTitle |
(inherited) |
Tooltip | |
MainMarkerDraggable |
(inherited) |
User can drag it (OnMainMarkerMoved) | |
MainMarkerIconWidth |
(inherited) |
MainMarkerIcon width | |
MainMarkerIconHeight |
(inherited) |
MainMarkerIcon height | |
MainMarkerIconScale |
(inherited) |
Icon scale | |
PulseEnabled |
(inherited) |
Pulsing ring | |
PulseDurationMs |
(inherited) |
Duration of one pulse (ms) | |
LocationTimeoutMs |
(inherited) |
Location sensor timeout | |
RadiusVisible |
(inherited) |
Radius circle | |
RadiusMeters |
(inherited) |
Radius in metres | |
RadiusCenter |
(inherited) |
rcMainMarker / rcZeroPoint / rcManual | |
RadiusLat |
(inherited) |
Centre with rcManual – latitude | |
RadiusLon |
(inherited) |
Centre with rcManual – longitude | |
RadiusFillOpacity |
(inherited) |
Fill opacity 0..1 | |
RadiusLineOpacity |
(inherited) |
Outline opacity 0..1 | |
RadiusLineWidth |
(inherited) |
Outline width px (0 = none) | |
RadiusLineStyle |
(inherited) |
mlsSolid / mlsDashed / mlsDotted | |
RadiusLabel |
(inherited) |
Text in the centre, e.g. "2 km" | |
NavVisible |
(inherited) |
Navigation button panel | |
NavPosition |
(inherited) |
Panel corner | |
NavOrientation |
(inherited) |
Vertical / horizontal | |
NavButtonSize |
(inherited) |
Button size px | |
SearchPlaceholder |
(inherited) |
Search box placeholder | |
SearchNoResultsText |
(inherited) |
"No results" text | |
SearchSearchingText |
(inherited) |
"Searching…" text | |
SearchMinChars |
(inherited) |
Minimum characters | |
SearchLive |
(inherited) |
Search while typing (mind provider limits!) | |
SearchShowDistance |
(inherited) |
Distance from the main marker in results | |
SearchUseArea |
(inherited) |
Search box searches inside the selected area | |
SearchProviderURL |
(inherited) |
Fallback Nominatim URL when SearchProvider is empty | |
SearchToken |
(inherited) |
Token – NEVER in the DFM, set in code | |
AreaShape |
(inherited) |
Shape of the Select-area button | |
AreaFillOpacity |
(inherited) |
Area fill opacity | |
SearchOnAreaSelected |
(inherited) |
Run AreaSearchQuery after selection | |
AreaSearchQuery |
(inherited) |
e.g. "restaurant", "plumber" | |
BoundariesURL |
(inherited) |
Vector tiles / TileJSON / PMTiles with boundaries (data source, not a style) | |
BoundariesKind |
(inherited) |
mbkVectorTiles / mbkTileJSON / mbkPMTiles | |
BoundariesSourceLayer |
(inherited) |
Source layer | |
BoundariesVisible |
(inherited) |
Show boundaries | |
MainMarkerColor |
(inherited) |
Main marker colour | |
MainMarkerBorderColor |
(inherited) |
Border colour | |
PulseColor |
(inherited) |
Pulse colour | |
RadiusColor |
(inherited) |
Radius fill colour | |
RadiusLineColor |
(inherited) |
Outline colour (clNone = RadiusColor) | |
AreaColor |
(inherited) |
Selection area colour | |
BoundariesColor |
(inherited) |
Boundaries colour | |
MainMarkerIcon |
(inherited) |
Main marker icon (TPicture / TBitmap, PNG/SVG) | |
ZeroIcon |
(inherited) |
Zero-point icon | |
NavButtons |
(inherited) |
Navigation panel buttons collection (kind, visibility, hint, order) | |
SearchProvider |
(inherited) |
Linked search provider (TNominatimSearchProvider / TCustomUrlSearchProvider) | |
Areas |
(inherited) |
Linked TMapAreas component (boundaries, regions, own GeoJSON) | |
Edit |
(inherited) |
||
Weather |
(inherited) |
||
WeatherInfo |
(inherited) |
||
WeatherClickMode |
(inherited) |
||
WeatherPointModeMinZoom |
(inherited) |
||
Aircraft |
(inherited) |
||
AircraftInfo |
(inherited) |
||
Boats |
(inherited) |
||
BoatsInfo |
(inherited) |
||
AutoLinkComponents |
(inherited) |
Automatically link the first search provider / TMapAreas / TEditMap on the form | |
WebView2UserDataFolder |
(inherited) |
WebView2 user data folder ('' = application data folder) | |
WebView2BrowserFolder |
(inherited) |
WebView2 Fixed Version runtime folder; '' = system runtime | |
DevToolsEnabled |
(inherited) |
Browser developer tools (F12) – debugging only | |
OpenLinksExternally |
(inherited) |
Open popup links in the system browser |
Events
| Event | Type | Description |
|---|---|---|
OnResize |
(inherited) |
Standard VCL control property |
OnMapReady |
(inherited) |
Page and style ready |
OnMapClick |
(inherited) |
Click (Lat, Lon) |
OnMarkerClick |
(inherited) |
Marker click (Id) |
OnZoomChanged |
(inherited) |
Zoom changed |
OnMoveEnd |
(inherited) |
Move ended (View) |
OnSearchResults |
(inherited) |
Search results |
OnSearchError |
(inherited) |
Search error (ErrorKind pek*, HTTP, PL/EN message) |
OnSearchResultSelected |
(inherited) |
Result picked in the search box |
OnJSError |
(inherited) |
Page / WebView2 / bridge error |
OnStyleLoaded |
(inherited) |
Style loaded |
OnAreaSelected |
(inherited) |
Area selected (rectangle/polygon/circle) |
OnNavButtonClick |
(inherited) |
Panel button clicked (Kind) |
OnLocation |
(inherited) |
Device location result |
OnMainMarkerMoved |
(inherited) |
Main marker dragged |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Core |
TMapCore |
Shared map core (TMapCore) – advanced use |
Browser |
TEdgeBrowser |
Internal browser control (TEdgeBrowser / TWebBrowser) |
IsMapReady |
Boolean |
True after OnMapReady |
View |
TMapView |
Current view (centre, zoom, pitch, bearing, bounds) |
MarkerCount |
Integer |
Number of markers |
LastResults |
TMapGeoResults |
Last search results |
Area |
TMapArea |
Selected area (shape, points, rectangle, circle) |
HasArea |
Boolean |
Whether an area is selected |
CustomTileURL |
string |
Code only: tile template {z}/{x}/{y} for Style = tmsCustom |
CustomAttribution |
string |
Attribution of custom tiles |
CustomTileMaxZoom |
Integer |
Max zoom of custom tiles |
Public methods
| Method | Description |
|---|---|
function ResolveUserDataFolder: string |
Returns (and creates) the WebView2 data folder |
procedure Reload |
Reloads the page; the whole state is replayed |
function EffectiveWeatherClickTarget: TWeatherClickTarget |
|
procedure DetectLinkedComponents |
Finds and links a provider / TMapAreas / TEditMap on the form |
function MapCore: TMapCore |
IMapCoreProvider – core for TEditMapRaster |
procedure ExecuteJS(const Script: string) |
Executes JavaScript on the map page |
procedure RequestJSON(const Cmd, ArgsJSON: string; const Handler: TMapResultProc) |
Page command with JSON answer (callback) |
procedure SetView(const Lat, Lon, AZoom: Double; Animate: Boolean = False) |
Sets centre / zoom / pitch / bearing |
procedure FlyTo(const Lat, Lon: Double; const AZoom: Double = -1; DurationMs: Integer = 1500) |
Animated fly-to |
procedure FitBounds(const South, West, North, East: Double; PaddingPx: Integer = 40; const MaxZoom: Double = 17) |
Fit the view to a rectangle |
procedure FitMarkers(PaddingPx: Integer = 50; const MaxZoom: Double = 16; IncludeMainMarker: Boolean = False) |
Fit the view to the markers |
procedure SetInteractive(Enabled: Boolean) |
Enables / disables interaction (pan, zoom) |
procedure GoHome |
Same as the Home button |
procedure SetZeroPoint(const Lat, Lon: Double) |
Sets the zero point |
procedure AddMarkerCSS(const Id: string; const Lat, Lon: Double; const CSSColor: string; const Title: string = ''; const PopupText: string = ''; const PopupHTML: string = '') |
Marker with a CSS colour |
procedure RemoveMarker(const Id: string) |
Removes a marker |
procedure ClearMarkers |
Removes all markers |
function HasMarker(const Id: string): Boolean |
Whether a marker with Id exists |
function TryGetMarker(const Id: string; out Marker: TMapMarker): Boolean |
Reads a marker by Id |
procedure OpenMarkerPopup(const Id: string) |
Opens a marker popup |
procedure SetMainMarker(const Lat, Lon: Double; Visible: Boolean = True) |
Sets the main marker position (mmsManual) |
procedure UpdateMyLocation |
Reads the device location (OnLocation) |
procedure ShowRadius(const Meters: Double; const LabelText: string = '') |
Shows the radius circle |
procedure ClearRadius |
Hides the radius circle |
function MainMarkerDistanceFromZero: Double |
Main marker distance from the zero point (m) |
function MainMarkerBearingFromZero: Double |
Main marker bearing from the zero point |
procedure MainMarkerPixelOffsetFromZero(Zoom: Integer; out DX, DY: Double) |
Pixel offset from the zero point |
function DistanceFromMainMarker(const Lat, Lon: Double): Double |
Distance of a point from the main marker (m) |
procedure StartAreaSelection |
Starts area selection |
procedure CancelAreaSelection |
Cancels area selection |
procedure SetArea(const Area: TMapArea) |
Sets the area from code |
procedure ClearArea |
Clears the area |
procedure ShowSearchBox(Show: Boolean = True; const Query: string = '') |
Shows / hides the search box |
procedure SearchAddress(const Query: string) |
Address search (OnSearchResults) |
procedure SearchStructured(const Q: TNominatimStructuredQuery) |
Structured search (street, city, postcode…) |
procedure SearchInArea(const Query: string) |
Search inside the selected area |
procedure ReverseGeocode(const Lat, Lon: Double; Zoom: Integer = 18) |
Address for coordinates |
procedure LookupOsmIds(const OsmIds: string) |
Lookup by OSM ids |
procedure CheckSearchConnection |
Checks the search server connection |
procedure NextStyle |
Next style (like the Style button) |
procedure SetRasterEdit(const ArgsJSON: string) |
Raster edit / styling settings (used by TEditMapRaster) |
procedure RefreshTile(Z, X, Y: Integer) |
Refreshes tile z/x/y (cache-busting; z < 0 = all) |
TTileMapFMX (MapCommon.MapFMX)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Align |
(inherited) |
Standard FMX control property | |
Anchors |
(inherited) |
Standard FMX control property | |
Margins |
(inherited) |
Standard FMX control property | |
Padding |
(inherited) |
Standard FMX control property | |
Position |
(inherited) |
Standard FMX control property | |
Width |
(inherited) |
Standard FMX control property | |
Height |
(inherited) |
Standard FMX control property | |
Size |
(inherited) |
Standard FMX control property | |
Visible |
(inherited) |
Standard FMX control property | |
Enabled |
(inherited) |
Standard FMX control property | |
Style |
TTileMapStyle |
tmsOpenStreetMap |
Map style (enum): OSM / satellite / terrain / custom tiles (TTileMap) or vector style (T3DMap) |
CenterLat |
(inherited) |
Map centre latitude (start / current) | |
CenterLon |
(inherited) |
Map centre longitude | |
Zoom |
(inherited) |
Zoom 0..22 | |
Pitch |
(inherited) |
Tilt in degrees | |
Bearing |
(inherited) |
Rotation in degrees | |
Language |
(inherited) |
Label language (pl, en, de …) | |
ShowScale |
(inherited) |
Scale bar (applied on page load) | |
ShowNavigationControl |
(inherited) |
MapLibre zoom/compass control next to the button panel | |
LoadingText |
(inherited) |
Text shown while loading | |
AllowPopupHTML |
(inherited) |
False = popups are plain text (XSS-safe) | |
ZeroLat |
(inherited) |
Zero point latitude (default Warsaw 52.2297) | |
ZeroLon |
(inherited) |
Zero point longitude (default 21.0122) | |
ZeroPointVisible |
(inherited) |
Draw the zero-point marker | |
ZeroTitle |
(inherited) |
Tooltip of the zero-point marker | |
ZeroIconWidth |
(inherited) |
ZeroIcon width (px) | |
ZeroIconHeight |
(inherited) |
ZeroIcon height (px) | |
HomeUsesZeroPoint |
(inherited) |
Home button flies to the zero point | |
HomeLat |
(inherited) |
Home target when HomeUsesZeroPoint = False | |
HomeLon |
(inherited) |
same – longitude | |
HomeZoom |
(inherited) |
Zoom after Home | |
MainMarkerSource |
(inherited) |
mmsZeroPoint / mmsManual / mmsDeviceLocation (falls back to the zero point) | |
MainMarkerVisible |
(inherited) |
Main marker visible | |
MainMarkerLat |
(inherited) |
Position with mmsManual – latitude | |
MainMarkerLon |
(inherited) |
Position with mmsManual – longitude | |
MainMarkerSize |
(inherited) |
Dot size without icon, px | |
MainMarkerSquare |
(inherited) |
Square instead of a circle | |
MainMarkerBorderWidth |
(inherited) |
Border width | |
MainMarkerBorderDashed |
(inherited) |
Dashed border | |
MainMarkerOpacity |
(inherited) |
Opacity 0..1 | |
MainMarkerTitle |
(inherited) |
Tooltip | |
MainMarkerDraggable |
(inherited) |
User can drag it (OnMainMarkerMoved) | |
MainMarkerIconWidth |
(inherited) |
MainMarkerIcon width | |
MainMarkerIconHeight |
(inherited) |
MainMarkerIcon height | |
MainMarkerIconScale |
(inherited) |
Icon scale | |
PulseEnabled |
(inherited) |
Pulsing ring | |
PulseDurationMs |
(inherited) |
Duration of one pulse (ms) | |
LocationTimeoutMs |
(inherited) |
Location sensor timeout | |
RadiusVisible |
(inherited) |
Radius circle | |
RadiusMeters |
(inherited) |
Radius in metres | |
RadiusCenter |
(inherited) |
rcMainMarker / rcZeroPoint / rcManual | |
RadiusLat |
(inherited) |
Centre with rcManual – latitude | |
RadiusLon |
(inherited) |
Centre with rcManual – longitude | |
RadiusFillOpacity |
(inherited) |
Fill opacity 0..1 | |
RadiusLineOpacity |
(inherited) |
Outline opacity 0..1 | |
RadiusLineWidth |
(inherited) |
Outline width px (0 = none) | |
RadiusLineStyle |
(inherited) |
mlsSolid / mlsDashed / mlsDotted | |
RadiusLabel |
(inherited) |
Text in the centre, e.g. "2 km" | |
NavVisible |
(inherited) |
Navigation button panel | |
NavPosition |
(inherited) |
Panel corner | |
NavOrientation |
(inherited) |
Vertical / horizontal | |
NavButtonSize |
(inherited) |
Button size px | |
SearchPlaceholder |
(inherited) |
Search box placeholder | |
SearchNoResultsText |
(inherited) |
"No results" text | |
SearchSearchingText |
(inherited) |
"Searching…" text | |
SearchMinChars |
(inherited) |
Minimum characters | |
SearchLive |
(inherited) |
Search while typing (mind provider limits!) | |
SearchShowDistance |
(inherited) |
Distance from the main marker in results | |
SearchUseArea |
(inherited) |
Search box searches inside the selected area | |
SearchProviderURL |
(inherited) |
Fallback Nominatim URL when SearchProvider is empty | |
SearchToken |
(inherited) |
Token – NEVER in the DFM, set in code | |
AreaShape |
(inherited) |
Shape of the Select-area button | |
AreaFillOpacity |
(inherited) |
Area fill opacity | |
SearchOnAreaSelected |
(inherited) |
Run AreaSearchQuery after selection | |
AreaSearchQuery |
(inherited) |
e.g. "restaurant", "plumber" | |
BoundariesURL |
(inherited) |
Vector tiles / TileJSON / PMTiles with boundaries (data source, not a style) | |
BoundariesKind |
(inherited) |
mbkVectorTiles / mbkTileJSON / mbkPMTiles | |
BoundariesSourceLayer |
(inherited) |
Source layer | |
BoundariesVisible |
(inherited) |
Show boundaries | |
MainMarkerColor |
(inherited) |
Main marker colour | |
MainMarkerBorderColor |
(inherited) |
Border colour | |
PulseColor |
(inherited) |
Pulse colour | |
RadiusColor |
(inherited) |
Radius fill colour | |
RadiusLineColor |
(inherited) |
Outline colour (clNone = RadiusColor) | |
AreaColor |
(inherited) |
Selection area colour | |
BoundariesColor |
(inherited) |
Boundaries colour | |
MainMarkerIcon |
(inherited) |
Main marker icon (TPicture / TBitmap, PNG/SVG) | |
ZeroIcon |
(inherited) |
Zero-point icon | |
NavButtons |
(inherited) |
Navigation panel buttons collection (kind, visibility, hint, order) | |
SearchProvider |
(inherited) |
Linked search provider (TNominatimSearchProvider / TCustomUrlSearchProvider) | |
Areas |
(inherited) |
Linked TMapAreas component (boundaries, regions, own GeoJSON) | |
Edit |
(inherited) |
||
Weather |
(inherited) |
||
WeatherInfo |
(inherited) |
||
WeatherClickMode |
(inherited) |
||
WeatherPointModeMinZoom |
(inherited) |
||
Aircraft |
(inherited) |
||
AircraftInfo |
(inherited) |
||
Boats |
(inherited) |
||
BoatsInfo |
(inherited) |
||
AutoLinkComponents |
(inherited) |
Automatically link the first search provider / TMapAreas / TEditMap on the form | |
BridgeTransport |
(inherited) |
Page ↔ Delphi channel: mbtAuto / WebView2 / WebBrowser (FMX) |
Events
| Event | Type | Description |
|---|---|---|
OnResized |
(inherited) |
Standard FMX control property |
OnMapReady |
(inherited) |
Page and style ready |
OnMapClick |
(inherited) |
Click (Lat, Lon) |
OnMarkerClick |
(inherited) |
Marker click (Id) |
OnZoomChanged |
(inherited) |
Zoom changed |
OnMoveEnd |
(inherited) |
Move ended (View) |
OnSearchResults |
(inherited) |
Search results |
OnSearchError |
(inherited) |
Search error (ErrorKind pek*, HTTP, PL/EN message) |
OnSearchResultSelected |
(inherited) |
Result picked in the search box |
OnJSError |
(inherited) |
Page / WebView2 / bridge error |
OnStyleLoaded |
(inherited) |
Style loaded |
OnAreaSelected |
(inherited) |
Area selected (rectangle/polygon/circle) |
OnNavButtonClick |
(inherited) |
Panel button clicked (Kind) |
OnLocation |
(inherited) |
Device location result |
OnMainMarkerMoved |
(inherited) |
Main marker dragged |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Core |
TMapCore |
Shared map core (TMapCore) – advanced use |
Browser |
TWebBrowser |
Internal browser control (TEdgeBrowser / TWebBrowser) |
IsMapReady |
Boolean |
True after OnMapReady |
View |
TMapView |
Current view (centre, zoom, pitch, bearing, bounds) |
MarkerCount |
Integer |
Number of markers |
LastResults |
TMapGeoResults |
Last search results |
Area |
TMapArea |
Selected area (shape, points, rectangle, circle) |
HasArea |
Boolean |
Whether an area is selected |
BridgeMessagesSeen |
Integer |
Received bridge messages counter (diagnostics) |
CustomTileURL |
string |
Code only: tile template {z}/{x}/{y} for Style = tmsCustom |
CustomAttribution |
string |
Attribution of custom tiles |
CustomTileMaxZoom |
Integer |
Max zoom of custom tiles |
Public methods
| Method | Description |
|---|---|
procedure Reload |
Reloads the page; the whole state is replayed |
function EffectiveWeatherClickTarget: TWeatherClickTarget |
|
procedure DetectLinkedComponents |
Finds and links a provider / TMapAreas / TEditMap on the form |
function MapCore: TMapCore |
IMapCoreProvider – core for TEditMapRaster |
procedure ExecuteJS(const Script: string) |
Executes JavaScript on the map page |
procedure RequestJSON(const Cmd, ArgsJSON: string; const Handler: TMapResultProc) |
Page command with JSON answer (callback) |
procedure SetView(const Lat, Lon, AZoom: Double; Animate: Boolean = False) |
Sets centre / zoom / pitch / bearing |
procedure FlyTo(const Lat, Lon: Double; const AZoom: Double = -1; DurationMs: Integer = 1500) |
Animated fly-to |
procedure FitBounds(const South, West, North, East: Double; PaddingPx: Integer = 40; const MaxZoom: Double = 17) |
Fit the view to a rectangle |
procedure FitMarkers(PaddingPx: Integer = 50; const MaxZoom: Double = 16; IncludeMainMarker: Boolean = False) |
Fit the view to the markers |
procedure SetInteractive(Enabled: Boolean) |
Enables / disables interaction (pan, zoom) |
procedure GoHome |
Same as the Home button |
procedure SetZeroPoint(const Lat, Lon: Double) |
Sets the zero point |
procedure AddMarkerCSS(const Id: string; const Lat, Lon: Double; const CSSColor: string; const Title: string = ''; const PopupText: string = ''; const PopupHTML: string = '') |
Marker with a CSS colour |
procedure RemoveMarker(const Id: string) |
Removes a marker |
procedure ClearMarkers |
Removes all markers |
function HasMarker(const Id: string): Boolean |
Whether a marker with Id exists |
function TryGetMarker(const Id: string; out Marker: TMapMarker): Boolean |
Reads a marker by Id |
procedure OpenMarkerPopup(const Id: string) |
Opens a marker popup |
procedure SetMainMarker(const Lat, Lon: Double; Visible: Boolean = True) |
Sets the main marker position (mmsManual) |
procedure UpdateMyLocation |
Reads the device location (OnLocation) |
procedure ShowRadius(const Meters: Double; const LabelText: string = '') |
Shows the radius circle |
procedure ClearRadius |
Hides the radius circle |
function MainMarkerDistanceFromZero: Double |
Main marker distance from the zero point (m) |
function MainMarkerBearingFromZero: Double |
Main marker bearing from the zero point |
procedure MainMarkerPixelOffsetFromZero(Zoom: Integer; out DX, DY: Double) |
Pixel offset from the zero point |
function DistanceFromMainMarker(const Lat, Lon: Double): Double |
Distance of a point from the main marker (m) |
procedure StartAreaSelection |
Starts area selection |
procedure CancelAreaSelection |
Cancels area selection |
procedure SetArea(const Area: TMapArea) |
Sets the area from code |
procedure ClearArea |
Clears the area |
procedure ShowSearchBox(Show: Boolean = True; const Query: string = '') |
Shows / hides the search box |
procedure SearchAddress(const Query: string) |
Address search (OnSearchResults) |
procedure SearchStructured(const Q: TNominatimStructuredQuery) |
Structured search (street, city, postcode…) |
procedure SearchInArea(const Query: string) |
Search inside the selected area |
procedure ReverseGeocode(const Lat, Lon: Double; Zoom: Integer = 18) |
Address for coordinates |
procedure LookupOsmIds(const OsmIds: string) |
Lookup by OSM ids |
procedure CheckSearchConnection |
Checks the search server connection |
procedure NextStyle |
Next style (like the Style button) |
procedure SetRasterEdit(const ArgsJSON: string) |
Raster edit / styling settings (used by TEditMapRaster) |
procedure RefreshTile(Z, X, Y: Integer) |
Refreshes tile z/x/y (cache-busting; z < 0 = all) |
T3DMapVCL (MapCommon.MapVCL)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Align |
(inherited) |
Standard VCL control property | |
Anchors |
(inherited) |
Standard VCL control property | |
Constraints |
(inherited) |
Standard VCL control property | |
Margins |
(inherited) |
Standard VCL control property | |
AlignWithMargins |
(inherited) |
Standard VCL control property | |
Padding |
(inherited) |
Standard VCL control property | |
TabOrder |
(inherited) |
Standard VCL control property | |
TabStop |
(inherited) |
Standard VCL control property | |
Visible |
(inherited) |
Standard VCL control property | |
Enabled |
(inherited) |
Standard VCL control property | |
Color |
(inherited) |
$00DCE4E8 |
Standard VCL control property |
ParentBackground |
(inherited) |
False |
Standard VCL control property |
Style |
TMap3DStyle |
m3sVector |
Map style (enum): OSM / satellite / terrain / custom tiles (TTileMap) or vector style (T3DMap) |
CenterLat |
(inherited) |
Map centre latitude (start / current) | |
CenterLon |
(inherited) |
Map centre longitude | |
Zoom |
(inherited) |
Zoom 0..22 | |
Pitch |
(inherited) |
Tilt in degrees | |
Bearing |
(inherited) |
Rotation in degrees | |
Language |
(inherited) |
Label language (pl, en, de …) | |
ShowScale |
(inherited) |
Scale bar (applied on page load) | |
ShowNavigationControl |
(inherited) |
MapLibre zoom/compass control next to the button panel | |
LoadingText |
(inherited) |
Text shown while loading | |
AllowPopupHTML |
(inherited) |
False = popups are plain text (XSS-safe) | |
ZeroLat |
(inherited) |
Zero point latitude (default Warsaw 52.2297) | |
ZeroLon |
(inherited) |
Zero point longitude (default 21.0122) | |
ZeroPointVisible |
(inherited) |
Draw the zero-point marker | |
ZeroTitle |
(inherited) |
Tooltip of the zero-point marker | |
ZeroIconWidth |
(inherited) |
ZeroIcon width (px) | |
ZeroIconHeight |
(inherited) |
ZeroIcon height (px) | |
HomeUsesZeroPoint |
(inherited) |
Home button flies to the zero point | |
HomeLat |
(inherited) |
Home target when HomeUsesZeroPoint = False | |
HomeLon |
(inherited) |
same – longitude | |
HomeZoom |
(inherited) |
Zoom after Home | |
MainMarkerSource |
(inherited) |
mmsZeroPoint / mmsManual / mmsDeviceLocation (falls back to the zero point) | |
MainMarkerVisible |
(inherited) |
Main marker visible | |
MainMarkerLat |
(inherited) |
Position with mmsManual – latitude | |
MainMarkerLon |
(inherited) |
Position with mmsManual – longitude | |
MainMarkerSize |
(inherited) |
Dot size without icon, px | |
MainMarkerSquare |
(inherited) |
Square instead of a circle | |
MainMarkerBorderWidth |
(inherited) |
Border width | |
MainMarkerBorderDashed |
(inherited) |
Dashed border | |
MainMarkerOpacity |
(inherited) |
Opacity 0..1 | |
MainMarkerTitle |
(inherited) |
Tooltip | |
MainMarkerDraggable |
(inherited) |
User can drag it (OnMainMarkerMoved) | |
MainMarkerIconWidth |
(inherited) |
MainMarkerIcon width | |
MainMarkerIconHeight |
(inherited) |
MainMarkerIcon height | |
MainMarkerIconScale |
(inherited) |
Icon scale | |
PulseEnabled |
(inherited) |
Pulsing ring | |
PulseDurationMs |
(inherited) |
Duration of one pulse (ms) | |
LocationTimeoutMs |
(inherited) |
Location sensor timeout | |
RadiusVisible |
(inherited) |
Radius circle | |
RadiusMeters |
(inherited) |
Radius in metres | |
RadiusCenter |
(inherited) |
rcMainMarker / rcZeroPoint / rcManual | |
RadiusLat |
(inherited) |
Centre with rcManual – latitude | |
RadiusLon |
(inherited) |
Centre with rcManual – longitude | |
RadiusFillOpacity |
(inherited) |
Fill opacity 0..1 | |
RadiusLineOpacity |
(inherited) |
Outline opacity 0..1 | |
RadiusLineWidth |
(inherited) |
Outline width px (0 = none) | |
RadiusLineStyle |
(inherited) |
mlsSolid / mlsDashed / mlsDotted | |
RadiusLabel |
(inherited) |
Text in the centre, e.g. "2 km" | |
NavVisible |
(inherited) |
Navigation button panel | |
NavPosition |
(inherited) |
Panel corner | |
NavOrientation |
(inherited) |
Vertical / horizontal | |
NavButtonSize |
(inherited) |
Button size px | |
SearchPlaceholder |
(inherited) |
Search box placeholder | |
SearchNoResultsText |
(inherited) |
"No results" text | |
SearchSearchingText |
(inherited) |
"Searching…" text | |
SearchMinChars |
(inherited) |
Minimum characters | |
SearchLive |
(inherited) |
Search while typing (mind provider limits!) | |
SearchShowDistance |
(inherited) |
Distance from the main marker in results | |
SearchUseArea |
(inherited) |
Search box searches inside the selected area | |
SearchProviderURL |
(inherited) |
Fallback Nominatim URL when SearchProvider is empty | |
SearchToken |
(inherited) |
Token – NEVER in the DFM, set in code | |
AreaShape |
(inherited) |
Shape of the Select-area button | |
AreaFillOpacity |
(inherited) |
Area fill opacity | |
SearchOnAreaSelected |
(inherited) |
Run AreaSearchQuery after selection | |
AreaSearchQuery |
(inherited) |
e.g. "restaurant", "plumber" | |
BoundariesURL |
(inherited) |
Vector tiles / TileJSON / PMTiles with boundaries (data source, not a style) | |
BoundariesKind |
(inherited) |
mbkVectorTiles / mbkTileJSON / mbkPMTiles | |
BoundariesSourceLayer |
(inherited) |
Source layer | |
BoundariesVisible |
(inherited) |
Show boundaries | |
Mode |
TMapMode |
mm2D |
mm2D / mm3D |
Pitch3D |
Double |
Pitch used in 3D mode | |
Theme |
TMapTheme |
mtDay |
mtDay / mtNight |
Buildings3D |
Boolean |
True |
Extruded buildings in 3D |
ServerStyleName |
string |
Name of a style saved on the server (Style = m3sServerStyle) | |
BaseRasterOpacity |
Double |
Opacity of the satellite / terrain background of hybrid styles | |
MainMarkerColor |
(inherited) |
Main marker colour | |
MainMarkerBorderColor |
(inherited) |
Border colour | |
PulseColor |
(inherited) |
Pulse colour | |
RadiusColor |
(inherited) |
Radius fill colour | |
RadiusLineColor |
(inherited) |
Outline colour (clNone = RadiusColor) | |
AreaColor |
(inherited) |
Selection area colour | |
BoundariesColor |
(inherited) |
Boundaries colour | |
Terrain |
TMapTerrainSettings |
DEM terrain (T3DMap*): Enabled, Exaggeration (1.3), SourceURL (XYZ PNG), Encoding (mteTerrarium / mteMapbox), ShowElevation, TileBuffer (tile ring around the view) | |
MainMarkerIcon |
(inherited) |
Main marker icon (TPicture / TBitmap, PNG/SVG) | |
ZeroIcon |
(inherited) |
Zero-point icon | |
NavButtons |
(inherited) |
Navigation panel buttons collection (kind, visibility, hint, order) | |
SearchProvider |
(inherited) |
Linked search provider (TNominatimSearchProvider / TCustomUrlSearchProvider) | |
Areas |
(inherited) |
Linked TMapAreas component (boundaries, regions, own GeoJSON) | |
Edit |
(inherited) |
||
Weather |
(inherited) |
||
WeatherInfo |
(inherited) |
||
WeatherClickMode |
(inherited) |
||
WeatherPointModeMinZoom |
(inherited) |
||
Aircraft |
(inherited) |
||
AircraftInfo |
(inherited) |
||
Boats |
(inherited) |
||
BoatsInfo |
(inherited) |
||
Edit3D |
(inherited) |
||
EditMap |
(inherited) |
Linked TEditMap (layer colours, opacity, widths) | |
AutoLinkComponents |
(inherited) |
Automatically link the first search provider / TMapAreas / TEditMap on the form | |
WebView2UserDataFolder |
(inherited) |
WebView2 user data folder ('' = application data folder) | |
WebView2BrowserFolder |
(inherited) |
WebView2 Fixed Version runtime folder; '' = system runtime | |
DevToolsEnabled |
(inherited) |
Browser developer tools (F12) – debugging only | |
OpenLinksExternally |
(inherited) |
Open popup links in the system browser |
Events
| Event | Type | Description |
|---|---|---|
OnResize |
(inherited) |
Standard VCL control property |
OnMapReady |
(inherited) |
Page and style ready |
OnMapClick |
(inherited) |
Click (Lat, Lon) |
OnMarkerClick |
(inherited) |
Marker click (Id) |
OnZoomChanged |
(inherited) |
Zoom changed |
OnMoveEnd |
(inherited) |
Move ended (View) |
OnSearchResults |
(inherited) |
Search results |
OnSearchError |
(inherited) |
Search error (ErrorKind pek*, HTTP, PL/EN message) |
OnSearchResultSelected |
(inherited) |
Result picked in the search box |
OnJSError |
(inherited) |
Page / WebView2 / bridge error |
OnStyleLoaded |
(inherited) |
Style loaded |
OnAreaSelected |
(inherited) |
Area selected (rectangle/polygon/circle) |
OnNavButtonClick |
(inherited) |
Panel button clicked (Kind) |
OnLocation |
(inherited) |
Device location result |
OnMainMarkerMoved |
(inherited) |
Main marker dragged |
OnStyleJSON |
TMapStyleJSONEvent |
Answer of RequestStyleJSON |
OnStyleSaved |
TMapStyleSavedEvent |
SaveStyleJSON finished |
OnModeChanged |
TNotifyEvent |
2D/3D switched |
OnElevation |
TMapElevationEvent |
Click with Terrain.ShowElevation or QueryElevation result: Lat, Lon, metres above sea level (NaN = no data) |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Core |
TMapCore |
Shared map core (TMapCore) – advanced use |
Browser |
TEdgeBrowser |
Internal browser control (TEdgeBrowser / TWebBrowser) |
IsMapReady |
Boolean |
True after OnMapReady |
View |
TMapView |
Current view (centre, zoom, pitch, bearing, bounds) |
MarkerCount |
Integer |
Number of markers |
LastResults |
TMapGeoResults |
Last search results |
Area |
TMapArea |
Selected area (shape, points, rectangle, circle) |
HasArea |
Boolean |
Whether an area is selected |
CustomStyleURL |
string |
Code only: style URL for Style = m3sCustom |
Public methods
| Method | Description |
|---|---|
function ResolveUserDataFolder: string |
Returns (and creates) the WebView2 data folder |
procedure Reload |
Reloads the page; the whole state is replayed |
function EffectiveWeatherClickTarget: TWeatherClickTarget |
|
procedure DetectLinkedComponents |
Finds and links a provider / TMapAreas / TEditMap on the form |
function MapCore: TMapCore |
IMapCoreProvider – core for TEditMapRaster |
procedure ExecuteJS(const Script: string) |
Executes JavaScript on the map page |
procedure RequestJSON(const Cmd, ArgsJSON: string; const Handler: TMapResultProc) |
Page command with JSON answer (callback) |
procedure SetView(const Lat, Lon, AZoom: Double; Animate: Boolean = False) |
Sets centre / zoom / pitch / bearing |
procedure FlyTo(const Lat, Lon: Double; const AZoom: Double = -1; DurationMs: Integer = 1500) |
Animated fly-to |
procedure FitBounds(const South, West, North, East: Double; PaddingPx: Integer = 40; const MaxZoom: Double = 17) |
Fit the view to a rectangle |
procedure FitMarkers(PaddingPx: Integer = 50; const MaxZoom: Double = 16; IncludeMainMarker: Boolean = False) |
Fit the view to the markers |
procedure SetInteractive(Enabled: Boolean) |
Enables / disables interaction (pan, zoom) |
procedure GoHome |
Same as the Home button |
procedure SetZeroPoint(const Lat, Lon: Double) |
Sets the zero point |
procedure AddMarkerCSS(const Id: string; const Lat, Lon: Double; const CSSColor: string; const Title: string = ''; const PopupText: string = ''; const PopupHTML: string = '') |
Marker with a CSS colour |
procedure RemoveMarker(const Id: string) |
Removes a marker |
procedure ClearMarkers |
Removes all markers |
function HasMarker(const Id: string): Boolean |
Whether a marker with Id exists |
function TryGetMarker(const Id: string; out Marker: TMapMarker): Boolean |
Reads a marker by Id |
procedure OpenMarkerPopup(const Id: string) |
Opens a marker popup |
procedure SetMainMarker(const Lat, Lon: Double; Visible: Boolean = True) |
Sets the main marker position (mmsManual) |
procedure UpdateMyLocation |
Reads the device location (OnLocation) |
procedure ShowRadius(const Meters: Double; const LabelText: string = '') |
Shows the radius circle |
procedure ClearRadius |
Hides the radius circle |
function MainMarkerDistanceFromZero: Double |
Main marker distance from the zero point (m) |
function MainMarkerBearingFromZero: Double |
Main marker bearing from the zero point |
procedure MainMarkerPixelOffsetFromZero(Zoom: Integer; out DX, DY: Double) |
Pixel offset from the zero point |
function DistanceFromMainMarker(const Lat, Lon: Double): Double |
Distance of a point from the main marker (m) |
procedure StartAreaSelection |
Starts area selection |
procedure CancelAreaSelection |
Cancels area selection |
procedure SetArea(const Area: TMapArea) |
Sets the area from code |
procedure ClearArea |
Clears the area |
procedure ShowSearchBox(Show: Boolean = True; const Query: string = '') |
Shows / hides the search box |
procedure SearchAddress(const Query: string) |
Address search (OnSearchResults) |
procedure SearchStructured(const Q: TNominatimStructuredQuery) |
Structured search (street, city, postcode…) |
procedure SearchInArea(const Query: string) |
Search inside the selected area |
procedure ReverseGeocode(const Lat, Lon: Double; Zoom: Integer = 18) |
Address for coordinates |
procedure LookupOsmIds(const OsmIds: string) |
Lookup by OSM ids |
procedure CheckSearchConnection |
Checks the search server connection |
procedure NextStyle |
Next style (like the Style button) |
procedure SetRasterEdit(const ArgsJSON: string) |
Raster edit / styling settings (used by TEditMapRaster) |
procedure RefreshTile(Z, X, Y: Integer) |
Refreshes tile z/x/y (cache-busting; z < 0 = all) |
procedure Set2D |
2D mode |
procedure Set3D |
3D mode |
procedure ToggleMode |
Toggles 2D/3D |
procedure LoadStyleJSON(const StyleJSON: string) |
Loads a MapLibre style from JSON text |
procedure LoadStyleJSONFromFile(const FileName: string) |
Loads a style from a file |
procedure SaveStyleJSON(const FileName: string) |
Saves the style on the server (OnStyleSaved) |
procedure RequestStyleJSON |
Gets the current style (OnStyleJSON) |
procedure SetLayerVisible(const LayerId: string; Visible: Boolean) |
Style layer visibility |
procedure ClearStyleOverrides |
Removes layer overrides (colours etc.) |
procedure ShowElevationSpots(const Lats, Lons: array of Double; const Names: array of string) |
Elevation labels at points (Lats, Lons, Names) |
procedure ClearElevationSpots |
Removes elevation labels |
procedure QueryElevation(const Lat, Lon: Double; const Callback: TMapResultProc) |
Elevation at a point (callback JSON {"meters":…}) |
T3DMapFMX (MapCommon.MapFMX)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Align |
(inherited) |
Standard FMX control property | |
Anchors |
(inherited) |
Standard FMX control property | |
Margins |
(inherited) |
Standard FMX control property | |
Padding |
(inherited) |
Standard FMX control property | |
Position |
(inherited) |
Standard FMX control property | |
Width |
(inherited) |
Standard FMX control property | |
Height |
(inherited) |
Standard FMX control property | |
Size |
(inherited) |
Standard FMX control property | |
Visible |
(inherited) |
Standard FMX control property | |
Enabled |
(inherited) |
Standard FMX control property | |
Style |
TMap3DStyle |
m3sVector |
Map style (enum): OSM / satellite / terrain / custom tiles (TTileMap) or vector style (T3DMap) |
CenterLat |
(inherited) |
Map centre latitude (start / current) | |
CenterLon |
(inherited) |
Map centre longitude | |
Zoom |
(inherited) |
Zoom 0..22 | |
Pitch |
(inherited) |
Tilt in degrees | |
Bearing |
(inherited) |
Rotation in degrees | |
Language |
(inherited) |
Label language (pl, en, de …) | |
ShowScale |
(inherited) |
Scale bar (applied on page load) | |
ShowNavigationControl |
(inherited) |
MapLibre zoom/compass control next to the button panel | |
LoadingText |
(inherited) |
Text shown while loading | |
AllowPopupHTML |
(inherited) |
False = popups are plain text (XSS-safe) | |
ZeroLat |
(inherited) |
Zero point latitude (default Warsaw 52.2297) | |
ZeroLon |
(inherited) |
Zero point longitude (default 21.0122) | |
ZeroPointVisible |
(inherited) |
Draw the zero-point marker | |
ZeroTitle |
(inherited) |
Tooltip of the zero-point marker | |
ZeroIconWidth |
(inherited) |
ZeroIcon width (px) | |
ZeroIconHeight |
(inherited) |
ZeroIcon height (px) | |
HomeUsesZeroPoint |
(inherited) |
Home button flies to the zero point | |
HomeLat |
(inherited) |
Home target when HomeUsesZeroPoint = False | |
HomeLon |
(inherited) |
same – longitude | |
HomeZoom |
(inherited) |
Zoom after Home | |
MainMarkerSource |
(inherited) |
mmsZeroPoint / mmsManual / mmsDeviceLocation (falls back to the zero point) | |
MainMarkerVisible |
(inherited) |
Main marker visible | |
MainMarkerLat |
(inherited) |
Position with mmsManual – latitude | |
MainMarkerLon |
(inherited) |
Position with mmsManual – longitude | |
MainMarkerSize |
(inherited) |
Dot size without icon, px | |
MainMarkerSquare |
(inherited) |
Square instead of a circle | |
MainMarkerBorderWidth |
(inherited) |
Border width | |
MainMarkerBorderDashed |
(inherited) |
Dashed border | |
MainMarkerOpacity |
(inherited) |
Opacity 0..1 | |
MainMarkerTitle |
(inherited) |
Tooltip | |
MainMarkerDraggable |
(inherited) |
User can drag it (OnMainMarkerMoved) | |
MainMarkerIconWidth |
(inherited) |
MainMarkerIcon width | |
MainMarkerIconHeight |
(inherited) |
MainMarkerIcon height | |
MainMarkerIconScale |
(inherited) |
Icon scale | |
PulseEnabled |
(inherited) |
Pulsing ring | |
PulseDurationMs |
(inherited) |
Duration of one pulse (ms) | |
LocationTimeoutMs |
(inherited) |
Location sensor timeout | |
RadiusVisible |
(inherited) |
Radius circle | |
RadiusMeters |
(inherited) |
Radius in metres | |
RadiusCenter |
(inherited) |
rcMainMarker / rcZeroPoint / rcManual | |
RadiusLat |
(inherited) |
Centre with rcManual – latitude | |
RadiusLon |
(inherited) |
Centre with rcManual – longitude | |
RadiusFillOpacity |
(inherited) |
Fill opacity 0..1 | |
RadiusLineOpacity |
(inherited) |
Outline opacity 0..1 | |
RadiusLineWidth |
(inherited) |
Outline width px (0 = none) | |
RadiusLineStyle |
(inherited) |
mlsSolid / mlsDashed / mlsDotted | |
RadiusLabel |
(inherited) |
Text in the centre, e.g. "2 km" | |
NavVisible |
(inherited) |
Navigation button panel | |
NavPosition |
(inherited) |
Panel corner | |
NavOrientation |
(inherited) |
Vertical / horizontal | |
NavButtonSize |
(inherited) |
Button size px | |
SearchPlaceholder |
(inherited) |
Search box placeholder | |
SearchNoResultsText |
(inherited) |
"No results" text | |
SearchSearchingText |
(inherited) |
"Searching…" text | |
SearchMinChars |
(inherited) |
Minimum characters | |
SearchLive |
(inherited) |
Search while typing (mind provider limits!) | |
SearchShowDistance |
(inherited) |
Distance from the main marker in results | |
SearchUseArea |
(inherited) |
Search box searches inside the selected area | |
SearchProviderURL |
(inherited) |
Fallback Nominatim URL when SearchProvider is empty | |
SearchToken |
(inherited) |
Token – NEVER in the DFM, set in code | |
AreaShape |
(inherited) |
Shape of the Select-area button | |
AreaFillOpacity |
(inherited) |
Area fill opacity | |
SearchOnAreaSelected |
(inherited) |
Run AreaSearchQuery after selection | |
AreaSearchQuery |
(inherited) |
e.g. "restaurant", "plumber" | |
BoundariesURL |
(inherited) |
Vector tiles / TileJSON / PMTiles with boundaries (data source, not a style) | |
BoundariesKind |
(inherited) |
mbkVectorTiles / mbkTileJSON / mbkPMTiles | |
BoundariesSourceLayer |
(inherited) |
Source layer | |
BoundariesVisible |
(inherited) |
Show boundaries | |
Mode |
TMapMode |
mm2D |
mm2D / mm3D |
Pitch3D |
Double |
Pitch used in 3D mode | |
Theme |
TMapTheme |
mtDay |
mtDay / mtNight |
Buildings3D |
Boolean |
True |
Extruded buildings in 3D |
ServerStyleName |
string |
Name of a style saved on the server (Style = m3sServerStyle) | |
BaseRasterOpacity |
Double |
Opacity of the satellite / terrain background of hybrid styles | |
MainMarkerColor |
(inherited) |
Main marker colour | |
MainMarkerBorderColor |
(inherited) |
Border colour | |
PulseColor |
(inherited) |
Pulse colour | |
RadiusColor |
(inherited) |
Radius fill colour | |
RadiusLineColor |
(inherited) |
Outline colour (clNone = RadiusColor) | |
AreaColor |
(inherited) |
Selection area colour | |
BoundariesColor |
(inherited) |
Boundaries colour | |
Terrain |
TMapTerrainSettings |
DEM terrain (T3DMap*): Enabled, Exaggeration (1.3), SourceURL (XYZ PNG), Encoding (mteTerrarium / mteMapbox), ShowElevation, TileBuffer (tile ring around the view) | |
MainMarkerIcon |
(inherited) |
Main marker icon (TPicture / TBitmap, PNG/SVG) | |
ZeroIcon |
(inherited) |
Zero-point icon | |
NavButtons |
(inherited) |
Navigation panel buttons collection (kind, visibility, hint, order) | |
SearchProvider |
(inherited) |
Linked search provider (TNominatimSearchProvider / TCustomUrlSearchProvider) | |
Areas |
(inherited) |
Linked TMapAreas component (boundaries, regions, own GeoJSON) | |
Edit |
(inherited) |
||
Weather |
(inherited) |
||
WeatherInfo |
(inherited) |
||
WeatherClickMode |
(inherited) |
||
WeatherPointModeMinZoom |
(inherited) |
||
Aircraft |
(inherited) |
||
AircraftInfo |
(inherited) |
||
Boats |
(inherited) |
||
BoatsInfo |
(inherited) |
||
Edit3D |
(inherited) |
||
EditMap |
(inherited) |
Linked TEditMap (layer colours, opacity, widths) | |
AutoLinkComponents |
(inherited) |
Automatically link the first search provider / TMapAreas / TEditMap on the form | |
BridgeTransport |
(inherited) |
Page ↔ Delphi channel: mbtAuto / WebView2 / WebBrowser (FMX) |
Events
| Event | Type | Description |
|---|---|---|
OnResized |
(inherited) |
Standard FMX control property |
OnMapReady |
(inherited) |
Page and style ready |
OnMapClick |
(inherited) |
Click (Lat, Lon) |
OnMarkerClick |
(inherited) |
Marker click (Id) |
OnZoomChanged |
(inherited) |
Zoom changed |
OnMoveEnd |
(inherited) |
Move ended (View) |
OnSearchResults |
(inherited) |
Search results |
OnSearchError |
(inherited) |
Search error (ErrorKind pek*, HTTP, PL/EN message) |
OnSearchResultSelected |
(inherited) |
Result picked in the search box |
OnJSError |
(inherited) |
Page / WebView2 / bridge error |
OnStyleLoaded |
(inherited) |
Style loaded |
OnAreaSelected |
(inherited) |
Area selected (rectangle/polygon/circle) |
OnNavButtonClick |
(inherited) |
Panel button clicked (Kind) |
OnLocation |
(inherited) |
Device location result |
OnMainMarkerMoved |
(inherited) |
Main marker dragged |
OnStyleJSON |
TMapStyleJSONEvent |
Answer of RequestStyleJSON |
OnStyleSaved |
TMapStyleSavedEvent |
SaveStyleJSON finished |
OnModeChanged |
TNotifyEvent |
2D/3D switched |
OnElevation |
TMapElevationEvent |
Click with Terrain.ShowElevation or QueryElevation result: Lat, Lon, metres above sea level (NaN = no data) |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Core |
TMapCore |
Shared map core (TMapCore) – advanced use |
Browser |
TWebBrowser |
Internal browser control (TEdgeBrowser / TWebBrowser) |
IsMapReady |
Boolean |
True after OnMapReady |
View |
TMapView |
Current view (centre, zoom, pitch, bearing, bounds) |
MarkerCount |
Integer |
Number of markers |
LastResults |
TMapGeoResults |
Last search results |
Area |
TMapArea |
Selected area (shape, points, rectangle, circle) |
HasArea |
Boolean |
Whether an area is selected |
BridgeMessagesSeen |
Integer |
Received bridge messages counter (diagnostics) |
CustomStyleURL |
string |
Code only: style URL for Style = m3sCustom |
Public methods
| Method | Description |
|---|---|
procedure Reload |
Reloads the page; the whole state is replayed |
function EffectiveWeatherClickTarget: TWeatherClickTarget |
|
procedure DetectLinkedComponents |
Finds and links a provider / TMapAreas / TEditMap on the form |
function MapCore: TMapCore |
IMapCoreProvider – core for TEditMapRaster |
procedure ExecuteJS(const Script: string) |
Executes JavaScript on the map page |
procedure RequestJSON(const Cmd, ArgsJSON: string; const Handler: TMapResultProc) |
Page command with JSON answer (callback) |
procedure SetView(const Lat, Lon, AZoom: Double; Animate: Boolean = False) |
Sets centre / zoom / pitch / bearing |
procedure FlyTo(const Lat, Lon: Double; const AZoom: Double = -1; DurationMs: Integer = 1500) |
Animated fly-to |
procedure FitBounds(const South, West, North, East: Double; PaddingPx: Integer = 40; const MaxZoom: Double = 17) |
Fit the view to a rectangle |
procedure FitMarkers(PaddingPx: Integer = 50; const MaxZoom: Double = 16; IncludeMainMarker: Boolean = False) |
Fit the view to the markers |
procedure SetInteractive(Enabled: Boolean) |
Enables / disables interaction (pan, zoom) |
procedure GoHome |
Same as the Home button |
procedure SetZeroPoint(const Lat, Lon: Double) |
Sets the zero point |
procedure AddMarkerCSS(const Id: string; const Lat, Lon: Double; const CSSColor: string; const Title: string = ''; const PopupText: string = ''; const PopupHTML: string = '') |
Marker with a CSS colour |
procedure RemoveMarker(const Id: string) |
Removes a marker |
procedure ClearMarkers |
Removes all markers |
function HasMarker(const Id: string): Boolean |
Whether a marker with Id exists |
function TryGetMarker(const Id: string; out Marker: TMapMarker): Boolean |
Reads a marker by Id |
procedure OpenMarkerPopup(const Id: string) |
Opens a marker popup |
procedure SetMainMarker(const Lat, Lon: Double; Visible: Boolean = True) |
Sets the main marker position (mmsManual) |
procedure UpdateMyLocation |
Reads the device location (OnLocation) |
procedure ShowRadius(const Meters: Double; const LabelText: string = '') |
Shows the radius circle |
procedure ClearRadius |
Hides the radius circle |
function MainMarkerDistanceFromZero: Double |
Main marker distance from the zero point (m) |
function MainMarkerBearingFromZero: Double |
Main marker bearing from the zero point |
procedure MainMarkerPixelOffsetFromZero(Zoom: Integer; out DX, DY: Double) |
Pixel offset from the zero point |
function DistanceFromMainMarker(const Lat, Lon: Double): Double |
Distance of a point from the main marker (m) |
procedure StartAreaSelection |
Starts area selection |
procedure CancelAreaSelection |
Cancels area selection |
procedure SetArea(const Area: TMapArea) |
Sets the area from code |
procedure ClearArea |
Clears the area |
procedure ShowSearchBox(Show: Boolean = True; const Query: string = '') |
Shows / hides the search box |
procedure SearchAddress(const Query: string) |
Address search (OnSearchResults) |
procedure SearchStructured(const Q: TNominatimStructuredQuery) |
Structured search (street, city, postcode…) |
procedure SearchInArea(const Query: string) |
Search inside the selected area |
procedure ReverseGeocode(const Lat, Lon: Double; Zoom: Integer = 18) |
Address for coordinates |
procedure LookupOsmIds(const OsmIds: string) |
Lookup by OSM ids |
procedure CheckSearchConnection |
Checks the search server connection |
procedure NextStyle |
Next style (like the Style button) |
procedure SetRasterEdit(const ArgsJSON: string) |
Raster edit / styling settings (used by TEditMapRaster) |
procedure RefreshTile(Z, X, Y: Integer) |
Refreshes tile z/x/y (cache-busting; z < 0 = all) |
procedure Set2D |
2D mode |
procedure Set3D |
3D mode |
procedure ToggleMode |
Toggles 2D/3D |
procedure LoadStyleJSON(const StyleJSON: string) |
Loads a MapLibre style from JSON text |
procedure LoadStyleJSONFromFile(const FileName: string) |
Loads a style from a file |
procedure SaveStyleJSON(const FileName: string) |
Saves the style on the server (OnStyleSaved) |
procedure RequestStyleJSON |
Gets the current style (OnStyleJSON) |
procedure SetLayerVisible(const LayerId: string; Visible: Boolean) |
Style layer visibility |
procedure ClearStyleOverrides |
Removes layer overrides (colours etc.) |
procedure ShowElevationSpots(const Lats, Lons: array of Double; const Names: array of string) |
Elevation labels at points (Lats, Lons, Names) |
procedure ClearElevationSpots |
Removes elevation labels |
procedure QueryElevation(const Lat, Lon: Double; const Callback: TMapResultProc) |
Elevation at a point (callback JSON {"meters":…}) |
TEditMap (MapCommon.EditMap)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
SettingsFile |
string |
Settings JSON loaded at start-up (AutoLoad) | |
DefaultSettingsFile |
string |
Own default file for RestoreDefaults | |
AutoLoad |
Boolean |
True |
Load SettingsFile at start-up |
ServerStyleName |
string |
Name of a style saved on the server (Style = m3sServerStyle) | |
UndoLimit |
Integer |
100 |
Number of undo steps |
Timeout |
Integer |
15000 |
Server call timeout (ms) |
EditSubject |
TMapEditSubjectKind |
eskMapLayers |
Events
| Event | Type | Description |
|---|---|---|
OnChange |
TMapEditChangeEvent |
Every settings change (layer, property) |
OnRestoreDefaults |
TNotifyEvent |
Defaults restored |
OnValidationError |
TMapEditValidationEvent |
JSON / file validation error |
OnLoaded |
TMapEditFileEvent |
Settings loaded (file / server) |
OnSaved |
TMapEditSavedEvent |
Saved (file / server) |
OnSubjectChanged |
TNotifyEvent |
|
OnTerrainOptionChanged |
TMapEditTerrainOptionEvent |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Subjects |
TMapEditSubjectKinds |
|
Settings |
TMapStyleSettings |
Current layer settings |
LastErrors |
TStringList |
Errors of the last validation |
Modified |
Boolean |
Changed since the last save / load |
ServerPassword |
string |
Styles API password (code only, not stored) |
ServerURL |
string |
Styles API URL (code only) |
BaseStyleURL |
string |
Base style combined with the settings by SaveToServer |
Public methods
| Method | Description |
|---|---|
procedure AttachStyleTarget(const Target: IMapStyleTarget) |
Internal: registers a map (IMapStyleSource) |
procedure DetachStyleTarget(const Target: IMapStyleTarget) |
Internal: unregisters a map |
function CurrentChangesJSON: string |
Current changes as JSON |
function CurrentChangesJSONFor(Kind: TMapEditSubjectKind): string |
|
function CurrentTerrainOptionsJSON: string |
|
function ActiveSubject: TMapEditSubjectKind |
|
function SubjectDescription: string |
|
function TargetCount: Integer |
|
function TargetKind(Index: Integer): TMapEditSubjectKind |
|
function TargetName(Index: Integer): string |
|
procedure SetTerrainOption(const Prop, ValueJSON: string) |
|
function GetTerrainOption(const Prop: string): string |
|
procedure ClearTerrainOptions |
|
procedure SetTerrainContourLines(Visible: Boolean) |
|
procedure SetTerrainElevationLabels(Visible: Boolean) |
|
procedure SetTerrainHillshade(Visible: Boolean) |
|
procedure SetTerrainObjectElevation(Visible: Boolean) |
|
procedure SetTerrainContourColor(const CSSColor: string) |
|
procedure SetTerrainContourStyle(const IntervalM, WidthPx: Double) |
|
procedure EnsureAutoLoaded |
Runs AutoLoad now |
procedure BeginUpdate |
Groups changes into one undo step |
procedure EndUpdate |
Ends the change group |
procedure SetColor(const LayerId, CSSColor: string) |
Layer colour (CSS) |
procedure SetPaintColor(const LayerId, Prop, CSSColor: string) |
Colour of any paint property |
procedure SetOpacity(const LayerId: string; const Value: Double) |
Layer opacity 0..1 |
procedure SetVisible(const LayerId: string; Value: Boolean) |
Layer visibility |
procedure SetWidth(const LayerId: string; const Value: Double) |
Layer line width |
procedure SetZoomStops(const LayerId, Prop: string; const Stops: TMapZoomStops) |
Zoom-dependent values |
procedure SetValueJSON(const LayerId: string; Section: TMapStyleSection; const Prop, ValueJSON: string) |
Any paint/layout value as JSON |
procedure SetCategoryColor(const Category, CSSColor: string) |
One colour for a layer category (e.g. water) |
procedure SetCategoryVisible(const Category: string; Value: Boolean) |
Layer category visibility |
function GetColor(const LayerId: string): string |
Reads the colour |
function GetOpacity(const LayerId: string): Double |
Reads the opacity |
function GetVisible(const LayerId: string): Boolean |
Reads the visibility |
function GetWidth(const LayerId: string): Double |
Reads the width |
function GetZoomStops(const LayerId, Prop: string): TMapZoomStops |
Reads zoom stops |
function GetValueJSON(const LayerId: string; Section: TMapStyleSection; const Prop: string): string |
Reads a value as JSON |
function CanUndo: Boolean |
Whether undo is possible |
function CanRedo: Boolean |
Whether redo is possible |
function Undo: Boolean |
Undo |
function Redo: Boolean |
Redo |
procedure RestoreDefaults |
Restores defaults (DefaultSettingsFile or factory); undoable |
function IsDefault: Boolean |
Whether the settings are the defaults |
function LoadFromJSON(const JSONText: string; const Source: string = 'json'): Boolean |
Validates and applies settings JSON |
function SaveToJSON(Indent: Integer = 2): string |
Settings as JSON |
function LoadFromFile(const FileName: string): Boolean |
Loads a JSON file |
function SaveToFile(const FileName: string): Boolean |
Saves a JSON file |
function ShowOpenDialog: Boolean |
Open file dialog *.json |
function ShowSaveDialog: Boolean |
Save file dialog *.json |
procedure ShowEditor |
Editor window (layer tree, colours, undo) |
procedure SaveToServer(const Name: string; const Password: string = '') |
Saves the style on the map server under a name (async, OnSaved) |
procedure LoadFromServer(const Name: string) |
Loads a style from the server (OnLoaded) |
TEditMapRaster (MapCommon.EditMapRaster)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Map |
TComponent |
TTileMapVCL/FMX (or T3DMap*) map; auto-detected (FreeNotification) | |
AutoDetect |
Boolean |
True |
When Map = nil, link the first map on the form (prefers TTileMap*) |
AutoLinkComponents |
Boolean |
True |
Automatically link the first search provider / TMapAreas / TEditMap on the form |
Enabled |
Boolean |
True |
Enables editing / styling |
EditPopupEnabled |
Boolean |
True |
|
UrlTemplate |
string |
Tile template with {z}/{x}/{y}/{s}/{apikey} | |
ApiKey |
string |
API key – appended via {apikey} (or ?key=); set in code / config file | |
ProxyURL |
string |
Optional tile proxy (tools/server); tiles: |
|
CacheFolder |
string |
Cache / store folder ('' = application data folder) | |
ConfigFile |
string |
JSON config file (map-raster-config v1) | |
StyleName |
string |
neutral / google-like / apple-like / night / custom – runtime switch without reload | |
CustomStyleJSON |
string |
Own style JSON (map-raster-style v1) for StyleName = custom | |
PaintMode |
TMapRasterPaintMode |
rpmNone |
rpmNone / rpmPaint / rpmCrop / rpmOpacity – tile pixel editing by click |
Opacity |
Double |
Raster layer opacity 0..1 | |
LocalStore |
Boolean |
True |
IndexedDB in the page (local first, then server) |
BrushColor |
string |
Brush CSS colour (rpmPaint) | |
BrushSize |
Integer |
6 |
Brush size px |
StoreFile |
string |
SQLite file (MBTiles + modified column); '' = application data folder |
Events
| Event | Type | Description |
|---|---|---|
OnStyleChanged |
TNotifyEvent |
Style changed |
OnConfigLoaded |
TNotifyEvent |
Config loaded |
OnEditPopupChanged |
TNotifyEvent |
|
OnTileEdited |
TMapRasterTileEditedEvent |
Tile edited on the page (already stored, modified = 1) |
Public methods
| Method | Description |
|---|---|
procedure DetectMap |
Finds a map on the form (when Map = nil) |
procedure DetectLinkedComponents |
Finds and links a provider / TMapAreas / TEditMap on the form |
function LoadConfigFromFile(const FileName: string = ''): Boolean |
Loads the JSON config |
function SaveConfigToFile(const FileName: string = ''): Boolean |
Saves the JSON config |
function LoadConfigJSON(const JSONText: string): Boolean |
Config from JSON text |
function SaveConfigJSON(Indent: Integer = 2): string |
Config as JSON |
procedure ApplyBuiltinStyle(Style: TMapRasterBuiltinStyle) |
Built-in style (rbsNeutral, rbsGoogleLike, rbsAppleLike, rbsNight) |
procedure ApplyStyleJSON(const JSONText: string) |
Own style JSON (colour mapping, brightness, contrast, saturation) |
procedure RefreshTile(Z, X, Y: Integer) |
Forces a tile refresh (cache-busting, drops IndexedDB/SQLite copy) |
procedure RefreshAllTiles |
Refreshes all tiles |
function ExpandTileURL(Z, X, Y: Integer; const Subdomain: string = 'a'): string |
Tile URL after template expansion (+ApiKey / proxy) |
function CurrentCssFilter: string |
Current CSS filter of the style |
function Store: TMapRasterTileStore |
SQLite store (Put/Get/Delete/Clear/ModifiedTiles/MarkClean) |
TMapAreas (MapCommon.Areas)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Active |
Boolean |
True |
False = nothing is loaded or shown |
EditPopupEnabled |
Boolean |
True |
RMB + long-press (~500 ms) open the area style editor; False disables both |
Edit |
TEditMapRaster |
||
AutoLinkComponents |
Boolean |
True |
Automatically link the first search provider / TMapAreas / TEditMap on the form |
WholeWorld |
Boolean |
False |
Whole world in one file (countries or admin-1) |
WorldDetail |
TMapWorldDetail |
mwdCountries |
mwdCountries / mwdAdmin1 for WholeWorld |
Continents |
TMapAreaContinents |
[] |
Continents to load (set) |
Countries |
string |
ISO filter inside the selected continents (e.g. PL,DE,CZ) | |
ShowCountryOutlines |
Boolean |
True |
Country / admin-1 outlines of the continent files |
ShowRegions |
Boolean |
False |
Region fill |
HierarchyStyle |
TMapAreaStyle |
Hierarchy style (fill, outline, width, labels) | |
ShowAdministrative |
Boolean |
False |
Explicit administrative boundaries of the selected countries at AdminLevel |
AdminLevel |
TMapAdminLevel |
malCountry |
malCountry / malAdmin1 (voivodeships, Natural Earth) / malAdmin2 (counties, geoBoundaries) |
CountryStyle |
TMapAreaStyle |
Country level style (fill, outline colour, width) | |
Admin1Style |
TMapAreaStyle |
Admin-1 level style | |
Admin2Style |
TMapAreaStyle |
Admin-2 level style | |
SettingsFile |
string |
Settings JSON file (map-areas-settings v1) | |
AutoLoad |
Boolean |
True |
Load SettingsFile on open |
AutoSave |
Boolean |
False |
Save SettingsFile after every change |
Items |
TMapAreaItems |
Own GeoJSON files / URLs / texts (collection with style) | |
CacheFolder |
string |
GeoJSON cache folder ('' = application data folder) | |
UseCache |
Boolean |
True |
Use the file cache |
CheckVersion |
Boolean |
True |
Compare versiongeojson.json with the cache (once per run) |
Timeout |
Integer |
60000 |
Download timeout (ms) |
FitOnLoad |
Boolean |
False |
Fit the view after loading |
Events
| Event | Type | Description |
|---|---|---|
OnAreaClick |
TMapAreaEvent |
Area click (SetId, Lat, Lon, properties) |
OnAreaHover |
TMapAreaEvent |
Area hover |
OnAreaLoaded |
TMapAreaLoadedEvent |
Set loaded (feature count / error) |
OnValidationError |
TMapAreaValidationEvent |
GeoJSON / settings validation error |
OnSettingsLoaded |
TNotifyEvent |
Settings file loaded |
OnSettingsSaved |
TNotifyEvent |
Settings file saved |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
BaseURL |
string |
GeoJSON catalogue base URL (code only) |
Admin2BaseURL |
string |
ADM2 URL template ({ISO}/{iso}); default geoBoundaries (CC BY 4.0) |
ServerVersion |
string |
Server data version |
Public methods
| Method | Description |
|---|---|
procedure AttachAreasTarget(const Target: IMapAreasTarget) |
Internal: registers a map |
procedure DetachAreasTarget(const Target: IMapAreasTarget) |
Internal: unregisters a map |
procedure ReplayAreasTo(const Target: IMapAreasTarget) |
Internal: replays sets to a map |
procedure BeginUpdate |
Defers rebuilding until EndUpdate |
procedure EndUpdate |
Rebuilds after changes |
procedure Refresh |
Reloads the hierarchy and items |
function LoadFromFile(const FileName: string; const ACaption: string = ''): TMapAreaItem |
Adds an own GeoJSON file |
function LoadFromURL(const URL: string; const ACaption: string = ''): TMapAreaItem |
Adds GeoJSON from a URL |
function LoadFromString(const GeoJSON: string; const ACaption: string = ''): TMapAreaItem |
Adds GeoJSON from text |
procedure Clear |
Removes own items |
procedure FitToArea(const SetId: string; PaddingPx: Integer = 30; const MaxZoom: Double = 12) |
Fits the view to a set |
procedure ShowCountry(const ISO: string) |
Selects a country and zooms to it |
function HierarchySetIds: TArray<string> |
Hierarchy set ids |
function HierarchyState(const SetId: string): TMapAreaState |
Set state (downloading / ready / error) |
procedure ClearCache |
Deletes cached files |
function SaveToJSON(Indent: Integer = 2): string |
Settings as JSON (map-areas-settings v1) |
function LoadFromJSON(const JSONText: string): Boolean |
Applies settings from JSON |
function SaveSettingsToFile(const FileName: string = ''): Boolean |
Saves settings to a file |
function LoadSettingsFromFile(const FileName: string = ''): Boolean |
Loads settings from a file |
procedure EnsureAutoLoaded |
Runs AutoLoad now |
procedure ShowAdministrativeCountry(const ISO: string; Level: TMapAdminLevel = malAdmin1) |
Shows a country with subdivisions (e.g. PL + voivodeships) |
function GetAreaFileText(const FileName: string; out Text, ErrorMessage: string): Boolean |
TNominatimSearchProvider (MapCommon.Search)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Language |
string |
Language of results and messages (pl, en, de …) | |
Limit |
Integer |
10 |
Maximum number of results |
ConnectTimeout |
Integer |
5000 |
Connect timeout (ms) |
Timeout |
Integer |
15000 |
Response timeout (ms) |
UserAgent |
string |
User-Agent header – identify your app | |
MinRequestIntervalMs |
Integer |
1000 |
Minimum gap between requests (queued); Nominatim: 1000 |
RateLimitBackoffMs |
Integer |
10000 |
Pause after HTTP 429 |
BaseURL |
string |
Nominatim server URL | |
TokenRequired |
Boolean |
True |
Require a token |
TokenFormat |
TMapTokenFormat |
mtfAuto |
How the token is sent (mtfAuto, header, parameter) |
OutputFormat |
TNominatimFormat |
nfJSONv2 |
Response format (jsonv2, geojson…) |
Outputs |
TNominatimOutputs |
[noAddressDetails] |
Extra output (address, extratags, namedetails…) |
CountryCodes |
string |
ISO country filter (e.g. pl,de) | |
Layers |
TNominatimLayers |
[] |
Nominatim layers (address, poi, railway…) |
FeatureType |
TNominatimFeatureType |
nftNone |
Feature type (country, state, city, settlement) |
ExcludePlaceIds |
string |
Excluded place_ids | |
ViewBox |
string |
Preferred area lon1,lat1,lon2,lat2 | |
Bounded |
Boolean |
False |
Only results inside ViewBox |
Dedupe |
Boolean |
True |
Remove duplicates |
Polygon |
TNominatimPolygon |
npNone |
Returned geometry (geojson, kml, svg, text) |
PolygonThreshold |
Double |
Geometry simplification | |
Email |
string |
Contact e-mail (Nominatim policy) | |
DetailsOptions |
TNominatimDetailsOptions |
/details options | |
Continent |
TMapContinent |
mcAuto |
Continent (mcAuto = from the view) |
ContinentFilter |
Boolean |
False |
Filter results to the continent |
SendContinentHint |
Boolean |
True |
Send the continent hint |
ContinentBaseURLs |
TStrings |
Per-continent servers (eu=…, as=…) | |
CheckServerStatus |
Boolean |
True |
Probe /status before the first request |
StatusCacheSeconds |
Integer |
300 |
How long /status is trusted (s) |
Events
| Event | Type | Description |
|---|---|---|
OnResults |
TMapSearchResultsEvent |
Search results |
OnError |
TMapSearchErrorEvent |
Every failure (ErrorKind, HTTP, PL/EN message) |
OnConnectionChecked |
TMapConnectionCheckedEvent |
Connection check result |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Busy |
Boolean |
A request is running |
HostBaseURL |
string |
URL set by the map (when BaseURL is empty) |
HostToken |
string |
Token set by the map |
LastCheckOK |
Boolean |
Last check result |
LastCheckTime |
TDateTime |
Last check time |
LastCheckErrorKind |
TMapProviderErrorKind |
Check error kind |
LastCheckMessage |
string |
Check message |
LastStatusJSON |
string |
/status answer |
Token |
string |
Token – code only (not in the DFM/FMX) |
Public methods
| Method | Description |
|---|---|
procedure Search(const Query: string) |
Search (OnResults / callback) |
procedure SearchInArea(const Query: string; const Area: TMapArea) |
Search inside the selected area |
procedure Reverse(const Lat, Lon: Double; Zoom: Integer = 18) |
Reverse geocoding |
procedure CancelPending |
Cancels pending requests |
function SupportsKind(Kind: TMapSearchKind): Boolean |
Whether a request kind is supported |
function RedactedURL(const Request: TMapSearchRequest): string |
URL with secrets redacted |
function Scrub(const Text: string): string |
Replaces secrets with *** |
function EffectiveBaseURL(C: TMapContinent = mcNone): string |
Base URL actually used |
function Params(const Request: TMapSearchRequest): TNominatimParams |
All query parameters |
function Validate(out ErrorKind: TMapProviderErrorKind; out ErrorMessage: string): Boolean |
Validation (token + URL) without network |
procedure SearchStructured(const Query: TNominatimStructuredQuery) |
Structured search (street, city, postcode…) |
procedure Lookup(const OsmIds: string) |
/lookup by osm_ids (max 50) |
procedure Details(OsmType: Char; OsmId: Int64; const ClassName: string = '') |
/details of an object |
procedure DetailsByPlaceId(PlaceId: Int64) |
/details by place_id |
procedure CheckConnection(const Callback: TMapConnectionCheckProc = nil) |
/status now |
procedure Status |
Alias of CheckConnection |
procedure InvalidateConnectionCache |
Forgets the /status result |
TCustomUrlSearchProvider (MapCommon.Search)
Published properties
| Property | Type | Default | Description |
|---|---|---|---|
Language |
string |
Language of results and messages (pl, en, de …) | |
Limit |
Integer |
10 |
Maximum number of results |
ConnectTimeout |
Integer |
5000 |
Connect timeout (ms) |
Timeout |
Integer |
15000 |
Response timeout (ms) |
UserAgent |
string |
User-Agent header – identify your app | |
MinRequestIntervalMs |
Integer |
0 |
Minimum gap between requests (queued); Nominatim: 1000 |
RateLimitBackoffMs |
Integer |
10000 |
Pause after HTTP 429 |
SearchURL |
string |
Search URL template ({query}, {limit}, {lang}, {apikey}…) | |
ReverseURL |
string |
Reverse URL template ({lat}, {lon}…) | |
AreaSearchURL |
string |
Template for area search ('' = SearchURL) | |
Params |
TStrings |
Extra parameters Name=Value | |
Headers |
TStrings |
Extra HTTP headers Name=Value | |
ApiKey |
string |
API key – code only, used by {apikey} | |
CountryCodes |
string |
ISO country filter (e.g. pl,de) | |
ResponseFormat |
TMapResponseFormat |
mrfAuto |
mrfAuto / Nominatim / Photon / GeoJSON |
Events
| Event | Type | Description |
|---|---|---|
OnResults |
TMapSearchResultsEvent |
Search results |
OnError |
TMapSearchErrorEvent |
Every failure (ErrorKind, HTTP, PL/EN message) |
Public properties (code only)
| Property | Type | Description |
|---|---|---|
Busy |
Boolean |
A request is running |
HostBaseURL |
string |
URL set by the map (when BaseURL is empty) |
HostToken |
string |
Token set by the map |
Public methods
| Method | Description |
|---|---|
procedure Search(const Query: string) |
Search (OnResults / callback) |
procedure SearchInArea(const Query: string; const Area: TMapArea) |
Search inside the selected area |
procedure Reverse(const Lat, Lon: Double; Zoom: Integer = 18) |
Reverse geocoding |
procedure CancelPending |
Cancels pending requests |
function SupportsKind(Kind: TMapSearchKind): Boolean |
Whether a request kind is supported |
function RedactedURL(const Request: TMapSearchRequest): string |
URL with secrets redacted |
function Scrub(const Text: string): string |
Replaces secrets with *** |
15. Recipes
13.1 Babysitters within 2 km
// Babysitters within 2 km of the user
Map.MainMarkerSource := mmsDeviceLocation;
Map.RadiusMeters := 2000;
Map.RadiusLabel := '2 km';
Map.RadiusVisible := True;
for B in Babysitters do
if Map.DistanceFromMainMarker(B.Lat, B.Lon) <= 2000 then
Map.AddMarker(B.Id, B.Lat, B.Lon, clFuchsia, B.Name, B.Phone);
Map.FitMarkers(50, 15, True);
13.2 Plumber in a selected district
// Plumber: select the district, search inside it
Map.AreaShape := masRectangle;
Map.AreaSearchQuery := 'hydraulik';
Map.SearchOnAreaSelected := True;
Map.StartAreaSelection;
13.3 Restaurants on the 3D map at night
// Restaurants with popups, night theme on the 3D map
Map3D.Theme := mtNight;
for R in Restaurants do
Map3D.AddMarker(R.Id, R.Lat, R.Lon, clRed, R.Name, R.Cuisine + ', ' + R.Hours);
Map3D.FitMarkers;
16. Migrating from the previous version
Version 2 no longer contains the company name in identifiers. The old prefix (the company name)
is written below as Old, e.g. TOldMapVCL stands for the former VCL map class.
| Was | Is |
|---|---|
OldMaps.groupproj |
MapComponents.groupproj |
packages OldMapsRT/VCL/FMX/Dsgn |
MapComponentsRT/VCL/FMX/Dsgn |
palette page Old Maps |
Maps |
TOldMapVCL |
TTileMapVCL (tiles) or T3DMapVCL (3D vector) |
TOldMapFMX |
TTileMapFMX or T3DMapFMX |
Old.Maps.Types |
MapCommon.Types |
Old.Maps.Core (TImMapCore) |
MapCommon.Core (TMapCore) |
Old.Maps.Bridge |
MapCommon.Bridge |
Old.Maps.Geocoder (TImGeocoder) |
MapCommon.Nominatim + MapCommon.Search (TNominatimSearchProvider) |
Old.Maps.PageHtml, Web/Old.Maps.Page.html |
MapCommon.PageHtml, Web/MapCommon.Page.html |
Old.Maps.VCL / .FMX |
MapCommon.MapVCL / MapCommon.MapFMX |
Old.Maps.Reg |
MapCommon.Reg |
type prefix TIm… (TImMapView, TImGeoResult, TImMapMode …) |
TMap… (TMapView, TMapGeoResult, TMapMode …) |
TImBridgeTransport (ibt…) |
TMapBridgeTransport (mbt…) |
TImContinent (ic…) |
TMapContinent (mc…) |
JS window.ImMap, bridge old-bridge.invalid |
window.MapBridge, map-bridge.invalid |
StyleURL (published) |
Style (enum) + CustomStyleURL / CustomTileURL (public) |
GeoLocBaseURL, GeoLocToken |
SearchProviderURL, SearchToken or TNominatimSearchProvider.BaseURL/Token |
SearchLanguage, CountryCodes, SearchLimit, SearchViewBox, SearchBounded, Continent, ContinentBaseURLs, GeoConnectTimeout, GeoResponseTimeout |
TNominatimSearchProvider properties (Language, CountryCodes, Limit, ViewBox, Bounded, Continent, ContinentBaseURLs, ConnectTimeout, Timeout) |
ShowNavigation |
NavVisible (button panel) / ShowNavigationControl (MapLibre control) |
OnGeocodeResults, OnGeocodeError |
OnSearchResults, OnSearchError (with ErrorKind) |
MapLibreJSURL, MapLibreCSSURL, PMTilesJSURL (published) |
Core.MapLibreJSURL … (code only) |
The easiest path: replace class names in DFM/FMX and unit names in uses, then open the form – the
IDE reports removed properties (e.g. StyleURL, GeoLocToken) to be moved according to the table.
From the old OSMWebBrowserVCL / OSMMapViewerVCL: MarkerLat/Lon → MainMarkerLat/Lon or
SetMainMarker; AreaShow*/Radius* → RadiusVisible, RadiusMeters, ShowRadius;
ButtonPanel* → NavButtons; SelectArea*, OnAreaSelected → AreaShape, StartAreaSelection,
OnAreaSelected; OnMapClick(Lon, Lat, var MoveMarker) → OnMapClick(Sender; const Lat, Lon)
(reversed parameter order).
17. Limitations and open issues
- The code has not been compiled in Delphi yet (no Delphi on the build server).
- The
/details,/deletable,/polygonsendpoints of the geoloc gateway are unverified. /geojson/on mapa.imetroll.com sends no CORS header – the component downloads in Delphi (for direct browser use addAccess-Control-Allow-Origin).- Esri tiles – essentially non-commercial without an ArcGIS licence.
- No Antarctica file – only in the world file.
- FMX
TWebBrowserhas no postMessage event – JS → Delphi goes through navigations tohttps://map-bridge.invalid/…; on unusual platforms only Delphi → JS may work.
18. Troubleshooting
| Symptom | Cause / fix |
|---|---|
Grey panel, OnJSError "WebView2 could not be created" |
WebView2 Runtime missing or WebView2Loader.dll of the wrong bitness next to the EXE |
| Map works one-way only (FMX) | OnJSError with Source = 'bridge'; try BridgeTransport := mbtIFrame |
OnSearchError with pekNoToken / pekInvalidToken |
set SearchToken or the provider Token in code; token rejected (401/403) |
pekRateLimited (429) |
too many requests – turn off SearchLive, add caching |
| No satellite tiles | Esri limit or block – use tmsOpenStreetMap or an own source |
TEditMap does not change the map |
tile map (editing is for T3DMap* only), no EditMap, or AutoLinkComponents = False |
| "add MapCommon.EditMapVCL or MapCommon.EditMapFMX to uses" | ShowEditor/ShowOpenDialog without the window unit – add it to uses (the maps do it) |
| Settings file not loaded | OnValidationError / LastErrors names the layer and field |
| Areas do not appear | OnAreaLoaded(Success=False); offline with an empty cache; unknown code in Countries (OnValidationError) |
| Slow first continent load | files are 4–54 MB; later runs use the cache |
| Component not linked automatically | only empty properties and components of the same form; AutoLinkComponents |
13b2. TWeatherPopup / TInfoWindowWeather — one AM HTML window
One weather window (modal #0a3a8c like old weatherModal): composes Scene + HourStrip + DayItems + Chart.
Area click (ShowOnAreaClick, default True) → ShowAt → TWeather.ApplyCoords + Refresh → PopupJSON.
Alias: TInfoWindowWeather = TWeatherPopup. Unit MapCommon.Weather.Popup.
Composes the old AM HTML modal into widgets: TWeatherHeader (icon + area info; icon click → HourStrip), TWeatherScene, TWeatherHourStrip, TWeatherDayItems, TWeatherChart. Demo: right-click area → full window; checkboxes ShowHeader / ShowHourStrip / …; ShowAt = invoke.
Do not use TMapInfoWindow for weather — keep InfoWindow for markers, aircraft (TAircraft) and boats (TBoats).
| Property | Description |
|---|---|
Weather, Scene, HourStrip, DayItems, Chart |
Links (AutoLink; reverse Weather.Popup) |
ShowOnAreaClick / ShowOnMapClick |
When to open |
AutoRequest |
ShowAt queries TWeather |
ShowScene / ShowHourStrip / ShowDayItems / ShowChart |
Blocks in the window |
Style.GradientTop |
#0a3a8c (AM HTML) |
PopupJSON |
Compose helper (WeatherComposePopupJSON) |
Methods: Show / ShowAt / ShowForJSON / Hide / ApplyJSON. Events: OnShow, OnHide, OnPopup.
13c. TAircraft / TPlanes (ADS-B)
Middleware like TWeather: form/map ↔ TAircraft ↔ https://fly.imetroll.com (?key=).
ApiKey/RequireApiKey(default True)Map/Map.Aircraft+AircraftInfo— AutoLink; plane markers (setAircraft)InfoWindow— click → info; Show route →/v1/tracks+ altitude chart- Alias:
TPlanes = TAircraft - Ships: see §13d TBoats / boatsea.imetroll.com
13d. TBoats / TShips (AIS)
Middleware like TAircraft: form/map ↔ TBoats ↔ https://boatsea.imetroll.com (?key=).
ApiKey/RequireApiKey,Area(rectangle / circlelat/lon/radius_km/AreaId; default Baltic PL),IntervalSec,Active— area required like flyDisplay(built-in / custom icon, labels Name/MMSI/Speed, animate)Map/BoatsInfo,InfoWindow, click → ShowRoute → polyline + SOG chart- Alias:
TShips = TBoats - Server: nginx + ships_proxy (Digitraffic AIS, sample fallback)
- Active + area selection / coordinates → automatic request: §13e
| GET | TBoats | Notes |
|---|---|---|
lamin…lomax |
bakRectangle / ApplyBounds |
Rectangle |
lat lon radius_km |
bakRadius / ApplyCoords |
Circle |
area= |
ApplyAreaId |
Catalog GET /v1/areas |
key= |
ApiKey |
Required on /v1/states, /v1/tracks |
Demo: https://help.imetroll.com/demo/tboats.html · API: https://boatsea.imetroll.com/
13d.1 Ship classes (AIS → ShipClass)
boatsea and Delphi (BoatsClassifyShip) give every ship a class: container, bulk, cargo, tanker, chemical, gas,
passenger, hsc, fishing, military, law, sar, tug, pilot, dredger, special, sailing, pleasure, wig,
aton, beacon, other, unknown (enum TBoatsShipClass = bsc*). The AIS type is coarse (70 = cargo, 80 = tanker), so
container / bulk / chemical / gas come from the dangerous-goods digit (x1–x4 = cat. A–D → S.Hazard) and the vessel name
(MSC/MAERSK → container, LNG/LPG → gas, ORP/HMS → military).
| Delphi | Notes |
|---|---|
Display.TypeIcons (True), Display.TypeIconBaseURL |
Per-class icon https://boatsea.imetroll.com/static/ships/<class>.svg |
Display.ClassFilter |
e.g. [bscTanker, bscChemical, bscGas]; [] = all |
Display.LabelField := blfShipClass |
Label = class name |
S.ShipClass, S.Hazard, S.LengthM, S.BeamM |
Class, DG category A–D, AIS dimensions |
BoatsShipClassLabel / Color / Id / IconURL |
PL/EN label, colour, id, icon URL |
JSON ships[]: ship_class, ship_class_label, ship_class_label_en, ship_class_color, icon_url, hazard, ais_type_desc, class_basis, length_m, beam_m;
catalogue GET /v1/ship-classes?key=.
13e. Active: area selection / coordinates → automatic request (TAircraft, TBoats, TWeather)
With Active = True and a linked map, every map area selection (nav button Select area or
BeginAreaSelect; rectangle / circle, map pan locked) or coordinates fire the request at once
(RefreshAsync). A request still running for the old area is dropped (TWeather: cancelled).
Active = False → only Area changes.
| Method | TAircraft / TBoats | TWeather |
|---|---|---|
ApplyCoords(Lat, Lon, RadiusKm) |
circle → lat/lon/radius_km |
circle → wakPolygon (grid inside circle) |
ApplyCoords(Lat, Lon) |
circle of Area.RadiusKm (80 / 50 km) |
single point (wakPoints) |
ApplyCoordsText(Edit1.Text) |
"52.23, 21.01, 50", "52,23; 21,01; 50", "52.23 21.01 50km", "lat=52.2 lon=21 r=30" |
same |
ApplyBounds(S, W, N, E) |
rectangle → lamin…lomax |
wakBBox |
ApplyAreaId('gdansk') |
named server area (area=) |
– |
ApplyMapArea(Map.Area) |
rectangle / circle from map | rectangle / circle / polygon |
Properties: UseMapAreaSelection, AutoRequestOnAreaSelect, ShowAreaOnMap (all default True), event
OnAreaApplied. Map.OnAreaSelected stays the developer's event – components listen through
TMapCore.AddAreaSelectedListener (multicast), so one selection can feed aircraft, boats and weather together.
Aircraft1.Active := True; Boats1.Active := True; Weather1.Active := True;
Aircraft1.BeginAreaSelect; // draw on map → all three query their servers
Boats1.ApplyCoords(54.52, 18.65, 30); // Gdansk Bay, 30 km
if not Weather1.ApplyCoordsText(Edit1.Text) then ShowMessage('lat, lon[, km]');
Servers are area-scoped (area required, else HTTP 400): fly.imetroll.com/v1/states,
boatsea.imetroll.com/v1/states (lamin… | lat/lon/radius_km | area=; list: /v1/areas) and
weather.imetroll.com/v1/area (weather grid for an area; /v1/area/areas).
Demos: help.imetroll.com/demo/taircraft.html, tboats.html, tweather-area-select.html.