mapbox / mapbox-maps-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and Metal
https://www.mapbox.com/mapbox-mobile-sdk
Other
453 stars 149 forks source link

carplay's street names blink on mapbox maps #2186

Open rahulpatracropsly opened 1 month ago

rahulpatracropsly commented 1 month ago

Environment

Observed behavior and steps to reproduce

carplay's street names blink continuously on carplay app

https://github.com/mapbox/mapbox-maps-ios/assets/113577007/c7d52b9a-9456-45a4-9499-61112701adab

Expected behavior

Expected behavior - it should not be blinking street names continuously

Notes / preliminary analysis

Additional links and references

evil159 commented 1 month ago

Hi @rahulpatracropsly, thank you for reporting this! Use [MapboxMap.beginAnimation()](https://docs.mapbox.com/ios/maps/api/11.4.0/documentation/mapboxmaps/mapboxmap/beginanimation()) to improve label placement during an animation, it should be balanced with [MapboxMap.endAnimation()](https://docs.mapbox.com/ios/maps/api/11.4.0/documentation/mapboxmaps/mapboxmap/endanimation()) after the animation ends.

evil159 commented 1 month ago

Could you post a code that you use for camera animation?

rahulpatracropsly commented 1 month ago

hi @evil159 thanks for replying! here is my code which i'm using for animate the camera

let newCamera = CameraOptions(center: coordinate,
                                                  padding: padding,
                                                  zoom: lastZoomLevel,
                                                  bearing: CLLocationDirection(floatLiteral: newHeading),
                                                  pitch: newPitch)
mapView.camera.fly(to: newCamera, duration: 1.0)
evil159 commented 1 month ago

Thank you for the code @rahulpatracropsly, if I understood your setup correctly, the issue is that you are performing a series of 1 second animations, you'd be better served with one continuous animation. If your goal is for camera to follow the location puck I can suggest using viewport API, namely FollowPuckViewportState.