Forum
PERCH_GMAPS_API_KEY
Hi
I'm having problems getting Google Maps to recognise my API key.
12 second screencast shows my problem
I was wondering if there are any other steps I need to take to make this work?
- Updated to Perch 2.8.30
- Created a Browser API key at console.developers.google.com
- Added
define('PERCH_GMAPS_API_KEY', 'MY KEY HERE');
to config.php
I've cleared browser cache, restarted the browser. Still seeing this message:
I'm not sure why it's saying InvalidKey, the key in config.php matches the key in Google API manager.
I initially setup HTTP referrers at console.developers.google.com, but I've left this blank for the moment
Any ideas?
Report
- Perch Runway is up to date 2.8.30
- PHP 5.4.45 version is okay, but a little out of date. Consider updating soon.
- MySQL 5.0.95 is up to date
- Image processing available
Have you published your map content since adding the key?
That's what I was seeing too.
I hacked the field type file itself to include the API key in the static maps/default title request as it is required by Google now.
However, you might not need to (and should not) do that. Did you go back in to the region in the back-end and re-save? I had to press the save button twice until I definitely saw the green flash at the top of the screen to say that it had updated. Then I republished all pages for good measure.
Whoops!
Re-saving the region did the trick.
Thanks for the reply Paul and thanks Drew, great support as always.
... It's Friday, long week. That's my excuse! :) ha
Does this resaving of region need to be done for every item? I'm seeing a similar problem with websites with many properties. Having to resave every property (region) will be very time-consuming. Republish pages doesn't seem to correct the error.
Hi Clive,
I had to re-save each region rather than just republish, yes. I only had about 10 to deal with though.
I see there is a new update to Perch out (https://grabaperch.com/update/v2-8-31) that mentions the API key being added to the static map request that gets made before the javascript API call kicks in. Not sure there is anything extra in there though that negates the need to do the re-saving though? Because as you say the republish routine doesn't seem to update the call (and now key) that's stored in the DB.
Paul.
I won't be able to save every region individually because this will take hours ... so I need another way.