Open cyrilchapon opened 1 year ago
@cyrilchapon Were you able to find a solution? I'm facing something similar
@sharathprabhal yes, check implementation here :
Edit: In a nutshell, you have to gzip the tile after encoding it to PBF
@sharathprabhal yes, check implementation here :
Edit: In a nutshell, you have to gzip the tile after encoding it to PBF
Thank you so much for the quick reply. It saved me a ton of time!
Context
I'm trying to serve a dynamic vector tiles routes from MongoDB documents.
I have some data in a mongodb, which — after some complex query — I am aggregating into a GeoJSON feature collection that looks like this :
I'm building server side a tile index with
geojson-vt
like so :Later, in an express handler, I'm serving tiles like so :
I bound this to a route like so
And am calling this in mapbox-gl (with react-map-gl) like so :
Issue
MapboxGL is complaining in frontend :
Which obviously tells pbf is malformed
Here are some logs :
jsonTile
pbfTile