maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.24k stars 639 forks source link

TMS endpoint #305

Open nafis042 opened 6 years ago

nafis042 commented 6 years ago

I want to add tms endpoint to the exisiting tileserver gl. from what I have learnt tms and xyz are basically same except the y value. so what i did when i got request i changed the y value in src/serve_data.js file to the following equation y = 2^z -y - 1. and i am using leaflet to render maps.here is how i call tile layer:

L.tileLayer('http://myserverurl/{z}/{x}/{-y}.png', { maxZoom: 20, }).addTo(mymap);

but the map that is rendered seems to be broken. Here is a screenshot link: https://ibb.co/kKvRWU

can anyone help me with this?

spatialillusions commented 6 years ago

I think this would be a bit tricky to implement in a simple way because of how similar to the ordinary endpoint the request is. Cant you just use the ordinary endpoint in Leaflet? I think that should work, since there isn't any problems using tile services from mapbox and similar in Leaflet.