Open ianfieldarsclinica opened 7 years ago
I am experiencing the same issue and I have decided not to use this package but use Googles web api.
const PROXY_URL = 'https://cors-anywhere.herokuapp.com/';
const TARGET_URL = 'https://maps.googleapis.com/maps/api/place/autocomplete/json?&key=KEY'
const URL = PROXY_URL + TARGET_URL
this way using the proxy url you will be able to call the api
Trying to call places.autocomplete from a browser app (vue.js). Sorry if this turns out to be a question rather than an issue,.
Here's the code:
Chrome is complaining:
Fetch API cannot load https://maps.googleapis.com/maps/api/place/autocomplete/json?input=vermont&types=(Regions)&language=en&sensor=false&key=xxx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.