I am trying to route source and destination using HERE maps API but somehow when I try to route two cities which divided by sea, the map is showing the route which is passing through that sea but there is no bridge and route needs a go-around. How can I fix it?
Sample code for routing:
function calculateRouteFromAtoB(platform) {
var origin=lat+','+long;
console.log(origin);
var router = platform.getRoutingService(null, 8),
routeRequestParams = {
routingMode: 'fast',
transportMode: 'car',
// origin: ''+origin+'', // Brandenburg Gate
// destination: ''+''+document.querySelector(".myForm i input[name='dlat']").value+','+document.querySelector(".myForm input[name='dlong']").value+'', // Friedrichstraße Railway Station
origin: '21.1702,72.8311', // Brandenburg Gate
// destination: ''+document.querySelector(".myForm input[name='dlat']").value+','+document.querySelector(".myForm input[name='dlong']").value+'', // Friedrichstraße Railway Station
destination: '21.5346,71.8275', // Friedrichstraße Railway Station
return: 'polyline,turnByTurnActions,actions,instructions,travelSummary'
};
console.log(routeRequestParams);
router.calculateRoute( routeRequestParams, onSuccess, onError ); }
and map it gives me is this:
If Some parameters are required to solve this issue or any other maps API better than HERE is appreciated.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/fLi7uXe
Comments
Post a Comment