Jump to content

Recommended Posts

Posted

Hi,

I used this module since long time and it worked fine. But I wanted to change an address today and I got an REQUEST DENIED error. I didn't change anything to my API key. I just check, and Geocoding API and Maps JavaScript API are enable.
I updated to 3.0.0 module also recently, so I don't know if it's related or not. image.thumb.png.f4eb35be274e45db6afde0bb25387af8.png

Thanks

  • 1 month later...
  • 2 months later...
Posted

Hi @ryan

console log shows

js?key=XXXXXXXXXXXXXXX:175 As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.

  • 1 year later...
Posted

Has something changed with the module? Or has Google changed how the keys work?

If you enter an address in the search input once it loses focus it geocodes on the front end. All good. But if you type a new address and save it it tries to geocode on the backend and you get a REQUEST_DENIED error since you can't have a key (unless you have it unrestricted, bad idea) that works by both referrer and IP address and both coordinate fields are set to 0.

I'm sure it didn't used to work this way.

Why does it even bother to do server side geocoding if you can only set one key? Is there any way to force it to geocode on the front end only?

And sorry I might be misremembering but couldn't you click a point on the map and put the marker there? I can't seem to do that now.

Posted

@DrQuincy Please see this comment on the thread for my translation module and Google Cloud Translate. It appears that something did change and might be similar to your situation.

 

  • Like 1
Posted

Thanks @FireWire. I tried your PR code but it didn't work for some reason. I have ended up adding this to the $(document).ready() code at the bottom:

$('.InputfieldMapMarkerAddress input[type="text"]').each(function() {

	$(this).on('keydown', function(e) {

	    if (e.key == 'Enter') {

			e.preventDefault();

			// Trigger Geocode by removing focus on search box
			this.blur();

			return false;

	    }

	});

});

It just prevents the form being submitted on hitting the enter key and blurs the input forcing it to geocode client-side. This seems to work for me although I haven't really tested it much yet.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...