GIScience / ors-map-client

Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet
http://maps.openrouteservice.org
Apache License 2.0
106 stars 32 forks source link

useUserKey: false - Not Working Correctly #317

Open homerjonathan opened 1 year ago

homerjonathan commented 1 year ago

We are hosting our own internal ORS geocode service. So we do not require the api_key to be sent in the request.

Inside the app-config.js file we alter the useUserKey to false so we expect the api_key to not be sent.

  orsApiKey: '', // ORS API key to be used on the ORS requests. You can get one here: https://openrouteservice.org/dev/#/signup
  useUserKey: false, // If the app is using a user ORS API key. // Don't change this unless you know what your doing!

However we can see in the network requests the api_key is included as below:

https://demo.com:8080/pgeocode/reverse?api_key=[object%20Object]&point.lon=-1.7635202407836914&point.lat=52.48031035388887&size=10

This then means our Pelias geocoder complains about the extra unknown parameter.

Have we done something wrong. Or is there an issue where the API Key is always sent despite it being switched off.

TheGreatRefrigerator commented 1 year ago

Hi @homerjonathan,

there is currently no option to not pass a key. If you use useUserKey: false you will not use the orsApiKey specified in the config, but the key for our live map client which is restricted.

It might be faster to either allow the unused parameter in the pelias instance, or cut it out before sending it there. But you can also adjust the ors-api-runner.js file where it uses the Geocoding endpoint and just remove the api_key parameter.

Once you build the app again it might work with your instance.

Best regards & happy holidays (although you seem to be working :)