Google map no longer works - error says API key required

1 reply · opened Sep 12, 2018

Mmighty-cleverSep 12, 2018

My google map on my contacts page is no longer working. The js console error I'm getting refers me to this article https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys:

Excerpt: _The script element that loads the API has no API key. Please make sure you include a valid API key as a key parameter. You can generate a new API key on the Google Cloud Platform Console.

See Obtaining an API key.

If you are loading Maps JavaScript API from the deprecated v2 path with an old v2 key, you will get the NoApiKeys warning, even if you specified the key parameter. Please check the v2 to v3 upgrade guide and migrate your application to Maps JavaScript API v3._

I couldn't find anything in the Canvas Documentation for adding an API key. So I tried generating then adding my API key (see code below), but the map will not load. This is the code I'm using at the bottom of my contact page:


	
	

		$('#google-map').gMap({

			latitude: 41.0464983,
			longitude: -111.9631375,
			maptype: 'ROADMAP',
			zoom: 15,
			markers: [
				{
					latitude: 41.0464983,
					longitude: -111.9631375,
					html: 'Hey, we\'re Mighty Clever',
					icon: {
						image: "images/mightyclever/icons/map-icon-orange.png",
						iconsize: [32, 39],
						iconanchor: [13,39]
					}
				}
			],
			doubleclickzoom: false,
			controls: {
				panControl: true,
				zoomControl: true,
				mapTypeControl: true,
				scaleControl: false,
				streetViewControl: false,
				overviewMapControl: false
			}
		});

	

My map had been working fine, and I wonder if it's due to Google's recent changes with the maps API.

I have the JS linked according to the theme documentation (see below):


	
	
	
	

My live page is http://mightyclever.com/contact.php. Please help!!

Thanks,
Amanda

SSemicolon WebSTAFFSep 17, 2018

Hello,

Yes, this is due to the Recent Changes in the Google APIs. We are already working on Preparing the Documentation on this and will release an Update shortly. Please visit: https://developers.google.com/maps/documentation/javascript/get-api-key to follow their new guide.

This will definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard