Wednesday, April 20, 2016

The Apple Maps API


Apple appear to be on the verge of releasing a JavaScript API for Apple Maps.

The website for Apple's WWDC (developer conference) includes an Apple Map showing the location of the conference.  The map has been added to the page using what appears to be a new Apple Mapkit API -

https://cdn.apple-mapkit.com/mk/3.0.0/mapkit.js

If you look at the JavasScript code which uses the Apple Mapkit API to add the map to the WWDC conference (https://developer.apple.com/wwdc/attending/scripts/maps.js) you can see that it includes an API key. This suggests that Apple does have plans to open up the Apple Mapkit API to developers.

Tim Broddin has quickly put together a proof of concept demo map using the officially unreleased Apple Mapkit API. Tim's map has simply used the same developer key as used in the WWDC map.

Tim's map doesn't include a lot of features but if you have a look at the source code you should be able to work out how to add a geolocation control to detect and center the map on the user's location.

If you examine the JavaScript file for the WWDC map you can see how map markers are added to the map and how to center the map on different locations.
Post a Comment