Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin assumes syntax of GetTile from base (GetCapabilities) URL #17

Open
tomchadwin opened this issue Jan 18, 2018 · 3 comments
Open

Comments

@tomchadwin
Copy link

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?

@palmerj
Copy link

palmerj commented Feb 1, 2018

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

@FrankyBoy
Copy link

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.

@jnachtigall
Copy link

I solved this issue by overwriting the way the URL is assembled in getTileUrl by changing the path from

return url + L.Util.getParamString(this.wmtsParams, url) + "&tilematrix=" + tilematrix + "&tilerow=" + tilerow +"&tilecol=" + tilecol;

to something like

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants