Apple Maps Server API

RSS for tag

Increase performance, lower data usage, and improve battery life across platforms for a variety of Apple Maps features.

Apple Maps Server API Documentation

Posts under Apple Maps Server API tag

12 Posts
Sort by:
Post not yet marked as solved
0 Replies
44 Views
I am trying to migrate some of my mapkit code to the Map Server API. My JWT is fine and I can use that within the API Playground just fine. However, when I try to implement a test using PHP and cURL to get my Map token, I receive a 401 Not Authorized Error. My code is below: <?php $URL="https://maps-api.apple.com/v1/token"; $accesstoken = "<MY TOKEN HERE>"; $authorization = 'Authorization: Bearer'.$accesstoken; $headers = []; $ch = curl_init($URL); curl_setopt($ch, CURLOPT_HTTPHEADER, [$authorization]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$headers) { $len = strlen($header); $header = explode(':', $header, 2); if (count($header) < 2) // ignore invalid headers return $len; $headers[strtolower(trim($header[0]))][] = trim($header[1]); return $len; } ); $result=curl_exec($ch); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code curl_close ($ch); print_r($headers); echo($result); echo($status_code); ?> Now the exact response that I am receiving is: Array ( [date] => Array ( [0] => Thu, 18 Apr 2024 18:32:15 GMT ) [content-type] => Array ( [0] => application/json;charset=utf8 ) [content-length] => Array ( [0] => 51 ) [connection] => Array ( [0] => keep-alive ) [cache-control] => Array ( [0] => max-age=0 ) [x-rid] => Array ( [0] => c9507281-bc32-46ac-be3b-dc59e97e7fed ) [strict-transport-security] => Array ( [0] => max-age=31536000; includeSubDomains; ) ) {"error":{"message":"Not Authorized","details":[]}} 401 Any help getting this to work would be appreciated.
Posted
by kmaynard.
Last updated
.
Post not yet marked as solved
0 Replies
239 Views
I am making an app like Taxi Driving, where users can add location and driver to that location. The problems I am facing are below: Drawing a route on MKMap - I get the route polyline and I render that on the map. Now what should happen as I am driving, the drove part of the polyline should get removed or may be turned grey, non-drove part should be blue. Currently, I am only able to do this by again getting a route from my current location and re-drawing on the map which is not a good thing I suppose. Show driving instructions - I need to show step-by-step instructions which I get in the MKStep under the MKRoute object. But I don't get the icons that I can show such as Turn Right or Turn left the only thing I have is plain text. I need an icon along with it and also how to identify once I have crossed the step and show the next step as my next instruction. These two are the major problems I am facing and I need to do this with Apple native map view itself so no third-party integration I want.
Posted Last updated
.
Post not yet marked as solved
0 Replies
330 Views
Regardless of how much information is provided to the Maps searchAutoComplete API, the response field structuredAddress is always null. This means I have to call the completionUrl afterwards to get a structured address. This consumes our quota and causes unnecessary Maps traffic. Example request, autocompleting "450 Post St, San Francisco": https://maps-api.apple.com/v1/searchAutocomplete? q=450%20Post%20St%2C%20San%20Francisco &resultTypeFilter=Address &limitToCountries=US &lang=en-US responds 2 results with the actual address found, but each having only these fields: - completionUrl - displayLines - location Example: { "results": [ { "completionUrl": "/v1/search?q=450%20Post%20St%20San%20Francisco%2C%20CA%2C%20United%20States&metadata=Ch8KCzQ1MCBQb3N0IFN0EgQIABADEgQIBBAEEgQICRACEjQKIFNhbiBGcmFuY2lzY28sIENBLCBVbml0ZWQgU3RhdGVzEgQIGhACEgQIABADEgQIBBAJGAIyRgoSCQAAAEDg5EJAEQAAAOA9ml7AEM6h0aK1wfKqciA5KQAAAAAAAHlAgvEEAzQ1MIjxBDGa8QQCVVOg8QQAsvEEALrxBABiHAoaNDUwIFBvc3QgU3QsIFNhbiBGcmFuY2lzY2%2BC8QQaNDUwIFBvc3QgU3QsIFNhbiBGcmFuY2lzY2%2BI8QQA2vEEFgkAAABAEf3IQBkAAAAAAAAAACABKAPq8QQAkPIEAQ%3D%3D", "displayLines": [ "450 Post St", "San Francisco, CA, United States" ], "location": { "latitude": 37.78809356689453, "longitude": -122.41002655029297 } }, { "completionUrl": "/v1/search?q=450%20Post%20St%20Napa%2C%20CA%2C%20United%20States&metadata=****", "displayLines": [ "450 Post St", "Napa, CA, United States" ], "location": { "latitude": 38.30093002319336, "longitude": -122.27799224853516 } } ] } Anyone figured this out? Seems buggy to me.
Posted
by steluhh.
Last updated
.
Post not yet marked as solved
0 Replies
262 Views
Hi, based on https://developer.apple.com/help/account/configure-app-capabilities/create-a-maps-identifier-and-private-key described, I need to create an Identifier before I can create JWT for MapKit JS. However, I cannot find Maps Ids checkbox when I attempt to set up first MapKit JS access.
Posted Last updated
.
Post not yet marked as solved
0 Replies
354 Views
Can Mapkit show me details about bus stops, train stations, underground and overground stops, or other public transportation locations based on a specific latitude and longitude? If you check the Google Maps picture I shared, I marked all the public transportation spots near Elephant & Castle in London. This includes bus stops, the Elephant & Castle Underground station, and the Elephant & Castle Rail station. Additionally, tapping on these spots brings up an alert with more info, like which buses are coming or details about train lines.
Posted
by AKA77.
Last updated
.
Post not yet marked as solved
0 Replies
277 Views
I am currently facing a critical issue with the Google Maps integration in my iOS app. The application functions flawlessly on my personal device during development; however, when I upload it to the Apple Store, users on their iPhones experience frequent crashes. The problem seems to be specifically tied to the Google Maps functionality within the app. Despite thorough testing on my end, the discrepancy between the local environment and the App Store release persists. I am seeking assistance from fellow developers to help me identify and rectify the root cause of this problem. Any insights, suggestions, or debugging tips would be greatly appreciated to ensure a smooth and reliable user experience for all. Thank you in advance for your expertise and support in resolving this issue.
Posted Last updated
.
Post not yet marked as solved
0 Replies
288 Views
I am adding Apple Maps using the API to my Apple IOS to show address to be visited. another feature we require is to have the addresses showing in the best order to be able to visit each one in the fastest time. I am wondering if apple allow to upload multiple addresses via a API and the addresses will be optimised and returned back to my app in the fastest order Is there a SDK that will allow this function?
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.3k Views
Hello, I'm trying to figure out how to detect when user stops scrolling (panning) the map. The problem: I have a MapAnnotation that I want to always keep in the centre, even is user is panning/scrolling the map. When map is open first time, the original annotation location is user's current location. I request the name of the location to display it on top of the annotation. when user moves the map around, I want to track when he stop this action and select a location in the centre of map's new region and display the a location's name on top of the annotation I can't use .onChange() because region centre changes constantly as user moves the map, because it causes to many requests for location's name DragGesture .onEnded() is never called, so I have no idea when customer stops moving the map So my question is - how to detect in this case when customer stopped moving the map? Have anyone faced the same problem? Any ideas how to solve it?
Posted
by AndySh.
Last updated
.
Post not yet marked as solved
0 Replies
468 Views
Hi everyone, I just implemented MapKitJS into my Ionic Vue app. At the same time I noticed a disproportionate amount of service calls (see image) without implementing dedicated calls to the Apple Maps Server API for example for autocompletion. Therefore the question arrised: Are those service calls mentioned in the MapKitJS Dashboard something differenent to the Apple Maps Server API, due to both disclaimed with 25k service calls free per month. Added to that, what causes those services calls in the MapKitJS implementation and how can it be made more efficent to make optimal use of the Apple Maps Server API calls? Thanks for clarifing and helping out.
Posted
by Praise99.
Last updated
.
Post not yet marked as solved
1 Replies
738 Views
Hello, Playing around with the MapJs Snapshot API. How many individual Overlays can it support? The docs say max for Images is 10 but not listing number of Overlays/Annotations it can support. Trying to generate a gradient path like so: But it seems the Apple Snapshot api only allows for 10 unique Overlay objects, is that true? Also, what's the max size of a Snapshot query url? Seems to stop working around 5,000 characters but Google allows for 8000+
Posted
by escullz.
Last updated
.
Post not yet marked as solved
0 Replies
527 Views
I'm currently playing with Apple Map's MapKit for SwiftUI, aiming to make a tool that helps me navigate inside the airport as I find out that Apple Map in my iPhone can direct me within the airport from gate to gate. I want to integrate this function into my SwiftUI application, but I believe that MapKit only gives directions between places to places, like from my home to the airport, but not directions travelling indoor in the airport. Are there any ways for me to integrate the Apple Map that supports airport's indoor navigation into my App? Thanks!
Posted
by 0010SS.
Last updated
.