Blog
All Blog Posts | Next Post | Previous PostOffline maps in TMS FNC Maps for Delphi
Tuesday, February 21, 2023
This feature is available now for TTMSFNCOpenLayers in TMS FNC Maps.
- Local map tiles
- Local tile server
- Local OpenLayers API library
There are different sources available for both map tiles and tile servers. In this example we're going to use MapTiler for both.
Local map tiles
Map tiles contain the data needed to display the map. In this example we will use the sample map tiles included with MapTiler Server. Other map tiles are available from MapTiler Data as mbtiles files.
Local tile server
A tile server is needed to provide the correct map tiles that get requested by the map service. In this example we will use MapTiler Server.
Steps to configure MapTiler Server:
- Download and install MapTiler Server
During installation, make sure to note the port number for the server to run on and set the password you want to use. - Login to the MapTiler Server admin page
Point your browser to the server admin page at "http://localhost:3650/admin" (replace the port number if you selected a different one during install) and enter the password to login. - Add the mbtiles file containing the map tiles
Go to the "Tiles" tab. Click the "new tiles" button to add an mbtiles file, or use the sample data that is available by default.
In this example we're going to use the sample data. - Get the tile server URL
Go to the "Maps" tab. Here you can select the style that is used to display the map. There are a number of different map styles available by default. In this example we're going to use the Basic style so select the "Basic" item.
There are a number of different URL types available. For the TTMSFNCOpenLayers TileServer URL you can use the XYZ URL. The XYZ URL is displayed in the "Map service (raster tiles)" topic.
Local OpenLayers API library
To configure TTMSFNCOpenLayers for offline use:
- Set LibraryLocation to llOffline
This will automatically generate a copy of the OpenLayers API JavaScript library in a temporary folder and use that to display the map. - Set a local TileServer URL
Enter the XYZ URL retrieved from the MapTiler Server admin page here.
Example
TMSFNCOpenLayers1.LibraryLocation := llOffline; TMSFNCOpenLayers1.Options.TileServer := 'http://localhost:3650/api/maps/basic/{z}/{x}/{y}.png';
Available Now
The TMS FNC Maps update is available now for Delphi & Visual Studio Code (with TMS WEB Core). You can download the latest version and start using the new features right away!
Bart Holvoet
This blog post has received 2 comments.
DERNEGI CANSUYU
All Blog Posts | Next Post | Previous Post
I''m really interested in from 25N to 65N and 0 to 80W (i.e. the North Atlantic oceanic crossings). Would I be better with just specific tiles rather than the full planet (maptiles-osm-2020-10-v3.11-planet.mbtiles) if I decide this is the right option?
I''d like Lat/Long graticule lines (1 degree for Lat, 10 degree for Long), is this possible via a property setting? Is changing the ocean colour possible?
Do you recommend some other tutorials to plot areas and also plot routes?
Stephen