Simple Example for how to use Tile Layers with external TMS Server

Hi,
I have an even more basic question than asked in TileServer example

I'd like to offer - if possible - the user the opportunity to overlay an open street map with layers from different location available in TMS format. Ideally also WMS. But I just learned from another support request that this is currently not supported.
My question: I have a TTMSFNCMaps object and would like to add layers to it as indicated here
TTMSFNCMaps - TMS FNC Maps and in the above mentioned support request, but I struggle to locate the Options.TileServer property/field which is mentioned. In my TTMSFNCMaps object there is an Options object, but it doesn't have a 'TileServer' field. Can you help me out, ideally with a bit of example code?
Thanks a lot!

Hi,

The TileServer property is only available in the TTMSFNCOpenLayers component.

Example:

TMSFNCOpenLayers1.Options.TileServer := 'https://www.domain.com/tile/{z}/{y}/{x}';

Please note that using a tileserver will replace the entire map.

To add layers on top of the existing map you can use TileLayers.

Example:

  TMSFNCOpenLayers1.BeginUpdate;
  TMSFNCOpenLayers1.AddTileLayer('https://www.domain.com/layer/{z}/{x}/{y}');
  TMSFNCOpenLayers1.EndUpdate;

Ah, thanks! I didn't get that TMSFNCOpenLayers is a map component itself. Thanks! Your code works with an example tile server.

Happy to help!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.