mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Blink layer after change visibility

Open MaciejPachciarekSMT opened this issue 3 years ago • 6 comments

Environment

  • Xcode version: 13.0
  • iOS version: 14.4
  • Devices affected: All
  • Maps SDK Version: 10.2.0

Observed behavior and steps to reproduce

We created SymbolLayer and we pass featureCollection as a data. We also have toggle buttons where user can change visibility of this layer. Whenever the user change toggle we change properties of this layer, however it looks like layer is refreshed twice. It looks strange. I tried to used two different approach for change visibility but both works in the same way:

mapView.mapboxMap.style.setLayerProperties(for: $0.id, properties: setting)

and

mapView.mapboxMap.style.updateLayer(withId: $0.id, type: SymbolLayer.self) { layer in layer.visibility = .constant(.visible) }

https://user-images.githubusercontent.com/24453199/153373514-5386a703-280a-459a-9d1c-09368efcbaa9.mov

Expected behavior

Layer should change visibility without strange blink

MaciejPachciarekSMT avatar Feb 10 '22 09:02 MaciejPachciarekSMT

@MaciejPachciarekSMT I am unable to reproduce this behavior. I have attached my screen recording below:

https://images.zenhubusercontent.com/330733892/232a41c9-4133-4d87-9385-6ec88d797893/simulator_screen_recording___iphone_11___2022_02_10_at_11_57_37.mp4

To better assist you, can you provide your view controller or a sample app that reproduces the behavior you're reporting?

ZiZasaurus avatar Feb 10 '22 17:02 ZiZasaurus

Hi @ZiZasaurus

Finally I found potential problem. When I have Layer with properties layer.iconAllowOverlap = .constant(true) sometimes icon blink. When I set it to false it works correctly. Can you check it once again and confirm it?

MaciejPachciarekSMT avatar Feb 14 '22 12:02 MaciejPachciarekSMT

@MaciejPachciarekSMT, thank you, I am able to confirm this behavior when layer.iconAllowOverlap = .constant(true) and will investigate the root cause.

ZiZasaurus avatar Feb 14 '22 14:02 ZiZasaurus

@MaciejPachciarekSMT, I get the desired result if I use layer.iconIgnoresPlacement = .constant(true). For the moment can you try to use this instead of iconAllowsOverlap?

ZiZasaurus avatar Feb 14 '22 17:02 ZiZasaurus

@ZiZasaurus, it works, thanks for workaround

MaciejPachciarekSMT avatar Feb 15 '22 12:02 MaciejPachciarekSMT

@ZiZasaurus We have noticed the same issue also in the Android SDK 10.4.1. A workaround for us is not really an option since we have a rather complex setup of layers. Do you have any idea on when we can expect a fix?

florianPOLARSTEPS avatar Apr 08 '22 09:04 florianPOLARSTEPS