The goal of this chapter, therefore, is to provide an overview of the steps necessary to present the application user with location, map and satellite imagery using the Map Kit Framework and, in particular, the MKMap View class.
In the next chapters, this example application will be extended to make use of the Map Kit local search and directions features.
The Map Kit Framework is based on the Apple Maps data and APIs and provides i OS developers with a simple mechanism for integrating detailed and interactive mapping capabilities into any application.
The core element of the Map Kit Framework from the point of view of the app developer is the MKMap View class.
The location, updating and heading property are readonly as you cannot set your location programatically, likewise you cannot update your heading programatically.
The way you would set these properties is simply by pointing the phone in another direction or by walking somewhere else. The title and subtitle properties are not readonly.
This class is a subclass of UIView and provides a canvas onto which map and satellite information may be presented to the user.
You would do that with the following code: The result would be what you see to the right. It provides you with where you are, where you are heading and lets you know if the location is being updated.
Purchase the full i OS 10 / Swift 3 / Xcode 8 edition of this book in e Book (.99) or Print (.99) format.i OS 10 App Development Essentials Print and e Book (e Pub/PDF/Kindle) edition contains over 100 chapters. The objective of this tutorial is to develop an i OS application designed to display a map with a marker indicating the user’s current location.
Buttons located in a navigation bar are provided to allow the user to zoom in on the current location and to toggle between map and satellite views.
Given this complexity, the map view tutorial in this chapter will declare the span in terms of distance.
Purchase the full i OS 10 / Swift 3 / Xcode 8 edition of this book in e Book (.99) or Print (.99) format.i OS 10 App Development Essentials Print and e Book (e Pub/PDF/Kindle) edition contains over 100 chapters. A Map Kit feature that was introduced in i OS 9 allows the departure and arrival times and estimated travel duration to a destination using public transit to be obtained from within an i OS app.