iosswifthere-apiheremapsheremaps-ios-sdk

How to show compass and scale with HERE SDK for iOS Premium Edition?


I'm using the Here SDK for iOS Premium Edition (v3.17). Is there a built in compass and scale to show on the map (like seen in the native HERE WeGo app on iOS when zooming / rotating the map)? Been scouring through the documentation but can't find anything. If there is no built in way... would you mind sharing how this is done (the code would be awesome) in the Here WeGo app?

enter image description here


Solution

  • Unfortunately there is no such API in HERE SDK. HERE WeGo app implemented its own scale view and compass UI components.

    The idea behind compass is to listen to NMAMapEventOrientationChanged events and rotate UIButton with compass image using CGAffineTransformMakeRotation based on map orientation value. Please check this example.

    The idea behind scale view is to listen to NMAMapEventZoomLevelChanged events and update custom view(s) based on metersPerPointAtZoomLevel value.