Route Profile
- UIKit
This example demonstrates how to use GEMKit in a UIKit application to calculate a pedestrian route with terrain profiling enabled and display interactive elevation, surface, road type, and steepness charts.
Check the full implementation on GitHub.

UI and Map Integration
The view uses a MapViewControllerDelegate to update the profile charts when the user taps a different route:
Route Preferences with Terrain Profiling
setBuildTerrainProfile(true) must be set on the RoutePreferencesObject before calculation for elevation data to be available:
Embedding the Profile Panel Below the Map
showRouteProfile() embeds RouteProfileViewController as a child of MapViewController, pinned to the bottom edge. The map area edge insets account for the panel height so the calculated route is not hidden behind it:
Route Profile Charts
RouteProfileViewController presents four chart types — elevation, surfaces, road types, and steepness — in a scroll view. Each chart is interactive and highlights the corresponding segment on the map:
Populating the Elevation Chart using the Terrain Profile
refreshChartData() retrieves the terrain profile from the route via getTerrainProfile(), reads the elevation range and samples the altitude values at evenly-spaced distance intervals. Each sample becomes a ChartDataEntry that is fed into the LineChartView:
This example uses a 3rd party charting solution, use the terrain samples and implement them in your data visualization implementation or use them to populate the charting library of your choice.
ElevationChartViewController, SurfacesChartViewController, RoadsChartViewController, and SteepnessChartViewController each contain extensive charting logic and use a third-party charting library (Charts) for rendering. The full implementations, including axis formatting, highlight callbacks, zoom synchronisation with the map and more, are too large to reproduce here efficiently. Check the full implementation on GitHub for details.