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
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Reload source tiles when GeoJSON data is mutated #6264
Style queues the layer source ID in updateBatch.sourceIDs and triggers style::Observer::onUpdate with Update::Layout
Map::Impl::onUpdate adds Update::Layout and triggers an asyncUpdate signal (if not already triggered)
The signal is processed; Map::Impl::update is called
Triggering Style::relayout
Loop over updateBatch.sourceIDs, calling Source::Impl::reloadTiles for each
Source::Impl::reloadTiles loops over tiles, calling Tile::redoLayout for each
Which is overridden in GeometryTile::redoLayout to trigger the workers to reprocess with a new copy of the style layers
All this only handles changes to style layers. It's fairly complex in order to support batching multiple updates into a single redoLayout operation. For GeoJSON data changes, maybe we can get away without batching, and instead just add a loop over tiles in GeoJSONSource::Impl::setGeoJSON, calling GeometryTile::setData on each one with the new data.
I have been working with @mollymerp to get this feature in.
We were able to get the the following working:
For GeoJSON data changes, maybe we can get away without batching, and instead just add a loop over tiles in GeoJSONSource::Impl::setGeoJSON, calling GeometryTile::setData on each one with the new data.
An example of this can be seen in:
Which is the equivalent of the GL-JS example here.
Activity
jfirebaugh commentedon Sep 13, 2016
GeoJSON tile reloading will be similar to reloading for style changes in #6201, but also different.
The pathway for reloading for style changes is:
LayerObserver::onLayer{Filter,Visibility}ChangedStyle::onLayer{Filter,Visibility}ChangedupdateBatch.sourceIDsand triggersstyle::Observer::onUpdatewithUpdate::LayoutMap::Impl::onUpdateaddsUpdate::Layoutand triggers an asyncUpdate signal (if not already triggered)Map::Impl::updateis calledStyle::relayoutupdateBatch.sourceIDs, callingSource::Impl::reloadTilesfor eachSource::Impl::reloadTilesloops over tiles, callingTile::redoLayoutfor eachGeometryTile::redoLayoutto trigger the workers to reprocess with a new copy of the style layersAll this only handles changes to style layers. It's fairly complex in order to support batching multiple updates into a single
redoLayoutoperation. For GeoJSON data changes, maybe we can get away without batching, and instead just add a loop over tiles inGeoJSONSource::Impl::setGeoJSON, callingGeometryTile::setDataon each one with the new data.tobrun commentedon Sep 15, 2016
I have been working with @mollymerp to get this feature in.
We were able to get the the following working:
An example of this can be seen in:
Which is the equivalent of the GL-JS example here.
tobrun commentedon Sep 21, 2016
@jfirebaugh would you like to see the improved version happening?
(implementing the observer approach with batching)
jfirebaugh commentedon Sep 21, 2016