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

Puck and annotation view

Open Eke opened this issue 3 years ago • 6 comments

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 avatar Feb 23 '22 06:02 Eke

@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.

Simulator Screen Shot - iPhone 11 - 2022-02-23 at 09.42.39.png

ZiZasaurus avatar Feb 23 '22 14:02 ZiZasaurus

@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.

Eke avatar Feb 23 '22 14:02 Eke

Grooming meeting note: Not sure if bug or feature. Moving to planning backlog for further triage.

A8Starkov avatar Feb 28 '22 15:02 A8Starkov

@eke just wanted to clarify, when you refer to annotation view are you referring to ViewAnnotations or Point/Circle/Polyline Annotations?

ZiZasaurus avatar Feb 28 '22 15:02 ZiZasaurus

@ZiZasaurus sorry for late answer. I am referring to ViewAnnotations

Eke avatar Mar 08 '22 05:03 Eke

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…

  1. Use regular annotations instead of view annotations, or
  2. 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.

macdrevx avatar Apr 19 '22 19:04 macdrevx