Hi, I'm using the Apple Maps Server API (/v1/geocode) to retrieve geocoding results for Japanese addresses.
Until recently, requests like the one below returned correct results:
GET https://maps-api.apple.com/v1/geocode?q=東京都千代田区千代田1-1&lang=ja-JP
Authorization: Bearer <valid JWT>
But now, the response is always:
{ "results": [] }
However, when I use the same address with lang: en-US, it returns valid coordinates:
GET https://maps-api.apple.com/v1/geocode?q=1-1 Chiyoda, Chiyoda-ku, Tokyo=en-US
"東京都千代田区千代田1-1" is a Japanese address, and "1-1 Chiyoda, Chiyoda-ku, Tokyo" is the same address written in English.
My Questions:
Has there been a recent change to the geocoding behavior for Japanese addresses when lang: ja-JP is used?
Does the lang parameter affect not only the response language but also the internal parsing logic?
Is this a known issue or limitation?
The access token is valid and I'm getting a 200 OK response, but results is always empty with lang: ja-JP.
Thanks for your help!
Maps & Location
RSS for tagLearn how to integrate MapKit and Core Location to unlock the power of location-based features in your app.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
We have a PWA app developed by our company. In order to distribute this app to users' iPhones, we put this PWA app inside an XCode app. That means we put a WebView in XCode to display the PWA URL. Everything works perfect, except for location access.
The PWA app access the device location. When the first time the app acess location, it asks for user consent two times, by PWA app and by the XCode app. This is fine. When the user clicks Allow, the XCode app preserves the user choice and never asks again. However, the PWA app keeps on asking user permission every day. If we close the app open again, it will ask one more time. That means twice daily. But if we close and open the app for a third time, it will not ask. It remembers the user choice only for 24 hours.
If we install the PWA app directly in iPhone (that means if we add the URL as bookmark in home screen), it is asking for location permission only once. However, when we put this app inside an XCode app it is asking every day.
This affects the user experience, and as our users are not tech savvy, causing many issues. Is there a way to force the PWA app inside XCode app to remember the user choice?
Any help is very much appreciated.
Thanks,
Hi,
I've watched the WWDC video "Discover streamlined location updates"
As detailed here: https://developer.apple.com/videos/play/wwdc2023/10180/?time=364
In order for my app to receive location updates in the background, the video states that I can either use a live activity or a CLBackgroundActivitySession
My app has a live activity, however the location updates stop shortly (10 seconds, this is the normal "grace period" described) after backgrounding the app, even when the live activity is visible. If I acquire a CLBackgroundActivitySession, location updates continue in the background.
I have reproduced this behavior in the Simulator in a barebones app for testing and confirmed that it's not working as described.
My question is: Should I hold a CLBackgroundActivitySession even when I already have a Live Activity?
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Maps and Location
ActivityKit
When using Search.autocomplete and getting the results, each search result object has coordinate which have 13 decimal places. When you use Geocoder.reverseLookup for these coordinates, it returns the wrong address and different coordinates (6 decimal places and different as well). What works is using Geocoder.lookup (with getsUserLocation as true) and putting in the Search.autocomplete displayLines (as a string) for the query. Am I doing something wrong or is this a bug?
Code:
const exampleQuery = '<example address>';
const search = new mapkit.Search({
getsUserLocation: true,
});
search.autocomplete(
exampleQuery,
(error, data) => {
if (error) {
console.error('Search error:', error);
return;
}
const { coordinate } = data.results[0];
console.log("Autocomplete coordinate", coordinate); // Lat and lng are both have 13 decimal places
const geoCoder = new mapkit.Geocoder({});
geoCoder.reverseLookup(
new mapkit.Coordinate(coordinate.latitude, coordinate.longitude),
(error, data) => {
const { formattedAddress, coordinate } = data.results[0];
console.log(formattedAddress, coordinate); // Not the same address from example query and from the search autocomplete, also the coordinate has 7 decimal places
}
);
},
{}
);
When I quit the app from the background task list, CLLocationUpdate.liveUpdates does not resume properly and start location updates. However, if I kill the app directly, it can recover and start location updates.
Topic:
App & System Services
SubTopic:
Maps & Location
I am having issues loading in a mapkit snapshot. I get an error saying that https://domain.com and they're expecting domain.com. I have no idea what could be going wrong here. I set the domains properly in the mapkit tokens. When I click on the link it opens a new tab and loads what the data properly, but somehow in the application on production this error comes up.
Hello developers! I am working with a team of North Carolina State University researchers to create an app or program that can retrieve real-time traffic events, such as hazards, road closures, and road construction alerts, in a similar manner to the Apple Maps app, but with the added functionality of collecting them over a historical period given a start and end date.
I'm looking through the MapKit documentation, but there doesn't appear to be any functions exposing granular traffic data (i.e. road hazards), just travel times and level of congestion. Could anyone point me in the right direction? Is what I'm looking to do even possible using just Apple data?
Topic:
App & System Services
SubTopic:
Maps & Location
I am using CLServiceSession(authorization: .always) to start a service session for tracking Zone entry and exit in the background in my app. It has been working fine on iOS 18 until recently when we added some BGProcessingTasks.
The task runs when the user is not moving and the device is on charge, this task runs fro a bit in the background, however we are seeing that even though we are reinitializing then session upon app launch.
We have even tried to just explicitly reinitialize a session within the background task callback, but the zone tracking still continues to fail. Significant location changes are unaffected.
Timeline of events:
User Opens App,
CLServiceSession(authorization: .always) is called (assume permissions have already been granted.)
App is backgrounded
User moves outside zone and app captures the data correctly (this can happen any amount of times)
User plugs in Phone
BGProcessingTask callback is run, it may or may not be terminated early. The service session is recreated as the first action in the callback. (we have also tried putting it in the main init() function for the app, same outcome)
User moves outside zone later and app does NOT capture the data.
User is sad :(
The session seems to be reinitialized correctly when the app is launched due to CoreLocation updates.
Is this expected behaviour or a bug? Is there a good way to debug what is happening with the sessions?
Unfortunately, the WWDC sessions on this have not enlightened us about the cause of this behaviour.
Greetings,
I recently submitted a request for the Location Push Service Extension Entitlement.
Does anybody have insight into how long I would have to wait until Apple responds?
Thanks
I'm working on an app that uses MapKit and CoreLocation. Is there a way to specify what location is simulated for a Preview, or create a preview that behaves as if the user denied location permissions, so that I can easily test my app's behavior in different scenarios? I know that you can simulate different locations in the Simulator, but haven't been able to get the previews within Xcode to have a location other than the center of Apple Park.
using the UseAnnotation in the map content does not show the blue user location. I added the info.plist info.
Error message: CLLocationManager(<CLLocationManager: 0x300e60d40>) for <MKCoreLocationProvider: 0x303e0e6d0> did fail with error: Error Domain=kCLErrorDomain Code=1 "(null)"
Topic:
App & System Services
SubTopic:
Maps & Location
aoubut MKLaunchOptionsDirectionsModeKey,
when I use MKLaunchOptionsDirectionsModeTransit as a mode in my code to call function openMaps ,the apple map app launches,it has 4 mode ,subbay or ferry,bus etc,so how can I specify the subway to transit before apple map app launch,so that I do not need to select on the map app,just specific subway in my own app, then the map app auto select the subway transit navigation。now it shows two much usless route。
Description of the Bug:
Core Location intermittently reports inaccurate location updates, albeit with a high accuracy value. This problem occurs almost exclusively while travelling in metros underground affecting the ability to rely on the framework effectively.
Steps to Reproduce:
The user starts travelling on ground level at point A
The user continues travelling and, after some time, is now underground at point B. A stationary beacon scanned at point B confirms this.
Core Location is observed to deliver a location update with a high-accuracy value but with the coordinates around point A when the user is actually around point B.
Expected Behaviour:
Accurate locations should be delivered at all times. In other words, Core Location should not report location updates with high accuracy when its certainty is low.
Pinned 2 homes address for the same contact
Steps
Initial check in Apple Maps
No saved places or pinned addresses appear.
Open Personal Contacts
You have two addresses stored in your contact card: Main and Home.
Pin & Edit “Main”
You pinned the Main address in Maps.
Refined the location on the map.
Renamed it (but still saved under the type “My Home”).
Open “Home” Address in Contacts
Refined the location again.
Changed the type to “My Home.”
Attempted to rename, but no option to change the label.
Final Saved Places View
Shows two entries both called “Main.”
Opening either of them displays the same details for the Home address.
Saved Places list only shows the full address text, without the ability to rename them inside Maps.
Results
Both addresses appear duplicated with the same name (“Main”), even though they point to different underlying addresses.
When selecting either entry, Apple Maps incorrectly shows the same Home address details.
The Saved Places section does not allow renaming; it defaults to showing the full address string.
Issues Identified
Sync Conflict Between Contacts & Maps
Apple Maps pulls labels/types from Contacts, but the edits don’t update consistently across apps.
Duplicate Naming Bug
Both “Main” and “Home” collapse into “Main” in Saved Places, making them indistinguishable.
One-to-One Mapping Failure
Regardless of which saved place you open, Maps shows the same Home entry, meaning the system isn’t correctly binding each saved place to its respective contact address.
Renaming Limitation
Apple Maps doesn’t allow renaming saved addresses directly — it relies on Contacts. Since Contacts only supports preset labels (Home, Work, School, etc.), custom naming is blocked.
When I try to import mapkitjs using HTML, I use the correct token, but the error token is invalid.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>地点信息查询</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f7;
}
.container {
max-width: 800px;
margin: 0 auto;
}
.search-box {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
}
.result-container {
background: white;
padding: 20px;
border-radius: 12px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.place-image {
width: 100%;
max-height: 300px;
object-fit: cover;
border-radius: 8px;
margin-bottom: 15px;
}
.place-info {
margin-top: 15px;
}
.place-info h2 {
margin-top: 0;
color: #1d1d1f;
}
.info-item {
margin: 10px 0;
color: #515154;
}
#map {
width: 100%;
height: 300px;
border-radius: 8px;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>地点信息查询</h1>
<input type="text" id="searchInput" class="search-box" placeholder="请输入地点名称(如:北京故宫)">
<div class="result-container">
<div id="placeImage"></div>
<div class="place-info">
<h2 id="placeName"></h2>
<div id="placeDetails"></div>
</div>
<div id="map"></div>
</div>
</div>
<script src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js"></script>
<script>
// 初始化 MapKit
mapkit.init({
authorizationCallback: function(done) {
done('mytoken');
},
language: 'zh-CN',
region: 'CN',
callback: function(error) {
if (error) {
console.error('MapKit 初始化错误:', error);
alert('地图服务初始化失败,请检查网络连接和授权设置');
} else {
console.log('MapKit 初始化成功');
}
}
});
// 添加错误处理
window.addEventListener('error', function(event) {
console.error('MapKit 错误:', event.error);
});
const searchInput = document.getElementById('searchInput');
const placeImage = document.getElementById('placeImage');
const placeName = document.getElementById('placeName');
const placeDetails = document.getElementById('placeDetails');
const mapDiv = document.getElementById('map');
let map;
searchInput.addEventListener('input', debounce(searchPlace, 500));
function debounce(func, wait) {
let timeout;
return function executedFunction(...args) {
const later = () => {
clearTimeout(timeout);
func(...args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
}
async function searchPlace() {
console.log('搜索');
const query = searchInput.value;
if (!query) return;
try {
// 使用 MapKit 搜索地点
const search = new mapkit.Search({
region: new mapkit.CoordinateRegion(
new mapkit.Coordinate(39.9042, 116.4074), // 默认北京坐标
new mapkit.CoordinateSpan(0.1, 0.1)
)
});
search.search(query, (error, data) => {
if (error) {
console.error('搜索错误:', error);
return;
}
if (data.places.length > 0) {
const place = data.places[0];
displayPlaceInfo(place);
showMap(place);
}
});
} catch (error) {
console.error('获取地点信息失败:', error);
}
}
function displayPlaceInfo(place) {
placeName.textContent = place.name;
let detailsHTML = '';
if (place.address) {
detailsHTML += `<p class="info-item">地址: ${place.address}</p>`;
}
if (place.phoneNumber) {
detailsHTML += `<p class="info-item">电话: ${place.phoneNumber}</p>`;
}
if (place.url) {
detailsHTML += `<p class="info-item">网址: <a href="${place.url}" target="_blank">${place.url}</a></p>`;
}
placeDetails.innerHTML = detailsHTML;
// 获取地点图片
if (place.pointOfInterestCategory) {
// 这里可以调用其他图片API来获取地点图片
// 示例使用占位图片
placeImage.innerHTML = `<img src="https://source.unsplash.com/800x400/?${encodeURIComponent(place.name)}" class="place-image" alt="${place.name}">`;
}
}
function showMap(place) {
if (map) {
map.remove();
}
map = new mapkit.Map(mapDiv, {
region: new mapkit.CoordinateRegion(
place.coordinate,
new mapkit.CoordinateSpan(0.01, 0.01)
)
});
const annotation = new mapkit.MarkerAnnotation(place.coordinate, {
title: place.name,
data: { place: place }
});
map.addAnnotation(annotation);
}
</script>
</body>
</html>
Having multiple issues with google maps via wireless apply car play.
1.: maps freezing
2.:The direction I’m heading seems to be off and searching some times
3.: The most annoying, the audio doesn’t work when I’m using google maps for a trip.
Topic:
App & System Services
SubTopic:
Maps & Location
We have a setup that's really close to the one used in the example project - Monitoring location changes with Core Location.
In short, we have a flag that indicates whether or not we should start background location monitoring. If the flag is on, after the app starts, we
Create a CLServiceSession with authorization: .always
Create a CLBackgroundActivitySession
The user can perform an action (press a button) to toggle the flag off, in which case we invalidate and dispose of the CLServiceSession and CLBackgroundActivitySession instances and cancel any liveUpdates observation.
So far, so good, everything works as expected.
However, we're experiencing a weird behavior on iPhones with Dynamic Island after there's an app update.
When the user is on the same app version, the behavior is correct.
have the flag on,
background location monitoring works fine,
when the app is in the the background, there's correctly a location indicator in Dynamic Island
the user can go back to the app and turn the flag off (disposing of instances, cancelling location observation), and when the app is in the background, there is no location indicator in Dynamic Island
The problem arises when the user updates the app
open version 1.0 of the app
have the flag on,
background location monitoring works fine,
when the app is in the the background, there's correctly a location indicator in Dynamic Island
download an app update - version 2.0
the app restarts, didFinishLaunchingWithOptions gets called again and we start the background services
dynamic island indicator is correctly showing a location indicator
the user goes into the app, toggles the flag off - turning location observation off, we dispose of everything
now, when the app is moved to the background, there's still a location indicator in the Dynamic Island, even though we're no longer observing location
The indicator is hard to get rid of, there are only 2 ways we've found
restart the device, or
uninstall the app
The question is - is this a bug in the system? Or is there anything we should be doing actively after an app update?
Thank you!
I updated my phone 14 pro to ios 18 and I faced issue with GPS. it’s show me in next Country and after minutes or hours it’s moved to the correct location
how is it can fix it
Hello,
I'm experiencing an issue with the Apple Maps URL scheme when using raw latitude and longitude coordinates in the daddr parameter.
Until recently, using a URL like this worked reliably:
https://maps.apple.com/?daddr=37.7749,-122.4194
This would open Apple Maps and show directions from the current location to the specified coordinates.
However, on recent iOS versions, this URL no longer behaves as expected.
Hello,
Is it possible to retrieve URLs (the URL associated for the specified location) for the Place object when you query the Apple Maps Server APIs? They are available when you make a MKLocalSearch.Request() directly in Swift. We have both iOS and Android apps, and it's not currently possible to get the URLs on Android.
Thanks!