SwiftUI Map zoom to show custom annotations
I’m trying some basic tutorials for testing MapKit. I have added two custom annotations and the map automatically zooms out to show both annotation coordinates, but the annotations views are cut on the left and right margins. Is there a way to define a zoom level to initially show the full annotations views?
SwiftUI custom annotations ignores Z-index
I’m using a custom view for Map annotation, basically is something like this:
Why doesn’t my map load properly at certain times? (SwiftUI)
I’m having a problem loading the map. Here’s a gif showing the problem, it’s once in a while, not every time. :
Convert adress to coordinates in SwiftUI
I got a little problem with changing the value of an object. I have got the following code and want to change the value of the object.
How to use an image as a texture for SwiftUI MapKit MapPolygon
I’m trying to add an image to fill/use as a texture in a MapPolygon on my Map, however my image never shows up. Does anyone know how to use an image in a MapPolygon?
SwiftUI map lags when it’s centered in the user’s location and state changes
Please note that for this app to be able show you your location on the map you need to enable it to ask for permission to track the user’s location, in the project’s targets’ info:
enable the iOS app to ask for permission to track the user’s location.
SwiftUI MapKit is creating a gradient behind the top navigation link
I’m trying to add a map to a swiftUI view. The map is loading fine, but it’s discoloring the background of the navigation link.
How do I make a map with selectable `MKMapItem`s in iOS 17?
I want to display an Apple map in my UIKit app, but if I try to do so with UIKit I get concurrency-related warnings (Xcode 15.4 with strict concurrency warnings enabled) that I couldn’t find a proper solution to.
Conform to iOS 17.0’s Use Map initializers that take a MapContentBuilder
import MapKit import SwiftUI extension MKCoordinateRegion: Equatable { public static func == (lhs: MKCoordinateRegion, rhs: MKCoordinateRegion) -> Bool { lhs.center.latitude == rhs.center.latitude && lhs.center.longitude == rhs.center.longitude && lhs.span.latitudeDelta == rhs.span.latitudeDelta && lhs.span.longitudeDelta == rhs.span.longitudeDelta } } struct TestMap: View { @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194), span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: […]
How to adjust alignment of `MapCameraPosition ` in iOS 17
Using Xcode 15.4. I want to position and follow the user’s location on a Map
, but I want to position the camera “above” the user’s location (or align the user’s location to the bottom of the screen). My view currently looks like this: