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.

Updating a layer filter doesn't reload all tiles #8505

Closed

Description

@jonkan

Platform: iOS
Mapbox SDK version:master(3c91b6b)

Hi, I'm experiencing a bug where updating a layer filter (setting the NSPredicate in iOS) fails to update (or invalidate) a source that's currently not visible, causing it to show with the old filter when re-appering.

Steps to trigger behavior

Given a MGLVectorSource with minzoom=maxzoom=9 and a MGLLineStyleLayer with minzoom=9, maxzoom=13 and a filter/predicate A.

  1. Zoom map through zoom 9 -> 13 (layer rendered according to filter A) -> 14 (layer disappear as expected).
  2. Update the layer filter to filter B.
  3. Zooming back to 13 the layer still shows according to filter A, as opposed to filter B that was expected.

I found that in the void Style::relayout() tiles are only reloaded if the source is enabled which according to the comment is when "the source is used by any layers visible at the current zoom level". Removing the && source->baseImpl->enabled-part of the if-statement (i.e. reverting part of 9127299 "don't load tiles from sources that aren't used") does solve my issue.

Maybe @kkaefer have some ideas?

Activity

  1. added
    iOS
    on Mar 23, 2017
  2. added
    Core
    on Mar 23, 2017
  3. self-assigned this
    on Apr 5, 2017
  4. jfirebaugh commented on Apr 5, 2017

    @jfirebaugh
    Contributor

    Thanks for the detailed replication steps and diagnosis @jonkan -- you were exactly right. I've opened a pull request to fix this issue.

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

Metadata

Metadata

Assignees

Labels

CoreiOSruntime styling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions