-
Notifications
You must be signed in to change notification settings - Fork 160
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
Pure SwiftUI Map Snapshot Capabilities #2166
Comments
Hi @seizler, do I understand correctly that you want to take a snapshot from the You can do it with the MapReader { proxy in
Map(...)
.onMapLoaded {
let image = proxy.captureSnapshot(includeOverlays: true)
}
} |
I'm closing the issue, feel free to open it if the suggested method doesn't work for you. |
Hi! That worked. Totally missed it in the documentation. Thank you so much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New Feature
Need to be able to snapshot a pure SwiftUI map with annotations and polylines on it and have it as a UIImage so I can upload the image to my database.
Why
Reduce memory usage and not have to display full maps for every user posted map in my app.
`@_spi(Experimental) import MapboxMaps
@available(iOS 16.0, *)
struct SnapTripMapView: View {
@State var tripFlights: [FlightDocument] = []
@State private var viewport: Viewport = .camera(center: CLLocationCoordinate2D(latitude: 0, longitude: 0), zoom: 10)
@State private var userExpDate: Date?
@State private var isProUser = false
@State var viewModel: SnapTripMapViewModel
@ObservedObject var tripManager = TripManager()
@State private var selectedGradientMode: TripMapViewModel.GradientMode = .defaultGradient
@State private var showingUpgradeView = false
@binding var isDisabled: Bool
The text was updated successfully, but these errors were encountered: