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

carplay's street names blink on mapbox maps

Open rahulpatracropsly opened this issue 1 year ago • 8 comments

Environment

  • Xcode version: 15.3
  • iOS version: 17.4.1
  • Devices affected: CarPlay App
  • Maps SDK Version: 11.3.0

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

rahulpatracropsly avatar May 21 '24 10:05 rahulpatracropsly

Hi @rahulpatracropsly, thank you for reporting this! Use MapboxMap.beginAnimation() to improve label placement during an animation, it should be balanced with MapboxMap.endAnimation() after the animation ends.

evil159 avatar Jun 03 '24 09:06 evil159

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

evil159 avatar Jun 03 '24 09:06 evil159

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)

rahulpatracropsly avatar Jun 05 '24 11:06 rahulpatracropsly

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.

evil159 avatar Jun 05 '24 12:06 evil159

Thank you @evil159 for your suggestion.

I tried implementing the FollowPuckViewportState as you recommended, but unfortunately, the camera animation is not smooth, and road names continue to blink while zooming in and out or moving the camera.

Here’s the code I’ve been using:

let updatedOptions = FollowPuckViewportStateOptions(
    padding: padding,
    zoom: lastZoomLevel,
    bearing: mapView.cameraState.bearing,
    pitch: 45.0
)
self.followPuckState = self.mapView.viewport.makeFollowPuckViewportState(options: updatedOptions)
mapView.viewport.transition(to: followPuckState)

I'm looking for smoother camera transitions without the road name blinking issue. Do you have any further recommendations to address this?

rahulpatracropsly avatar Sep 19 '24 11:09 rahulpatracropsly

Hi @evil159, I'm still encountering the issue where road names blink or flicker during map navigation. I'm particularly looking for smoother camera transitions that prevent this road name blinking problem. Do you have any further recommendations or insights to help resolve this issue?

https://github.com/user-attachments/assets/6fcecd22-35ea-42db-9ac2-f479ec73854a

rahulpatracropsly avatar Oct 03 '24 06:10 rahulpatracropsly

Hi @rahulpatracropsly, sorry for the delayed response, yeah the symbols should not behave this way during animations, we can't reproduce the issue on our side, it would help us a great deal if you could provide a sample project demonstrating this issue.

evil159 avatar Oct 03 '24 06:10 evil159

Hi @evil159 Thank you for your suggestion! I tried several approaches to improve the frequent camera animations, and after adding a delay to the camera animation, the issue was resolved.

rahulpatracropsly avatar Oct 10 '24 11:10 rahulpatracropsly