Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Closed

Description

@jfirebaugh

Followup from #6201.

Activity

  1. jfirebaugh commented on Sep 13, 2016

    @jfirebaugh
    ContributorAuthor

    GeoJSON tile reloading will be similar to reloading for style changes in #6201, but also different.

    The pathway for reloading for style changes is:

    1. A layout property or layer filter is changed
    2. Triggering LayerObserver::onLayer{Filter,Visibility}Changed
    3. Triggering Style::onLayer{Filter,Visibility}Changed
    4. Style queues the layer source ID in updateBatch.sourceIDs and triggers style::Observer::onUpdate with Update::Layout
    5. Map::Impl::onUpdate adds Update::Layout and triggers an asyncUpdate signal (if not already triggered)
    6. The signal is processed; Map::Impl::update is called
    7. Triggering Style::relayout
    8. Loop over updateBatch.sourceIDs, calling Source::Impl::reloadTiles for each
    9. Source::Impl::reloadTiles loops over tiles, calling Tile::redoLayout for each
    10. 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.

  2. tobrun commented on Sep 15, 2016

    @tobrun
    Member

    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:

    ezgif com-video-to-gif 5

    Which is the equivalent of the GL-JS example here.

  3. tobrun commented on Sep 21, 2016

    @tobrun
    Member

    @jfirebaugh would you like to see the improved version happening?
    (implementing the observer approach with batching)

  4. jfirebaugh commented on Sep 21, 2016

    @jfirebaugh
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions