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 has been archived by the owner on Aug 8, 2023. It is now read-only.
It would be useful to have a callback when collision detection has run. This could be a new RendererObserver function or an additional parameter to onDidFinishRenderingFrame (proof of concept by @pozdnyakov here: #15440).
This can be useful after camera changes, when the developer then wants to query features (e.g. annotations) in the camera change completion callback/block (for example see @astojilj's comment here).
This can be useful after camera changes, when the developer then wants to query features
How does a a developer know when to and when not to depend on this new callback? If a style has no symbol layer, it would never invoke this callback. It makes it hard to write generic code to do this after a camera change is complete because it requires knowing if the style currently loaded has symbol layers
This is a good point - I was thinking that we would need a separate iOS delegate method anyway (referencing "collision detection" isn't particularly user friendly), so that logic could potentially check for symbol layers. Do you think that would be sufficient @asheemmamoowala@pozdnyakov?
This would be a great feature for my use case on iOS. I'm drawing features in a symbol layer that all have iconAllowsOverlap set to false. I also have a UI component on screen that corresponds to each of the visible features in that style layer. To draw this custom component, I need to know which features are going to be hidden by the SDK's collision detection and which will be visible.
The delegate mapViewDidBecomeIdle: is reliable, but its execution can be delayed. Since there isn't a fast callback for this case, my solution was to create a timer that executes visibleFeaturesInRect:inStyleLayersWithIdentifiers: a few times every second after adding the style layer.
This solution isn't super clean. A callback would make things much better.
It would be useful to have a callback when collision detection has run. This could be a new
RendererObserver
function or an additional parameter toonDidFinishRenderingFrame
(proof of concept by @pozdnyakov here: #15440).This can be useful after camera changes, when the developer then wants to query features (e.g. annotations) in the camera change completion callback/block (for example see @astojilj's comment here).
/cc @tobrun
The text was updated successfully, but these errors were encountered: