-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looks like restricted keys cannot be used? #29
Comments
I am having the same issue. Is there a patch for this? |
@a-ssassi-n @tbaustin example? |
Hi Shukerullah, Thank you for replying. When we do an HTTP Referrer restriction for our domain (under Application Restriction inside Google Console), we get this error message on the console. Error: API keys with referer restrictions cannot be used with this API.. The package only seems to work when the HTTP restriction is removed. P.S I also tried wildcard under the allowed domain: Is there something we are missing? Update 1: Update 2: Cheers!!! |
this package is using the wrong google address. |
Updated google address. Thanks @mnlfischer |
You cant use the Google api with http restrictions, it is only working on client side. Google api is only working with IP restrictions from server side. If you want to use http restrictions, use the Google Maps JavaScript API v3. |
Unfortunately this still seems to be an issue, @shukerullah will you be able to update the package to fix this? Thanks |
@rossjcooper Noted. I will update this soon. |
Any update on this? Or any clue what the underlying issue is? |
If you want to use google maps in react, try to use a package that uses google maps javascript v3. This package use fetch URL API so it will be restricted. Try a package that follow this documentation example. https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingStatusCodes |
@robbycp same problem - any other package recommendation? |
I use react-google-maps to render maps. Then i could access geocoder class in try {
if (window.google?.maps) {
const geocoder = new window.google.maps.Geocoder()
const response = await geocoder.geocode({
location: {
lat: latValue,
lng: lngValue,
},
})
const result = response.results[0]
if (result) {
handleCoordinate(latValue, lngValue, result.formatted_address)
}
}
} catch (error) {
console.error(error)
} |
Hello, Thank you for bringing this to our attention. The latest version of the package now uses https://maps.googleapis.com/. Could you please test this version and confirm if the issue is resolved? Feel free to reopen the issue if needed or if you have further feedback. |
This isn't fixed yet |
If we set an application restriction for the API key in the GCP console, it doesn't work. Getting the following error message Google is expecting a referer param in the payload. which is missing, I guess |
https://stackoverflow.com/a/52930354/3003133 Server-side, static addresses https://developers.google.com/maps/documentation/geocoding/overview#why-use-the-geocoding-api
Client-side, dynamic addresses https://developers.google.com/maps/documentation/javascript/geocoding
|
No description provided.
The text was updated successfully, but these errors were encountered: