Hi,
I have setup graphhopper open source setup locally using this guide. The graphhopper instance is running smoothly on my local environment and I can call the Routing Api.
But when I try to call the Routing Api with optimize=true, it is not returning the paths[0].points_order
, as mentioned in the docs here. I have even tried to call the same API using Postman (REST client) and the result is same, no points_order
in the resulting json.
Here is my code to call the routing API…
$(document).ready(function (e) {
jQuery.support.cors = true;
//
// Sign-up for free and get your own key: https://graphhopper.com/#directions-api
//
var defaultKey;
// create a routing client to fetch real routes, elevation.true is only supported for vehicle bike or foot
_ghRouting = new GraphHopper.Routing({
key: defaultKey,
host: _graphhopperHost,
graphhopper_maps_host: _graphhopperHost,
vehicle: "car",
optimize: true,
instructions: false,
elevation: false
});
_routingMap = createMap('routing-map');
setupRoutingAPI();
});
function setupRoutingAPI() {
//somewhere in Copenhagn
_routingMap.setView([55.637613, 11.959697], 12);
_routingMap.on('click', addPointOnMap);
_routingLayer = L.geoJson().addTo(_routingMap);
_routingLayer.options = {
style: {color: "#00cc33", "weight": 5, "opacity": 0.6}
};
}
Can anyone tell me what am I doing wrong here?
Regards,
Naveed Butt