My data consists of many elements and attibutes, so I can't send entire json
to client-side
because it's too slow reading and displaying data.
At this point I need to make tiles from data. I have worked with tippecanoe, and it's so good but it "only" generates *.mbtiles (vector data inside *.pbf), and Leaflet 1.0.2 can't work with this format, so I tried to extract into zoom folders z/x/y with mbutil, but it seems that resulted *.pbf tiles are not correct because I've tried with Mapbox gl js and doesn't work well.
So first question is:
someone know how can I generate *.pbf tiles correctly from geojson files? I've tried some of options showed here: awesome-vector-tiles
And someone know if there's some plugin for Leaflet 1.0.2 that can work with vector tiles in *.mbtiles, *.pbf or *.json?
I've tried with mapbox-gl-leaflet, vectorgrid and tangram.
Thank you very much for your help
Leaflet doesn't support vector tiles by default. For basemaps, it is recommended to use it with traditional raster tiles (Mercator XYZ). Such tiles can be generated on demand for any of the GL styles with the open-source server software called TileServer GL.
Polygon. Step 1 − Create a Map object by passing a <div> element (String or object) and map options (optional). Step 2 − Create a Layer object by passing the URL of the desired tile. Step 3 − Add the layer object to the map using the addLayer() method of the Map class.
Vector tile package file size is 500 GB or greaterSign in to your organization and open Content > My Content. You must have privileges to publish hosted tile layers. Click your tile package to display its item details page and click Publish.
You can serve Mapbox vector tiles from a Tippecanoe generated .mbtiles
file using TileServer-GL. Using Docker makes this task even easier.
Assuming you have already generated a file called geo.mbtiles
using Tippecanoe in your current directory:
docker run -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl geo.mbtiles
This will spin up a server, and it will give you an endpoint that serves .pbf
vector tiles. These can be rendered with Mapbox GL, Leaflet.VectorGrid, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With