You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The work Mapbox has done on vector tiles is just amazing, and it will for sure change how web based maps are done for years to come.
That being said, while vector tiles is a given for static to fairly static (when considering individual tiles) data sets (such as OSM) I wonder how flexible one can make use of vector tiles for more dynamic data sets, where data changes fairly often, but still far from in real-time.
I have several mapping application where I perform the classic map.on("moveend", fetchData(map.bbox())) to fetch GeoJSON based on user interaction. The downside is I often fetch a lot of the same data (this could of course be adressed with various techniques), and it's really hard to implement caching; every query is unique. Today I mainly solve this with geospatial indexes (PostGIS and Elasticsearch).
I was thinking about the possibility of using vector tiles for more dynamic data sets, where caching becomes more of an issue of invalidating vector tiles server side. The problem I see, and what I would hope for an answer for with this issue, is how flexible things are on the receiving end (i.e. mapbox.gl.js) when tiles tend to change a lot. I've noticed that I can set cacheSize to 0 on a vector tile source, but I am afraid the web browser won't fetch new tiles for every request anyway (could perhaps be mitigated with a set of HTTP headers).
Would you deem it insane to use vector tiles like this? For .. say .. a point layer with a point here and there being created every hour or so...
Could perhaps cacheSize be complemented with a cacheTimeout? ...
Can the tile cache be invalidated via the API btw? Or must I remove and add the source to accomplish that?
The text was updated successfully, but these errors were encountered:
Thank you for taking the time to write this all out @averas! It sounds like you are asking a few separate questions in this issue:
Is there an efficient way to reuse GeoJSON?
This is a very implementation-specific question. My general advice would be to download the data as GeoJSON once do as much processing as possible clientside. mapbox-gl-js can handle huge GeoJSON files, turning them into efficient vector tiles internally. You might find Turf.js useful.
Is it reasonable to build a vector tile set every hour?
If you can build the tile set fast enough, sure! Using GeoJSON as described above is going to be a simpler solution, so try that first.
Should we support a cache timeout in mapbox-gl-js?
Yes. We respect HTTP cache headers in mapbox-gl-native (mapbox/mapbox-gl-native#2617). This feature should be ported to mapbox-gl-js.
The work Mapbox has done on vector tiles is just amazing, and it will for sure change how web based maps are done for years to come.
That being said, while vector tiles is a given for static to fairly static (when considering individual tiles) data sets (such as OSM) I wonder how flexible one can make use of vector tiles for more dynamic data sets, where data changes fairly often, but still far from in real-time.
I have several mapping application where I perform the classic map.on("moveend", fetchData(map.bbox())) to fetch GeoJSON based on user interaction. The downside is I often fetch a lot of the same data (this could of course be adressed with various techniques), and it's really hard to implement caching; every query is unique. Today I mainly solve this with geospatial indexes (PostGIS and Elasticsearch).
I was thinking about the possibility of using vector tiles for more dynamic data sets, where caching becomes more of an issue of invalidating vector tiles server side. The problem I see, and what I would hope for an answer for with this issue, is how flexible things are on the receiving end (i.e. mapbox.gl.js) when tiles tend to change a lot. I've noticed that I can set cacheSize to 0 on a vector tile source, but I am afraid the web browser won't fetch new tiles for every request anyway (could perhaps be mitigated with a set of HTTP headers).
Would you deem it insane to use vector tiles like this? For .. say .. a point layer with a point here and there being created every hour or so...
Could perhaps cacheSize be complemented with a cacheTimeout? ...
Can the tile cache be invalidated via the API btw? Or must I remove and add the source to accomplish that?
The text was updated successfully, but these errors were encountered: