function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kim MoutesKim Moutes 

Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details.

Hello-
We created a Visualforce page for Google Maps in our instance back in June of 2014 and it has worked perfectly until today when we started receiving the "Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details." error on every account using this page layout. I'm not sure if it has anything to do with us receiving the Spring 17 release over this past weekend. I did notice that when I went into the page detail of the Visualforce page that the API version is 30.0. All throughout the Spring 17 Release Notes it talks about version 39.0. Could this be my issue? Would a solution be to delete the Visualforce page and create it again? Would it automatically use version 39.0 when I create it? Just a few questions. Any help would be greatly appreciated. 

Thank you,
Kim
Best Answer chosen by Kim Moutes
Kim MoutesKim Moutes
Confirmed on another post that you do indeed need to pass an API key as part of the request to Google now.  Here's how I fixed this.

If you already have a developer Gmail login for your company, maybe use that.  Otherwise, create a new one.

After logging into Gmail go to https://developers.google.com/maps/documentation/javascript/ and click the Get a Key button - per the documentation this will be a free key that allows up to 25k calls a day.

From the Salesforce VisualForce page where you've saved the code for this map, you need to update the two lines to include the key you generated (replacing "[KEYGOESHERE]" with the actual key. I learned this after reviewing the "hello world" documentation found here - https://developers.google.com/maps/documentation/javascript/tutorial):

<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=[KEYGOESHERE]&sensor=false"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?key=[KEYGOESHERE]"></script>

That's it, my maps are up and running again... at least for the first 25k account pages views/day anyhow.

All Answers

Kim MoutesKim Moutes
Confirmed on another post that you do indeed need to pass an API key as part of the request to Google now.  Here's how I fixed this.

If you already have a developer Gmail login for your company, maybe use that.  Otherwise, create a new one.

After logging into Gmail go to https://developers.google.com/maps/documentation/javascript/ and click the Get a Key button - per the documentation this will be a free key that allows up to 25k calls a day.

From the Salesforce VisualForce page where you've saved the code for this map, you need to update the two lines to include the key you generated (replacing "[KEYGOESHERE]" with the actual key. I learned this after reviewing the "hello world" documentation found here - https://developers.google.com/maps/documentation/javascript/tutorial):

<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=[KEYGOESHERE]&sensor=false"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?key=[KEYGOESHERE]"></script>

That's it, my maps are up and running again... at least for the first 25k account pages views/day anyhow.
This was selected as the best answer
AlvaroMattosAlvaroMattos
Kim, great input. Thank you very much. 
Julien MontierJulien Montier
Thank a lot for the input Kim
Kim MoutesKim Moutes
You're welcome!
Rachuri LakshminarayanaRachuri Lakshminarayana
ITS working good ,but its did not shown map
Nisha RadhaNisha Radha
Where is the get key button ?