Keplerjs / keplerjs-openrouteservice

keplerjs plugin for OpenRouteService API
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

directions geojson format problem #6

Closed stefanocudini closed 5 years ago

stefanocudini commented 5 years ago

hi I have tested this code:

var Ors = Npm.require('openrouteservice-js');

var directions = new Ors.Directions({
    api_key: '<MY_SECRET_KEY>'
});
directions.calculate({
    instructions: false,
    coordinates: [[10.88476896,45.92084111],[10.89092731,45.92013953]],
    format: 'geojson'
})
.then(function(json) {
    console.log('then', json)
})
.catch(function(err) {
    console.warn("error",err);
});

that produce this request:

POST /v2/directions/foot-hiking/geojson HTTP/1.1
Host: api.openrouteservice.org
Accept-Encoding: gzip, deflate
User-Agent: node-superagent/4.1.0
Content-Type: application/json
Authorization: <MY_SECRET_KEY>
Accept: application/json
Content-Length: 186
Connection: close

{"instructions":false,"coordinates":[[10.88476896,45.92084111],[10.89092731,45.92013953]],"preference":"fastest","units":"m","language":"en","geometry":true,"instructions_format":"text"}

but is show an exception:

{"error":{"code":2007,"message":"This response format is not supported"}