mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Puck and annotation view
Environment
- Xcode version: 13.2
- iOS version: 15.3
- Devices affected: iPhone XS real device
- Maps SDK Version: v10.3.0
Observed behavior and steps to reproduce
Can't 100% say that's a bug, but 2D Puck get's hidden under annotation view. Just add annotation view to the same location as puck has.
Expected behavior
Puck must stay visible as I think it's more important thing than annotation.
@Eke, can you please add the point annotation to the map before the location puck is added? When I do this I do not experience that behavior.
@ZiZasaurus I can try it, but that's not an option for us, unfortunately. We are using custom annotation views which are placed on the map dynamically while user is moving around.
Grooming meeting note: Not sure if bug or feature. Moving to planning backlog for further triage.
@eke just wanted to clarify, when you refer to annotation view are you referring to ViewAnnotations or Point/Circle/Polyline Annotations?
@ZiZasaurus sorry for late answer. I am referring to ViewAnnotations
The 2D and 3D pucks are rendered into the MapView's metal view, and view annotations are just UIView subclasses on top of the metal view, so this is working as designed, although the design could certainly be improved.
One solution here could be to add a 3rd location puck option that would be built on top of view annotations so that you could have a view-based puck managed by the MapView.
For now, you'd need to either…
- Use regular annotations instead of view annotations, or
- Do a custom, view-based puck implementation.
For 2, you could add a view annotation to represent the puck, observe location changes, and update its position when the location changes. 2D and 3D pucks animate these changes so that the puck updates smoothly, and you could do something similar if needed using CADisplayLink.