Skip to content
Snippets Groups Projects
Commit 1f7c4cab authored by Brandon Bergren's avatar Brandon Bergren
Browse files

Usability: Don't show a JS error when attempting to display a map before the...

Usability: Don't show a JS error when attempting to display a map before the API key has been configured.

This should help when visiting the settings page for the first time, etc. The immediate JS error isn't very nice.
parent 0b4c7d0d
Loading
......@@ -832,6 +832,12 @@ function theme_gmap_align($element) {
* Gmap element theme hook
*/
function theme_gmap($element) {
// Usability: Prevent js errors on first visit to settings page, etc.
// Of course it will still error if the *wrong* key is on file.
if (gmap_get_key() == '') {
return t('Unable to render map: Google Maps API key is missing.');
}
// Track the mapids we've used already.
static $mapids = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment