Search code examples
navigationhere-api

Here maps iOS sdk avoid particular roads


I was working on a navigation app for iOS, using here maps sdk. I wanted to get a route from source and destination by avoiding a particular road in between. I checked with the routing api where it provides me an option like avoid area. Is there anything same in iOS sdk of here maps. If not, how can I use the response from routing api to draw a polyline or navigation in iOS. Can anyone of you here please help me on finishing this task.

Thanks in advance.


Solution

  • On MobileSDK side, you can use the dynamic penalties.

    When setting up the NMACoreRouter for route calculation, set the dynamicPenalty property, that can penalize (addPenalty) or ban (addBannedArea) areas or concrete road elements.

    Link to the iOS API reference: https://developer.here.com/documentation/ios-premium/topics_api_nlp_hybrid_plus/interfacenmadynamicpenalty.html