Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Rendering Issue: Blurry View After Viewport Update #2292

Open
Hammad335 opened this issue Feb 18, 2025 · 0 comments
Open

Map Rendering Issue: Blurry View After Viewport Update #2292

Hammad335 opened this issue Feb 18, 2025 · 0 comments
Labels
bug 🪲 Something is broken!

Comments

@Hammad335
Copy link

Environment

  • Xcode version: 16.1
  • iOS version: 18.1
  • Devices affected:
  • Maps SDK Version: 11.8.0

Observed behavior and steps to reproduce

In my iOS app, users can search for a location and tap on any search result. Upon tapping, the map animates to center on the selected location by adjusting the viewport. However, sometimes after the animation completes, the map appears blurred even though the user is at the correct location. The blur disappears when the user interacts with the map, such as by zooming in or out.

Video Demonstration of Issue: In this video, I searched for multiple locations. Notice that when I search for and animate to 'Cuba', the map appears blurred after the animation. The blur disappears once I interact with the map.

Screen.Recording.2025-02-18.at.12.1k2.50.PM.mp4

Code Snippet:

MapReader { _ in
            Map(viewport: $viewport)
            
                // MARK: - for places update camera
                .onChange(of: updateCoordinate) { _ in
                    if let coordinates = selectedCoordinates {
                        // Step 1: Zoom out and rotate the globe
                        withViewportAnimation(.easeInOut(duration: 1.5)) {
                            viewport = .camera(
                                center: CLLocationCoordinate2D(
                                    latitude: coordinates.latitude,
                                    longitude: coordinates.longitude
                                ), // Roughly set the direction
                                zoom: 2,
                                bearing: 0
                            )
                        }
                        // Roughly set the direction
                        // detach from the plane if the animation is in progress
                        DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
                            withViewportAnimation(.easeInOut(duration: 2)) {
                                viewport = .camera(
                                    center: CLLocationCoordinate2D(
                                        latitude: coordinates.latitude,
                                        longitude: coordinates.longitude
                                    ),
                                    zoom: 12,
                                    bearing: 0
                                )
                            }
                        }
                    }
                }
        }

Expected behavior

Once the animation completes, the map should appear clear and sharp without requiring any user interaction.

@Hammad335 Hammad335 added the bug 🪲 Something is broken! label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken!
Projects
None yet
Development

No branches or pull requests

1 participant