Robertas Setkus
Robertas Setkus

Reputation: 3161

Dynamically load Google maps

If there was no internet connection at that moment - program can't execute remote script and create google object. Later i'm trying to reload google maps script like this:

if($.isEmptyObject(google)) {
    $.getScript('https://www.google.com/jsapi?sensor=true', function () {
        google.load("maps", "3");                       
    });             
}

I'm getting this kind of message: Google Maps API server rejected your request. within the sensor parameters must be set to true or false. Why?

Upvotes: 0

Views: 362

Answers (1)

wroniasty
wroniasty

Reputation: 8072

This works for me:

if($.isEmptyObject(google)) {
   $.getScript('https://www.google.com/jsapi', function () {
    google.load("maps", "3", {'other_params' : 'sensor=true' });                       
   });             
}

Upvotes: 1

Related Questions