Display map or satellite imagery from your app's interface, call out points of interest, and determine placemark information for map coordinates using MapKit.

Posts under MapKit tag

105 Posts

Post

Replies

Boosts

Views

Activity

How are Assets removed?
Hello, I'm trying to figure out the behavior of AssetPackManager.shared.remove(assetPackWithID: ). I'm working with MapKit tiles and currently working on trying projecting them correctly which involves serving the AssetPack locally, downloading, checking alignment, and then deleting and changing. My question is that remove(assetPackWithID: ) completes successfully and the asset pack is removed. This is confirmed by trying to remove the AssetPack again which throws an error. However, the asset is still appearing on MapKit after the removal. This is a bit odd as this persists not only with force killing, but also restarting the device. Please advise on how to properly remove an AssetPack. Thank you iPhone 15 Pro Max (iOS 26.0.1) iPhone 17 Pro Max (iOS 26.0.1)
1
0
132
1d
Background Assets Directory Collision
Hello, I'm trying to use multiple Background Assets Packs to host map tiles. This is problematic for a few reasons. MKTileOverlay requires a method that returns a URL. AssetPackManager.shared.url() throws, but it's unrelated to the url. It will return a URL even if it points to nothing. There's no name-spacing. Everything appears to be flattened. (See Error below) Simultaneously, this also is not the case as the documentation states: if there’s a path collision across multiple asset packs, then it’s undefined from which asset pack an individual file will be resolved. AssetPackManager.shared.url() doesn't have an optional parameter to explicitly declare the asset pack you want to access, like AssetPackManager.shared.contents(at: FilePath) does For example, I have multiple different tiles I'm trying to overlay for z: 10, x: 239, and y: 414. Foo/10/239/414.png Bar/10/239/414.png And even when explicitly stating the fold directory, it appears that the assets are flattened down. As I'm receiving this error. The URL for “Foo/10/239/414.png” couldn’t be retrieved: “414.png” couldn’t be copied to “239” because an item with the same name already exists.
2
0
148
2d
Request for Higher MapKit Service/API Quota
Hello Apple Developer Team, I’m currently using Apple MapKit JS as the main map provider for our logistics, telematics, and HR platform TADMIN, and we are extremely satisfied with its reliability, accuracy, and visual quality. We would now like to expand our Apple integration by migrating our backend reverse geolocation services to Apple as well. However, our current usage requirements significantly exceed the standard 25,000 daily service request limit. At this stage, we already need between 250,000 and 350,000 reverse geocoding requests per day, and this number will continue to grow rapidly. Our TADMIN Tracking product processes live GPS data from connected vehicle telematics boxes, and each vehicle sends an average of 1.5 pings per minute in normal mode. We currently manage around 140 vehicles and are already in discussions with new customers that will add over 1,000 additional vehicles to the platform soon. As our customer base continues to expand, we expect this growth trend to accelerate significantly over the coming months. We already make extensive use of caching to minimize redundant geolocation calls. For example, we reuse location data when vehicles remain within a defined radius. However, since trucks rarely stay stationary for long, there is still a constant flow of new coordinates that require reverse geolocation. To give you a broader picture: TADMIN is a comprehensive SaaS ecosystem for the transport and logistics industry, combining HR management, telematics and tracking, dispatching, and data analysis into one integrated platform. The Tracking module is just one part of this system and serves as the live data backbone for our dispatching, HR, and telematics analytics modules. We would therefore like to increase our quotas for: Service Requests (especially Reverse Geocoding) Snapshot Requests, which we use for our Geofence Alerts. These are sent via push notification and email, and we would love to include the snapshot images in the emails for a clear and visually rich presentation MapKit JS Views, since we also use MapKit JS heavily in our web dashboards, for example in our tracking portal Higher quotas would allow us to rely even more on Apple services, including Autocomplete and Geocoding for customer-facing address searches inside our applications. We already have three apps published on the App Store, with a fourth one scheduled for release this week, and I will soon be upgrading my Apple Developer account to an Organization Account for our company. We are currently evaluating providers for this next stage of integration, as we are preparing a new major version of our TADMIN software, which will introduce a reworked telematics backend. Our goal is to migrate to Apple’s geolocation and map services as part of this new release. Could you please advise how we can best address this use case, for example through higher quotas or an adjusted configuration? Thank you very much for your time and support. Best regards, Timo Köhler Founder & CTO, TADMIN GmbH
1
0
97
3d
Illegible navigation title when presenting Map view
When building with the iOS 26 SDK (currently beta 4), the navigation title is often illegible when rendering a Map view. For example, note how the title "Choose Location" is obscured by the map's text ("South America") in the screenshot below: This screenshot is the result of the following view code: import MapKit import SwiftUI struct Demo: View { var body: some View { NavigationStack { Map() .navigationTitle(Text("Choose Location")) .navigationBarTitleDisplayMode(.inline) } } } I tried using the scrollEdgeEffectStyle(_:for:) modifier to apply a scroll edge effect to the top of the screen, in hopes of making the title legible, but that doesn't seem to have any effect. Specifically, the following code seems to produce the exact same result shown in the screenshot above. import MapKit import SwiftUI struct Demo: View { var body: some View { NavigationStack { Map() .scrollEdgeEffectStyle(.hard, for: .top) // ⬅️ no apparent effect .navigationTitle(Text("Choose Location")) .navigationBarTitleDisplayMode(.inline) } } } Is there a recommended way to resolve this issue so that the navigation title is always readable?
7
3
234
1w
SwiftUI issue with onTap using Map using IOS 26
I have a sample that stop working on IOS 26, using the latest XCode and IOS sdk, the onTapGesture event is no longer happening. Maybe this is no longer the way to drop pins on the map. Also not working on the iPhone 17 sim or iPhone 16 max pro device upgrading to IOS 26 Thanks, any help Sample: import SwiftUI import MapKit import CoreLocation import Foundation struct Pin: Identifiable { let id = UUID() let coordinate: CLLocationCoordinate2D } struct ContentTestPinDropView: View { @State private var pins: [Pin] = [] var body: some View { MapReader { reader in Map(selection: .constant(nil)) { ForEach(pins) { pin in Marker("Pin", coordinate: pin.coordinate) } } .onTapGesture { screenPoint in if let coordinate = reader.convert(screenPoint, from: .local) { pins.append(Pin(coordinate: coordinate)) } } } } }
2
0
134
1w
Incorrect position rendering of WGS84 coordinate in MKMapView: Discrepancy between Apple Maps (Hong Kong) and Amap (Mainland China)
I am encountering a coordinate rendering issue using MKMapView in my iOS app. I have a GPS coordinate in WGS84 format, which corresponds to a location in Hong Kong. When my device is physically located in Hong Kong, MKMapView displays the map with the "Apple Maps" label, and the WGS84 coordinate is rendered at the correct position. However, when the device is in Mainland China, MKMapView switches to display "Amap" (Gaode Maps) branding, and the same WGS84 coordinate is rendered at an incorrect position. I understand that Amap in Mainland China uses the GCJ-02 coordinate system, while Apple Maps typically uses WGS84. This discrepancy suggests a potential coordinate system mismatch, but I cannot definitively confirm which map type (and corresponding coordinate system) MKMapView is actually using in different regions. My key questions are: How can I programmatically or visually confirm the underlying map type (Apple Maps vs. Amap) and its coordinate system within MKMapView? Is there a way to simulate the Apple Maps environment for testing when physically located in Mainland China?
4
0
139
2w
`onTapGesture` not triggered on `Map` views
When building with iOS 26 SDK beta 5 (23A5308f), onTapGesture is no longer being triggered on Map views. This appears to be a regression in beta 5 specifically, as this issue was not present in beta 4. How to reproduce Code The following code demonstrates the issue, as seen in the videos below. import MapKit import SwiftUI struct ContentView: View { @State private var location = CGPoint.zero var body: some View { Map() .onTapGesture { location in self.location = location } .safeAreaInset(edge: .bottom) { VStack(alignment: .center) { Text("iOS \(UIDevice.current.systemVersion)") .font(.largeTitle) Text("Tapped Location") Text("\(location.x), \(location.y)") } .frame(maxWidth: .infinity, alignment: .center) .background(.background) } } } Demo The gifs below show the behavior in iOS 18.5 (in which the tap gestures are recognized and tapped coordinate is displayed in the safe area inset) and iOS 26 beta 5 (in which the tap gestures have no effect): iOS 18 iOS 26 Next steps? Is there a recommended workaround for this issue?
19
5
871
2w
Empty `safeAreaInset` modifier breaks `Map` zoom region
Reported as FB20357097 In SwiftUI, an empty .safeAreaInset modifier attached to a Map causes the map to become zoomed out to planet level. Minimal reproduction: import SwiftUI import MapKit @main struct map_region_safe_area_inset_bugApp: App { var body: some Scene { WindowGroup { Map { // Any Map content MapCircle(center: .init(latitude: 35.6895, longitude: 139.6917), radius: 1000) } .safeAreaInset(edge: .top) { // No content, `EmptyView()`, `Color.clear` } } } } Note: ZStack { } inside the safeAreaInset prevents the bug. Empty safeAreaInset (bug) Non-empty
0
0
47
3w
iOS 26 share map location
I am having a problem with the following scenario. The user opens the Maps app, then selects a location like a store or restaurant, then tap on share and then on my app. On iOS 26, my app stopped showing altogether. After changing the NSExtensionActivationRule to TRUEPREDICATE to accept all, I see this difference between the OS versions. iOS 18.5 (lldb) po extensionContext?.inputItems ▿ Optional<Array<Any>> ▿ some : 1 element - 0 : <NSExtensionItem: 0x60000000c5d0> - userInfo: { NSExtensionItemAttachmentsKey = ( "<NSItemProvider: 0x600002930d20> {types = (\n \"public.plain-text\"\n)}", "<NSItemProvider: 0x600002930c40> {types = (\n \"com.apple.mapkit.map-item\"\n)}", "<NSItemProvider: 0x600002930bd0> {types = (\n \"public.url\"\n)}" ); NSExtensionItemAttributedContentTextKey = {length = 329, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 656e7472 61616c7d }; "com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0; } iOS 26 (lldb) po extensionContext?.inputItems ▿ Optional<Array<Any>> ▿ some : 1 element - 0 : <NSExtensionItem: 0x60000000cbd0> - userInfo: { NSExtensionItemAttachmentsKey = ( "<NSItemProvider: 0x60000293afb0> {types = (\n \"public.url\"\n)}", "<NSItemProvider: 0x60000293bf70> {types = (\n \"public.plain-text\"\n)}" ); "com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0; } Please notice how iOS 26 is no longer sending com.apple.mapkit.map-item. Is there an alternative way to read the info from the map location shared to my app?
0
0
62
3w
Placemark Deprecated
"Use location, address and addressRepresentations instead" Is it possible to know what kind of "Address" a MapItem is representing (State, County, Neighborhood etc) after a MKGeocodingRequest? Is it possible to find out the CLRegion or similar of an map item. (Now when we cannot read it from the Placemark)
2
1
114
Sep ’25
Country from MKReverseGeocoding
As GeoCoder is now deprecated I am struggling to get the country only information from the new MKReverseGeocoding. Maybe someone can guide me or give me direction? Or is this just not possible anymore? let request = MKReverseGeocodingRequest(location: self.lastLocation ?? fallbackLocation) request?.getMapItems { items, error in guard let items = items else { return } self.cityName = items.first?.addressRepresentations?.cityWithContext ?? "" self.countryName = items.first?.addressRepresentations?.regionName ?? "" } I couldn't find anything here, sure you can get the full Address but I need single values to store so the user can search for (example City, Country) In case the structure is always the same, let us say the country is always third part, sure I could split the string but it is not a reliable way to do this, at least for me. Any help would be much appreciated.
1
0
101
Sep ’25
Apple Map App Crash, when witched to satellite view
hi, When changing the map to Satellite in Apple Maps and centering it on Ōmuta City, Fukuoka Prefecture, Japan (as shown in the image), the app crashes when swiping to the right. This issue also occurs in MapKit, and I confirmed it happens in Apple Maps as well. It seems that either the satellite map tiles are missing or an error is occurring. Our application is experiencing a crash, and this has become a serious issue. Since September 1, crashes have increased significantly. Initially, we suspected that the issue was due to our application’s implementation, but our investigation revealed that the problem lies with the map tiles being called through MapKit. Could you please investigate this issue and provide a fix?
4
0
58
Sep ’25
MapKit MapReader Not working on iOS 26
I have the following code snippet with a simple map and map reader that shows a pin on the map when the user selects a location struct MapReaderTest: View { @State private var loc: CLLocationCoordinate2D? = nil var body: some View { MapReader { proxy in Map { UserAnnotation() if let loc { Marker(coordinate: loc, label: { Text("Marker") }) } } .onTapGesture { position in let position = proxy.convert(position, from: .local) loc = position } } } } This snippet compiles and works perfectly fine using Xcode version 16.4 building for iOS 18.0 and running on a device. This snippet also works for me when I build using Xcode 26 Beta and run in the canvas or simulator, however it does not work when I compile using Xcode 26 and run it on a physical device(I built and tested for both iOS 18.6 and iOS 26 Beta) Has anyone else had a similar issue / have any ideas for work arounds?
1
0
105
Aug ’25
How to Start with Default Apple Maps Functionality in iOS 18+
Hi everyone, I’m building an iOS 18+ app in Xcode where Apple Maps is central. My goal is to start with the default Apple Maps experience (map view, search bar, pins, directions sheet, etc.) and then customize it for my project. I tried coding it from scratch using MapKit and SwiftUI, but I wasn’t able to get full parity with the basic features of the Maps app. My questions: Is there any sample project, template, or reference that provides the default Apple Maps functionality (views + interactions) as a baseline? Can I copy these into my Xcode project and then extend/customize them? If not, what’s the recommended best practice to get as close as possible to the native Maps app before adding my own features? Any guidance, sample code, or documentation links would be greatly appreciated.
1
0
108
Aug ’25
Quick Look Extension does not load MapKit map properly anymore, after macOS Sequoia
It appears that starting with macOS Sequoia, Quick Look Preview extension no longer loads MapKit maps correctly anymore. Map tiles do not appear, leaving users with a beige background. Users report that polylines do render correctly, but annotations appears black. This was previously working fine in prior macOS versions including Sonoma. STEPS TO REPRODUCE Create a macOS app project, with an associated document. Ensure project has a Quick Look preview extension, with necessary basic setups. Ensure that the extension mentioned in (2) must have a MKMapView. Any other cosmetic changes, etc, does not need to be implemented to observe the base issue. Do note that it has been reported that in addition to the map tiles not loading, annotations don't render correctly as well.
3
2
822
Aug ’25
MKReverseGeocodingRequest and CNPostalAddress from MKMapItem
My app is currently using CLGeocoder to get a CLPlacemark, then using placemark.postalAddress with CNPostalAddressFormatter to get an attributed string for the full address, I then enumerate its attributes to pull out specific elements like just the street or state or zip etc. This is deprecated in iOS 26 with MKReverseGeocodingRequest being the intended replacement. This API returns an MKMapItem which doesn’t provide a CNPostalAddress - you can get a full address as a String but not structured address data that I’m seeing. Am I missing some way to get the postal address? Or is it a non-goal to provide that anymore? Thanks!
5
0
142
Aug ’25
SwiftUI & Xcode 26.0 beta3: Using Map in LazyVGrid causes "Observation tracking feedback loop"
The following code causes an error in Xcode 26.0 beta3 in iOS Simulator with iOS 26.0. After starting the App, scroll to the end of the grid and the app will break. Testet with Xcode Playground with platforms: [ .iOS("17.0")], Simplest possible variant: import SwiftUI import MapKit struct ContentView: View { var body: some View { NavigationStack { ScrollView { LazyVGrid(columns: [GridItem()]) { ForEach(1...12, id:\.self) { i in Text("Hello \(i)") .frame(height: 150) } Map { } .frame(height: 150) } } } } } Thrown error: Observation tracking feedback loop detected! Make a symbolic breakpoint at UIObservationTrackingFeedbackLoopDetected to catch this in the debugger. Refer to the console logs for details about recent invalidations; you can also make a symbolic breakpoint at UIObservationTrackingInvalidated to catch invalidations in the debugger. Object receiving repeated [updateProperties] invalidations: <UIKit.NavigationBarContentView: 0x103026000; frame = (0 0; 402 54); gestureRecognizers = <NSArray: 0x600000c26790>; layer = <CALayer: 0x600000c2d4a0>> contentView=0x0000000103026000 These three nested views are necessary to reproduce the error: NavigationStack -> ScrollView -> LazyVGrid In iOS Simulator with iOS 18.0 there is no error message, the CPU raises to 100%. With Xcode 16.4 the program runs error-free. Is there a solution?
5
1
273
Aug ’25
Reverse geocoding rate limit of MKReverseGeocodingRequest compared to CLGeocoder
The documentation for CLGeocoder states Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. (When the maximum rate is exceeded, the geocoder returns an error object with the CLError.Code.network error to the associated completion handler.) And it provides helpful guidance on how and when to submit geocoding requests. The documentation for MKReverseGeocodingRequest does not mention requests are rate-limited. Does this mean it is not rate-limited? If it is rate-limited, is it similar to CLGeocoder, what is its behavior? It is important to understand behavior of the API in order to understand impact on my app’s use case and how users will be affected should I change the implementation. Thanks!
0
0
92
Aug ’25
MapKit Not Updating MapContentBuilder after each mapCameraKeyframeAnimator keyframe
Hello Apple support, I have this following code Map(position: $mCam, selection: $lastSelection) { // Display content conditionally based on camera scope. // ^^^ works with user gesture, does not work with mapCameraKeyframeAnimator } .onMapCameraChange(frequency: .continuous , { context in // save the camera scope }) .mapCameraKeyframeAnimator(trigger: self.trigger, keyframes: { camera in // frames }) Context: when logging, the .onMapCameraChange is updating. The content mapContentBuilder is running. But the content is NOT showing up on the map. MapCircle, MapPolyline does not show! however, Marker works just fine Question: Anyone know How to indicate to MapKit Map view to draw the content? Or how to have a slight "break" between animation keyframes, so map can catch up.
2
0
82
Jul ’25