You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constv=newValhalla();v.directions([[47.380742,8.512516],// pass as [lat, lon][47.359467,8.557835],],"auto").then((d)=>{console.log(d)// do stuff with the directions responsed.directions.forEach((direction)=>{console.log(direction.feature)// get the route as GeoJSON featureconsole.log(direction.feature.properties.distance)// get the route distanceconsole.log(direction.feature.properties.duration)// get the route duration})})
the method directions launch an http request which trigger CORS preflight because the request headers aren't considered "simple" (see mdn doc and Valhalla server accept exclusively GET and POST requests so if the browser trigger an OPTION (because your request isnt "simple") it will fail
i tried using this package in my vue 3 app
the method
directions
launch an http request which trigger CORS preflight because the request headers aren't considered "simple" (see mdn doc and Valhalla server accept exclusively GET and POST requests so if the browser trigger an OPTION (because your request isnt "simple") it will failthe following code work
or POST
I've tried with both the public endpoint and the self hosted version.
The text was updated successfully, but these errors were encountered: