fmx WebOsMaps offline

Hi all,
I'm new to  this compnent but I developped an Android App (with Dellphi 10.2 Tokyo) that need to sho an offline (no internet use) map of a limited zone (1 square km)

I don't know how to use the a local copy of the map (I have the osm file)

Can anyone please help me?

Thank you


Pietro Ruvolo

Hi,


Please note that there is currently no support for offline maps in TMS WebOSMaps.
Hi , Thank you for your answer,
can you at least explain to me how to configure fhe MapOption.TilesURL property in order to read PNG files already on the disk?

Usage of the TileServerUrl property is explained in the PDF manual available from the product page: https://www.tmssoftware.com/site/webosmaps.asp


Note that this property is intended to be used with webserver URLs only. You might want to try if it works with local path as well.
In fact, there is the way to run TMS WebOSMaps in offline mode.
Of course you need to have your local tile server, but not only.

Developers are decide to stay this kind of strange hardcode inside of component:


  remoteCSS := 'http://openlayers.org/api/theme/default/style.css';
  {$IFDEF MSWINDOWS}
  remoteJS := 'http://www.tmssoftware.biz/webosmaps/OpenLayers.js';
  {$ELSE}
  remoteJS := 'http://openlayers.org/api/OpenLayers.js';
  {$ENDIF}
  remoteIMG := 'http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/';


It means, you also need to have your local web-server with support code above, and deceive your operating system like that:

#file hosts
[your_local_web_server] www.tmssoftware.biz
[your_local_web_server] dev.openlayers.org
[your_local_web_server] openlayers.org


I do not understand why the developers did not specify it in the documentation.

Hi,


To use a custom URL for the OpenLayers JS library you can use the MapOptions.ScriptURL property.
Usage of the ScriptURL property is explained in the TMS VCL WebOSMaps PDF manual under the "TWebOSMaps.MapOptions properties" topic.
I think,We can use offline mapping ,you need to download maptile first , save it in your disk, then you can set  TileServerURL by yourself ,i tested it succefull on Windows ,example :
 TMSFMXWebOSMaps1.MapOptions.TileServerURL.Add('file://C:/Users/Administrator/Pictures/map/maptile/googlemaps/hybrid/${z}/${x}/${y}.jpg');
or TMSFMXWebOSMaps1.MapOptions.TileServerURL.Add('C:\\Users\\Administrator\\Pictures\\map\\maptile\\googlemaps\\hybrid\\${z}\\${x}\\${y}.jpg');