Here Map: Different routes are drawn for same starting location and destination in iOS app and in web using JavaScript

206 Views Asked by At

I am using Here map to plot routes in my app. Now I have noticed that different routes were plotted in iOS and web app (javascript) for certain routes despite being given the same parameters. I'm giving the same starting location, destination, and intermediate waypoints.

iOS code

   let routingMode = NMARoutingMode.init(
        routingType: NMARoutingType.fastest,
        transportMode: NMATransportMode.truck,
        routingOptions: NMARoutingOption.avoidBoatFerry
    )
    routingMode.speedProfile = .fast
    routingMode.truckType = .truck
    return routingMode

enter image description here

JavaScript code

 routeRequestParams = {
     mode: 'fastest;truck;boatFerry:-1',
     speedprofile: 'fast',
     truckType: 'truck',
     representation: 'navigation',
     routeattributes : 'waypoints,summary,shape,legs',
     maneuverattributes: 'direction,action',
     waypoint0: 'lat1,long1', // Brandenburg Gate
     waypoint1: 'lat2,long2'  // Friedrichstraße Railway Station
   };

enter image description here

Any idea why this is happening?

1

There are 1 best solutions below

0
On

In general this is expected behavior because of the difference in underlying Map data used by HERE Mobile SDK and HERE Routing API (which is used by Javascript API). If the use case is something like transferring a route in a Back office application (using Javascript API) to the Mobile device, you would follow the approach described in the thread: Backend Calculated Route,Here-API to just show Guidance and route on Map