What’s New in MapKit? An Overview of the Latest Advancements

CI&T Australia
CI&T Australia Tech Blog
5 min readMar 14, 2023

Prashant Singh is a consultant and iOS Specialist who loves helping clients design, architect and implement mobile apps using the latest technologies.

Apple’s MapKit framework, which provides mapping and location-based services to iOS applications, has always been an important part of the iOS ecosystem. Apple has been consistently working on improving its mapping service, and with the introduction of iOS 16, Apple has added several new features to MapKit that will make it even more powerful and user-friendly. In this blog, we will take a closer look at some of the most notable changes and additions.

1: Detailed 3D city experience:

The realistic 3D city view is available as a part of the framework. It provides an immersive and interactive experience for users and includes detailed buildings, roads, and other landmarks. This new feature makes it easier for users to get a better understanding of the terrain and surrounding area and will be especially useful for city exploration and navigation.

To enable it, there is no need to write any lines of code. The app should be built using iOS 16 SDK.

2: Real elevation details

With iOS 16, MapKit now provides detailed information on the elevation of different locations on the map including overpasses and bridges. This can be especially useful for outdoor enthusiasts and fitness enthusiasts who want to know the elevation gain and loss of their route. The elevation information is displayed in real-time as users navigate the map, allowing them to easily see the changes in elevation along their route.

To enable the elevation details, the elevationStyle property should be set while configuring the map view object.

mkMapView.preferredConfiguration = MKStandardMapConfiguration (elevationStyle: .realistic, emphasisStyle: .default)

In the above block of code, elevationStyle is set as realistic to enable elevation details on the map.

To preserve the elevation details while adding a navigation polyline to the map, the route returned by MKDirections class should be used.

let directionRequest = MKDirections.Request ()
directionRequest.source = MKMapItem (placemark: routeStart)
directionRequest.destination = MKMapItem (placemark: routeEnd)
Task {
let direction = MKDirections (request: directionRequest)
do {
let directionResponse = try await direction.calculate()
for route in directionResponse.routes {
mkMapView.addOverlay (route.polyline, level: .aboveRoads)
}
} catch { return }
}

The MKDirections polyline route is also visible if it is hidden behind an object.

3: Blend modes in overlays

This new feature allows the developers to display custom map overlays in unique and creative ways. Through blend modes, an overlay can be made brighter while making the other areas grey. The map content beneath the overlay like trees and roads is also affected by the overlay colour while using blend mode.

To enable blend mode, the blendMode property needs to be set while creating the overlay renderer object.

let renderer = MKPolygonRenderer(overlay: overlay)
renderer.fillColor = .gray
renderer.strokeColor = .gray
renderer.lineWidth = 1.0
renderer.blendMode = .hue

4: LookAround API support

iOS 16 brings Look Around to the MapKit. Look Around provides an immersive street-level view of the map, and it offers an incredible level of detail. It leverages 3D models to provide a level of realism like no other map.

Look Around uses its view controller (MKLookAroundViewController) to present the street view. A scene request using MKLookAroundSceneRequest class and coordinates needs to be placed. If the request is successful, the returned view controller is used to show the street view.

let viewController = MKLookAroundViewController()
viewController.badgePosition = .topLeading
viewController.isNavigationEnabled = true
viewController.pointOfInterestFilter = .excludingAll
viewController.showsRoadLabels = false
let location = CLLocationCoordinate2D (
latitude: Constants.routeStartLatitude,
longitude: Constants.routeStartLongitude
)
let sceneRequest = MKLookAroundSceneRequest (coordinate: location)
Task {
do {
viewController.scene = try await sceneRequest.scene
} catch {
viewController.scene = nil
}
}
return viewController

5: Pricing

Only standard Apple developer membership (AUD149/year) is required to access MapKit and its features for iOS development. For using MapKit JS for web development, a daily limit of 250,000 map views and 25,000 service calls per Apple Developer Program membership is provided for free.

6: Challenges and Limitations:

Although these features bring many benefits, they also come with some limitations. These limitations range from the availability of the features to the dependency on other Apple frameworks. Therefore, it’s important to consider these factors when considering MapKit as the mapping platform for your app.

Some potential challenges and limitations include:

  1. Most features except the detailed 3D city are present in iOS 16 and above.
  2. Detailed 3D city experience requires A12 Bionic and later chipset.
  3. At present, the detailed 3D city experience is only present in a few cities.
  4. Elevation details are not available when adding any overlay to the map.
  5. Map overlay boundaries are not clearly defined when viewing in 3D mode.
  6. To use the full power of blend modes, knowledge of the Core Graphics framework is needed.

--

--

CI&T Australia
CI&T Australia Tech Blog

CI&T partner with the world’s most valuable brands to build digital solutions that transform businesses