leaflet.TileLayer.WMTS icon indicating copy to clipboard operation
leaflet.TileLayer.WMTS copied to clipboard

Plugin assumes syntax of GetTile from base (GetCapabilities) URL

Open tomchadwin opened this issue 7 years ago • 3 comments

I'm trying to use this to connect to https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml. That server's GetTile requests have the following syntax:

https://maps1.wien.gv.at/basemap/geolandbasemap/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png

I think that leaflet.TileLayer.WMTS assumes a key=val querystring structure. However, the above service expects the parameters as part of the URL path, not as querystring variables, so it doesn't work.

Is there a way of parsing the GetCapabilities string to get the correct GetTile syntax?

tomchadwin avatar Jan 18 '18 10:01 tomchadwin

Yes the WMTS standard support both KVP and REST resource methods. This plugin is only supporting the KVP request method at the moment.

palmerj avatar Feb 01 '18 21:02 palmerj

So ... any plans of fixing this? I just ran into the same issue and this basically means the library is useless to me. Which in turn means Leaflet is useless to me.

FrankyBoy avatar Dec 16 '19 10:12 FrankyBoy

I solved this issue by overwriting the way the URL is assembled in getTileUrl by changing the path from https://github.com/alexandre-melard/leaflet.TileLayer.WMTS/blob/d5d162d60cb204a0f9dbde2905d5d68c790faf16/leaflet-tilelayer-wmts-src.js#L59

to something like

    var tileUrl =
      url +
      this.wmtsParams.layer +
      "/" +
      this.wmtsParams.tilematrixset +
      "/" +
      ident +
      "/" +
      tilecol +
      "/" +
      tilerow;
    return tileUrl;

jnachtigall avatar Aug 28 '20 06:08 jnachtigall