Calculate Route
- UIKit
- SwiftUI
This example demonstrates how to use GEMKit in a UIKit application to calculate a car route between two coordinates and display it on the map with a summary panel.
Check the full implementation on GitHub.

UI and Map Integration
The following code outlines the main view controller and the embedded map view setup:
Setting Route Preferences and Calculating
Route preferences are configured on a RoutePreferencesObject, then passed to a NavigationContext which performs the calculation. A TrafficContext is used to overlay live traffic data on the result:
This example demonstrates how to use GEMKit in a SwiftUI application to calculate a car route between two coordinates and display it on the map with a summary panel.
Check the full implementation on GitHub.

Map View and Route Display
The map is displayed using MapBase with a declarative MapRoute child that automatically re-renders whenever calculatedRoutes changes:
Setting Route Preferences and Calculating
Route preferences are configured on a RoutePreferencesObject and passed to a NavigationContext. Edge area insets are applied to ensure the route summary fits within the visible map area: