I have downloaded many vector tiles in the mbtiles format from OpenMapTiles. The reason I did that is because I will be using them on a station that cannot have an internet connection at all.
I would like in the end to see these tiles with leaflet on a browser, but it seems that the plugin for leaflet only considers raster-based tiles and not vector-based tiles, or so I thought until I saw Loading vector tile layer in Leaflet map? here on GIS. However, it seems to be outdated and the JSFiddle doesn't work anymore... So I figured I would try it out myself, but it did not work. So I am currently inclined to think that this plugin only works with raster tiles and not vector ones.
I also considered then converting my tiles to PNG so that I could use them with leaflet and used mbutils for that, as suggested on GIS at Finding good Mbtiles to png tiles converter? but obviously none of the generated PNGs are readable by my OS or leaflet as mbutils doesn't raster them.
I have two questions depending on how you advise me:
- Is it possible to read vector tiles with leaflet?
- If not, how is it possible to convert them to raster?
I cannot use commercial services like maptobox or any similar services, this the reason why I was trying to have everything running on my machine right away.
I have seen before the vector grid from leaflet. It says that it can read vector-tile files but when you click on it to get the documentation it says:
This library reads Mapbox Vector Tiles and allows access to the layers and features.
As for the Leaflet.TileLayer the documentation says that TileLayer is for rasters.
VectorGrid leverages the GridLayer feature introduced in Leaflet 1.0.0. from the first link
– Bill Chappell Aug 14 '18 at 18:36Had an issue with mime type, because IIS couldn't see the mbtiles file, set it as application/x-protobuf and it worked for their sample data but not yours. There is some discussion on-line about this, this may be part of the problem.
– Bill Chappell Aug 15 '18 at 13:23