Maps & Location

RSS for tag

Learn how to integrate MapKit and Core Location to unlock the power of location-based features in your app.

Maps & Location Documentation

Posts under Maps & Location subtopic

Post

Replies

Boosts

Views

Activity

Z-Index for MarkerAnnotation
Hey there, is there a way to set the z-index for MarkerAnnotations in MapkitJS? I'm loading up to 200 markers dynamically as the map moves or the user zooms and I want a few specific markers to always be at the top (the best search results). The only way I found is to always remove all markers and then add them again in the right order, but that's visually so annoying to see them disappear and animate in with every tiny movement. I thought about using a default Annotation and setting the z-index myself and trying to rebuild the balloon, including the animation when it's clicked, but the big downside is probably the performance because I won't be able to use shadow DOM elements and have 200 real DOM elements instead. Is there a solution to this right now or is it planned to add a feature like that to Mapkit JS? It's a real blocker for me right now because all the bad content always gets rendered on top when a user zooms in, because I obviously want to show the best content first when the user isn't zoomed in yet. Thank you so much in advance. I really appreciate it. Manuel
1
0
34
1d
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!
2
1
205
2d
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!
7
1
247
3d
Altitude for MKAnnotation
In MapKit, the MKAnnotation takes a CLLocationCoordinate2D. However, in 3D/Flyover mode, the user marker has a height position on the map. We are currently plotting points which have altitude, speed, heading, etc, and I have a method for creating a CLLocation with this information. What I'm trying to figure out is if there's a way to pass that information along to the MapKit rendering engine / annotations / AnnotationViews to recognize and show when in 3D mode. Is there any support for that currently?
3
0
118
5d
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?
5
0
133
5d
Stopping and Resuming Background Location Activity with CLLocationUpdates and CLBackgroundActivitySession
Hello, This is my first post in the forums, and I'm still learning my way with iOS Development and Swift. My apologies if the formatting is not correct, or If I'm making any mistakes. I'm currently trying to implement an iOS App where the device needs to share the location with my server via an API call. The use case is as follows: the server expects location updates to determine if a device is inside/outside a geofence. If the device is stationary, no locations need to be sent. If the device begins moving, regardless of whether the app is in foreground, background, or terminated, the app should resume posting locations to the server. I've decided to use the CLLocationUpdate.liveUpdates() stream, together with CLBackgroundActivitySession(). However, I have not been able to achieve the behavior successfully. My app either maintains the blue CLActivitySession indicator active, regardless of whether the phone is stationary or not, or kills the Indicator (and the background capability) and does not restore it when moving again. Below I've attached my latest code snippet (the indicator disappears and does not come back). // This method is called in the didFinishLaunchingWithOptions func startLocationUpdates(precise: Bool) { // Show the location permission pop up requestAuthorization() // Stop any previous sessions stopLocationUpdates() Task { do { // If we have the right authorization, we will launch the updates in the background // using CLBackgroundActivitySession if self.manager.authorizationStatus == .authorizedAlways { self.backgroundActivity = true } else { self.backgroundActivity = false self.backgroundSession?.invalidate() } // We will start collecting live location updates for try await update in CLLocationUpdate.liveUpdates() { // Handle deprecation let stationary = if #available(iOS 18.0, *) { update.stationary } else { update.isStationary } // If the update is identified as stationary, we will skip this update // and turn off background location updates if stationary { self.backgroundSession?.invalidate() continue } // if background activity is enabled, we restore the Background Activity Session if backgroundActivity == true { self.backgroundSession = CLBackgroundActivitySession() } guard let location = update.location else { continue } // Do POST with location to server } } catch { print("Could not start location updates") } } } I'm not sure why the code does not work as expected, and I believe I may be misunderstanding how the libraries Work. My understanding is that the liveUpdates stream is capable of emitting values, even if the app has gone to the background/terminated, thus why I'm trying to stop/resume the Background Activity using the "stationary" or "isStationary" attribute coming from the update. Is the behavior I'm trying to achieve possible? If so, I'm I using the right libraries for it? Is my implementation correct? And If not, what would be the recommended approach? Regards
2
1
77
1w
Snippet Intents and location
Hello, I’d like to ask about best practices for handling interactive snippet intents when working with the user’s location. My use case is: 1. Get the user’s location 2. Fetch nearby data 3. Display it My current flow is: try to show the snippet view in "loading" state while waiting for Core Location Manager, then fetch data and reload() the view. BUT I’m running into an issue where I sometimes receive Core Location error 1 (not authorized), even though the main app has “While In Use” authorization. It seems that in some cases, especially when the app has been force-closed, App Intents are unable to start location updates, even though I’m using supportedModes = .foreground(.dynamic). Any guidance would be appreciated. Cheers, Ondrej
0
0
44
1w
DataCloneError in MapKit JS Worker when posting non-detachable ArrayBuffers (Chrome ≥120)
Since integrating MapKit JS, we’ve begun receiving production error reports with the following message: Uncaught DataCloneError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': ArrayBuffer is not detachable and could not be cloned. It appears that MapKit JS’s internal worker occasionally calls postMessage() with an ArrayBuffer that cannot be detached under Chrome 120+. This causes the structured clone to fail and the error surfaces uncaught from within the worker. MapKit JS Version: 5.79.109 Browser: Chrome 120.0+ OS: Windows 10 Is this a known issue with MapKit JS? If so, are there recommended workarounds or planned fixes?
2
0
155
1w
Direction data not available with U2 chip (iPhone 15 Pro and iPhone 16 Pro) when using Murata SR040/SR150 accessory
Hello, I am developing with the Nearby Interaction framework using third-party UWB accessories (Murata SR040/SR150). I observed a difference between U1-based and U2-based iPhones: iPhone 12 Pro (U1 chip) NINearbyObject.direction returns valid 3D vector (x, y, z). Distance and direction both work as expected. iPhone 15 Pro and iPhone 16 Pro (U2 chip) NINearbyObject.direction is always nil. Only distance is returned (around 0.35–0.40 m in my test). Effectively behaves as "distance-only mode". Environment: Hardware: iPhone 12 Pro, iPhone 15 Pro iOS version: 18.5 Accessory: Murata UWB SR040 / SR150 App: Using NINearbyAccessoryConfiguration with BLE-based discovery Info.plist includes NSNearbyInteractionUsageDescription Camera assistance was tested both ON and OFF Expectation: I expected the U2 chip to behave consistently with U1, i.e. provide direction vectors when possible. Instead, on iPhone 15 Pro, direction is always unavailable (nil) while distance is returned correctly. Questions: Is this an intentional limitation for U2 chip + third-party accessories? Is there a new requirement (e.g. certification, firmware update, capability flags) to enable direction on U2 devices? Could this be related to NIDeviceCapability or the new Extended Distance Measurement (EDM) mode in U2? Thanks in advance for any clarification.
2
3
224
2w
CarPlay Display Issue: Missing Images After Extended Navigation
I am experiencing a persistent issue with my CarPlay application where images rendered within the CarPlay Template interface disappear after the application has been used for an extended period, typically during prolonged navigation. Images used directly within the CarPlay Template framework disappear. In the attached image showing the issue (IMG_1022.PNG), you can see that the icons for 'parking', 'gasstation', 'conveniencestore', and 'favoritespot' are missing. The side bar icons (car, battery, etc.) remain visible, and the text labels are present, but the Template-specific images/icons vanish. Problem Description Images displayed on a custom UIViewController remain visible. Some of our screens integrate a UIViewController (e.g., for map display), and any images rendered on that view controller (not the template itself) continue to display correctly without issue. Example Images IMG_1021.PNG (Normal/Correct Display): This image shows the SearchMenu screen with all icons displayed correctly next to their respective labels ('word', 'home', 'route', 'history', 'parking', 'gasstation', 'conveniencestore', 'favoritespot'). IMG_1022.PNG (Problem State): This image shows the same screen after prolonged use, where the icons next to 'parking', 'gasstation', 'conveniencestore', and 'favoritespot' have disappeared, leaving only the text labels. Question Has anyone encountered a similar issue? This seems to be a rendering or resource management problem specific to images within the CarPlay Template components when the application runs for an extended duration.
1
0
78
3w
Significant Disparity in Event Frequency Between CLCircularRegion (Legacy) and CLMonitor (iOS 17+) Geofencing APIs
1. The Inquiry Hello, I have been implementing a background geofencing feature and, during testing, I found a significant numerical difference in event callback frequency between the older CLCircularRegion API and the newer CLMonitor API (CLMonitor.CircularGeographicCondition), introduced in iOS 17. My testing was strictly conducted using the "Always Allow" location permission (requestAlwaysAuthorization()). I used both APIs in parallel under identical geofencing conditions and within the same implementation environment. Since a clear difference persists in the data, I suspect this may stem from structural differences in the internal mechanisms of the two APIs rather than an implementation error on my part. 2. Environment and Implementation Details (Proof of Integrity) I have ensured that my implementation adheres to Apple's guidelines and uses modern Swift concurrency features. A. Development Environment and Permissions iOS Version: iOS 18.x and later Xcode Version: Version 17A400 (Version 26.0.1) Location Authorization: Always permission obtained. Background Mode: Location updates is configured correctly in Info.plist. B. CLMonitor Initialization and Lifecycle I implemented robust lifecycle management to ensure CLMonitor is stable and persists correctly: Initialization: I performed CLLocationManager object allocation and related service setup (e.g., CLServiceSession set to always) within the call stack frame of didFinishLaunchingWithOptions. Monitor Management: I use an Actor-based Singleton pattern to guarantee that only a single CLMonitor instance is used application-wide. Event Monitoring: Following initialization, I allocated a background Task containing the for try await event in await monitor.events loop. This Task is explicitly managed to persist in the background until the application is terminated, ensuring continuous event listening. C. Registration Limit Management I manage both APIs to ensure they never exceed the recommended maximum of 20 simultaneously monitored regions/conditions. My logic removes the oldest item (LRU) when the limit is reached. The average registration counts during the test period were highly similar: Component Average Registered Count CLCircularRegion count 7.02 CLMonitor.CircularGeographicCondition count 7.04 This confirms that registration count is not the cause of the event frequency difference. 3. Data-Based Observation The test data (bubble_test_data_for_apple_forum.csv) records the event callbacks for both APIs under identical conditions: Component Total Count Percentage of All Events (%) CLCircularRegion Delegate Total Calls 617 83.56% CLMonitor Event Total Fires 122 16.44% Overall Total Count 739 100% A. Key Findings CLCircularRegion Operability: 617 calls confirm that core implementation factors (permissions, background setup, etc.) are functioning correctly. Disparity in Frequency: Despite running in parallel, the CLMonitor event count (122) is approximately 1/5th the frequency of the CLCircularRegion calls (617). Efficiency per Registration: CLCircularRegion averaged ~0.86 calls per registered item, while CLMonitor averaged only ~0.17 calls per registered item. 4. Questions for Apple Engineering Based on the robust implementation and the data presented, I request a review of the following potential differences between the APIs: Internal Mechanism Differences: Are there structural differences in how CLCircularRegion and CLMonitor.CircularGeographicCondition process and schedule geofencing event callbacks? For instance, do they differ in terms of battery optimization priority, event batching, or internal throttling mechanisms? CLMonitor Event Ratio: Is the phenomenon where CLMonitor records a significantly lower ratio of events compared to CLCircularRegion an intended behavior, or could this be indicative of a specific environmental factor that affects the newer API differently? Thank you for your time and assistance. geofence-test-data.csv
3
1
241
Nov ’25
Draw-to-Route functionality in Apple Maps
hello I am Asmaa Atine I would like to suggest an improvement for the Apple Maps app. My idea is to allow users to draw the general path they would like to follow directly on the map with their finger, and then have the app automatically generate an optimized route that follows the drawn trajectory as closely as possible. This feature would be very useful in several situations, such as: • when the user wants to pass through a specific area but the suggested routes don’t match, • when they want to avoid certain places or include a particular spot, • or when they simply want a more flexible, intuitive way to customize a route. The concept would be: 1. the user draws a rough path on the map, 2. Apple Maps interprets the drawing, 3. and then proposes the best possible route based on that drawn line. I believe this would greatly enhance the flexibility of Apple Maps and provide a more intuitive way to create personalized routes. Thank you for considering this suggestion, and congratulations on the great work already done on the app.
1
0
98
Nov ’25
Questions about Maps Server API / MapKit JS quotas, temporary caching (including sessionStorage), and commercial website usage
Hi, I’m a member of the Apple Developer Program and I’m planning to use Apple Maps Server API together with MapKit JS for a production, customer-facing web service. I have reviewed the Apple Developer Program License Agreement (including Schedule 6 – Apple Maps Services) and the documentation, but I still need clarification on several points to ensure that our usage fully complies with Apple’s policies. Daily quota and additional capacity From the documentation, I understand that there is a daily limit of 250,000 map views and 25,000 service calls per Apple Developer Program membership, shared between MapKit JS and Apple Maps Server API. When the 25,000 service calls are exceeded, the API returns HTTP 429. Should this limit be considered a hard limit for production use? The wording “For additional capacity needs, contact us” is unclear. Is there any official channel or program to request a higher quota, or should we assume this is not practically available and design our system to always stay within the documented limit? Caching of geocoding / reverse-geocoding results Schedule 6 section 2.5 restricts caching, prefetching, or storing map data except when temporary and only as necessary for Apple Maps Services, and any cached data must be deleted after use. To understand what “temporary” means in practice, I would like to confirm whether the following scenarios are acceptable: (a) In-memory cache during a single page or tab session: - Store geocoding results (latitude/longitude and normalized address) only in a JavaScript in-memory structure (e.g., a Map object) during the lifetime of the browser tab. - Delete all cached results when the tab is closed or after a short TTL (for example, a few minutes). (b) sessionStorage with a short TTL: - Store geocoding results in window.sessionStorage on a per-tab basis. - Apply a short TTL (for example, a few minutes), and delete the data when the TTL expires or the tab is closed. Are both (a) and (b) considered acceptable forms of “temporary caching” under section 2.5, or should we avoid sessionStorage and limit ourselves to purely in-memory (non-persistent) caching? Use on a commercial customer-facing website Our intended use case is a public website that: Displays store locations on a map Allows users to search for nearby stores Optionally shows routing directions We do not do fleet management, asset tracking, enterprise route optimization, or insurance risk scoring. Is this type of consumer-facing store-locator use case permitted under the Apple Maps Services terms? Any clarification from the Maps or MapKit teams would be greatly appreciated. Thank you. Best regards, Naoto Omori
1
0
74
Nov ’25
WeatherKit raday overlays
Are the apple weather precipitation radars available through the rest API or have I hit a brickwall. Would love to have the visuals of the native overlays in my app, cant find an affordable/comparable API. Any help would be appreciated. I really need the smooth hourly scrubbing. Not keen on rendering my own with vectors yet. Thank you.
1
0
84
Nov ’25
CLLocationManager didVisit no longer invoked reliably after iOS 26 updates
Since iOS 26 the delegate method locationManager(:didVisit:) is no longer invoked reliably while locationManager(:didUpdateLocations:) continues to be called regularly on the same devices. The issue appears to be directly tied to iOS version updates. Visit callbacks worked consistently under iOS 18.x but in some cases stopped being invoked immediately after updating the same device to iOS 26.0. In other cases didVisit worked on iOS 26.0 but stopped after updating to 26.0.1 and similarly from 26.0.1 to 26.1. The behaviour is inconsistent with no identifiable pattern and affects multiple recent device models. All required configuration is in place: – startMonitoringVisits() is called correctly – location permission is set to “Always”– background mode for location updates is enabled – allowsBackgroundLocationUpdates is enabled – restarting the app or the device does not fix the problem The only workaround that restores visit monitoring is deleting the app and reinstalling the same App Store version which is not a viable solution for end users. Have other developers experienced the same issue and are there any recommended best practices or technical guidelines to handle missing didVisit callbacks after updating to iOS 26?
3
0
135
Nov ’25