About Location Services and Maps
Using location-based information in your apps is a way to keep the user connected to the surrounding world. Whether you use this information for practical purposes (such as navigation) or for entertainment, location-based information can improve the overall user experience.
Location-based information in iOS comprises two pieces: location services and maps. Location services are provided by the Core Location framework, which provides Objective-C interfaces for obtaining information about the user’s location and heading. Maps are provided by the Map Kit framework, which supports both the display and annotation of maps similar to those found in the Maps app.
At a Glance
Map and location services provide a way for you to enhance user interactions. By incorporating geographic data into your apps, you can orient the user to the surrounding environment or help the user stay connected to other people nearby.
Location Services Provide a Geographical Context for Apps
Location services is all about mobility and the fact that your app is running on a device that can go anywhere. Knowing the user’s geographic location can help you improve the quality of the information you offer, and in some cases it might even be at the heart of your app. Apps that offer navigation features use location services to monitor the user’s position and generate updates. And many other types of apps use location as a way of connecting nearby users socially.
iBeacons Enhance the User’s Experience of a Location
iBeacons provide a way to create and monitor beacons that advertise certain identifying information using Bluetooth low energy wireless technology. Bluetooth low energy beacons that advertise the same universally unique identifier (UUID) form a beacon region that your app can monitor using the Core Location region monitoring support. That said, beacons with the same UUID can be differentiated by the additional information they advertise. While a beacon is in range of the user’s device, apps can also monitor for the relative distance to the beacon.
You can use the information advertised by beacons to enhance the user’s experience of a particular location. For example, a museum app can monitor for beacons placed near the museum’s important exhibits. As a user approaches a particular exhibit, the app can use the relative distance of the beacon as a cue to provide more information about that exhibit rather than another.
Because beacons advertise information using Bluetooth low energy technology, you can turn any iOS device that supports sharing data using Bluetooth low energy into a beacon.
Heading Information Indicates the User’s Current Orientation
Heading services complement the basic location services by providing more precise information about which way a device is pointed. The most obvious use for this technology is for implementing a compass but this technology is also used to support augmented reality, games, and navigational apps. And even on devices that do not have a magnetometer—the hardware used to get precise heading information—information about the user’s course and speed are still available for apps that need it.
Maps Support Navigation and the Display of Geographically Relevant Content
Maps are a way to visualize geographical data in a way that is easy to understand. The Map Kit framework provides standard views that you can incorporate into your app and use to display information tied to specific geographic points. In addition, this framework provides the means to layer custom information on top of the map and have it scroll along with the rest of the map content.
Routing Apps Provide Directions to the User
A routing app is an app that is able to receive coordinates from the Maps app and use those coordinates to provide point-to-point directions to the user. Apps that provide navigation capabilities can declare themselves as a routing app with minimal additional effort. In addition to driving and walking directions, routing apps can support many other modes of transport, including taxi, airplane, and many public transportation options.
How to Use This Document
You don’t have to read this entire document to use each of the technologies. The services provided by the Core Location and Map Kit frameworks are separate and can be used independent of other services. Therefore, the beginning of each chapter introduces the terminology and information you need to understand the corresponding technology followed by examples and task-related steps on how to use it. The only exception is the “Annotating Maps” chapter, which builds on the information presented in the “Displaying Maps” chapter.
For information about the classes of the Core Location framework, see Core Location Framework Reference.
For information about the classes of the Map Kit framework, see Map Kit Framework Reference.