Mapbox-gl-native: Updating a layer filter doesn't reload all tiles

Created on 23 Mar 2017  路  1Comment  路  Source: mapbox/mapbox-gl-native

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?

Core iOS runtime styling

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings