alexandre-melard / leaflet.TileLayer.WMTS

Add WMTS layering for leaflet
Other
78 stars 84 forks source link

Plugin assumes a prefix on TileMatrix parameter #24

Open jimsafley opened 4 years ago

jimsafley commented 4 years ago

This line in getTileUrl() assumes that the WMTS service recognizes a prefix on the TileMatrix parameter:

var tilematrix = this.wmtsParams.tilematrixset + ":" + ident;

The service I'm working with does not recognize a prefix, as you see:

https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/?layer=0&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=6&TileCol=16&TileRow=24

Note that TileMatrix is set to 6 and not to EPSG:3857:6, which this plugin sets automatically.

jimsafley commented 4 years ago

The WMTS implementation standard does not specify a format for the TileMatrix identifier (beyond being an ows:CodeType). This plugin seems to assume that the TileMatrix identifier will always be <TileMatrixSet identifier>:<TileMatrix identifier>