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

View annotations disappear with some camera states

Open ittna opened this issue 2 years ago • 4 comments

Environment

  • Xcode version: 15.3
  • iOS version: 17.4
  • Devices affected: iPhone 15 Pro
  • Maps SDK Version: 11.2.0

Observed behavior and steps to reproduce

In our app we show map pins as view annotations because we want to animate our pins. In tilted map view (pitch > 0) there seems to be bug that with some map rotations view annotations get hidden.

https://github.com/mapbox/mapbox-maps-ios/assets/2304597/5bfd825e-1e81-4fa5-84cf-63cb597a47c2

Expected behavior

View annotations should be visible when they are in the camera frustum.

Notes / preliminary analysis

As I understand view annotations are not drawn when they are offscreen. Maybe problem is that camera transformation doesn't correctly project visible area.

ittna avatar Mar 18 '24 15:03 ittna

@ittna Do you use camera padding?

You can try change the allowOverlap/allowOverlapWithPuck/ignoreCameraPadding https://docs.mapbox.com/ios/maps/api/11.2.0/documentation/mapboxmaps/viewannotation that may help to debug the issue.

persidskiy avatar Mar 22 '24 14:03 persidskiy

@persidskiy Yes, I am using camera padding. ignoreCameraPadding doesn't fix this issue though. But I think I will use it as it will allow showing view annotations on the edges of the viewport.

Surprisingly allowOverlapWithPuck fixes this issue. It's odd as my location puck is in Finland i.e. not anywhere near New York where my view annotations are. But I guess I should have this on anyway as user could be near my annotations and I want my annotations to show in that case also.

ittna avatar Mar 25 '24 08:03 ittna