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

SwiftUI - Stuttering Zoom Animation #2246

Open
thomas-hensel opened this issue Oct 2, 2024 · 0 comments
Open

SwiftUI - Stuttering Zoom Animation #2246

thomas-hensel opened this issue Oct 2, 2024 · 0 comments
Labels
bug 🪲 Something is broken!

Comments

@thomas-hensel
Copy link

Environment

  • Xcode version: 16.0
  • iOS version: 18.0
  • Devices affected: Simulator
  • Maps SDK Version: v11.7.0

Observed behavior and steps to reproduce

I changed SimpleMapExample like this and observe a strange "stuttering" Zoom Animation when taping on the map

@available(iOS 14.0, *)
struct SimpleMapExample: View {
@Environment(.colorScheme) var colorScheme
@State var isEnlarged: Bool = false

var body: some View {
    let polygon = Polygon(center: .helsinki, radius: 10000, vertices: 30)
    VStack {
        HStack {
            Spacer()
            Map(initialViewport: .overview(geometry: polygon))
                .mapStyle(.standard(lightPreset: colorScheme == .light ? .day : .dusk))
                .frame(width: isEnlarged ? 390 : 100, height: isEnlarged ? 750 : 100)
                .onTapGesture {
                    withAnimation (.linear(duration: 5)) {
                        self.isEnlarged.toggle()
                    }
                }
        }
        Spacer()
    }
}

}

Expected behavior

Smooth linear animation

Notes / preliminary analysis

Additional links and references

MapboxZoomAnimation.mp4
@thomas-hensel thomas-hensel added the bug 🪲 Something is broken! label Oct 2, 2024
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