alexandre-melard / leaflet.TileLayer.WMTS

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

Tiles are misaligned on zoom level 19 using the default matrixIds #2

Closed flansch closed 9 years ago

flansch commented 9 years ago

When using the matrixIds provided by the getDefaultMatrix function, the tiles are shifted by one tile to the right when displaying zoom level 19. It seems that the values for the topLeftCorner are not exact enough. Using topLeftCorner : new L.LatLng(20037508.3428,-20037508.3428) instead of topLeftCorner : new L.LatLng(20037508,-20037508) solves the problem for me. Unfortunately I don't know where I originally had the number 20037508.3428 from, but searching the web for it shows, that this more exact value is widely used.

Example: Zoom 18 image

Zoom 19 image

alexandre-melard commented 9 years ago

Thank you for your input, I'm going to give it a look next week

alexandre-melard commented 9 years ago

You're right, google and OGC use EPSG:3857 as TMS for their WMTS projections.

"topLeftCorner": [ -20037508.3428, 20037508.3428 ],