RobertSasak / mbtiles-serve

Fast HTTP server serving tiles directly from mbtiles
MIT License
4 stars 1 forks source link

Do it support vector tiles #1

Closed anuragvohraec closed 1 year ago

anuragvohraec commented 2 years ago

hi Robert,

I tried this with raster based mbtiles and its working. But for vector mbtiles, it seems to be not working. Just getting empty tiles.

Do it supports vector tiles or only raster tiles.

RobertSasak commented 2 years ago

This library serves whatever it in the mbtiles. It does not matter whether it is raster or vector tile. Can you please provide some simple test case?

anuragvohraec commented 2 years ago

I extracted mbtiles for my city, from : https://extract.bbbike.org/, And then ran mbtiles-serve ashta.mbtiles, but the map loads as blank: image

Adding the mbtiles file for your reference: ashta.mbtiles.zip I have added just *.zip to upload it here, just rename it by removing .zip from its name.

I have tried it with raster based mbtiles files (created from tilemill) and it works fine. Do you have a link to vector based tiles, which works with this.

Thank you for your help.

RobertSasak commented 2 years ago

MBtiles is a databases of tiles. In your case it stores tiles in MVT format. Those tiles are served to the browser. However Leafletjs nor browser does not know how to show MVT file.

You have two options: You can try to add https://github.com/SpatialServer/Leaflet.MapboxVectorTile plugin into leaflet which provides support for MVT. Simply edit assets/index.html Or you can try another MapboxGL instead of LeafletJS. https://docs.mapbox.com/mapbox-gl-js/example/third-party/

Let me know it you manage to make it work. It would be great to add it to this library.

anuragvohraec commented 2 years ago

Let me know it you manage to make it work.

I have left for tha day, I will try your suggestions tomorrow and let you know.

anuragvohraec commented 2 years ago

Hi Robert,

Your example code uses leaflet >1.0, and hence tried using other solutions, as suggested here without success. https://leafletjs.com/plugins.html#vector-tiles

RobertSasak commented 1 year ago

Image tiles are easy to show on map. However Vector tiles requires styles as well which are not part of the mbtiles. This library can still serve vector tiles but you need to create your own html client.