Reputation: 320
I have a mapping application that uses Mapbox.com to serve vector tiles of uk postcode boundaries. The boundary files are large and are not suited for download using something like TopoJSON. This works beautifully.
I am also using data driven styles to format the look and feel of the map. I now want to display user specific data ontop of the shared boundary data. From what I can tell, I will need to serve up individual vector tiles generated from the users data rather than project their data onto the existing tile-fetched vector data. I can't create a unique vector tile set in Mapbox for all the users.
It seems a waste of bandwidth re-fetching the geometric information when only the properties has changed, is it possible to somehow 'project' a session specific set of properties onto the fetched data?
Upvotes: 4
Views: 2001
Reputation: 1691
It seems mapbox/tile-decorator allows you to modify the tile data client-side:
A JavaScript module for decoding Mapbox vector tiles, doing various modifications in JS and reencoding back
This would allow you to merge user data with your tile data.
Disclaimer: I haven't tried it. But they specifically mention the question's use case:
It can:
- add new properties to a layer (updateLayerProperties)
- ...
Upvotes: 1
Reputation: 3802
It sounds like the best solution to your problem may be adding a GeoJSON source containing per-user data in addition to the vector tile source containing postal code boundaries. You may add an unlimited number of sources to any map.
Upvotes: 1