jsapi for google maps v3?

2,583 views
Skip to first unread message

Don Park

unread,
Jul 4, 2010, 1:48:50 AM7/4/10
to Google AJAX APIs
i think the jsapi approach to loading javascript is a great idea but
its not working for google maps v3.

<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("jquery", "1.4");
google.load("maps", "3");
</script>

it complains that the 'sensor' value needs to be specified but im not
sure where to specify it. ive tried various incantations of
google.load with no success. help!

thanks,
Don

Jeremy Geerdes

unread,
Jul 4, 2010, 6:51:41 AM7/4/10
to google-ajax...@googlegroups.com
Yeah, this is a tricky one. It's not noted in the documentation anywhere that I've seen except one place on the issue tracker. So here's the solution:

google.load('maps', '3', {other_params:'sensor=[true|false]'});

Of course, you need to pick whether you want true or false in the sensor param, but that's it. There is a major documentation update coming very soon, and I'm hoping that it will be included in there.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jrge...@gmail.com

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

> --
> You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
> To post to this group, send email to google-ajax...@googlegroups.com.
> To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
>

Gerrit de Bolster

unread,
Jul 4, 2010, 11:29:45 AM7/4/10
to Google AJAX APIs
Just to be complete: if you want more "ohter_parameters" like
"language" you can add them like you would on a call to an url:
google.load('maps', '3', {other_params:'sensor=false&language=nl'});

On 4 jul, 12:51, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> Yeah, this is a tricky one. It's not noted in the documentation anywhere that I've seen except one place on the issue tracker. So here's the solution:
>
> google.load('maps', '3', {other_params:'sensor=[true|false]'});
>
> Of course, you need to pick whether you want true or false in the sensor param, but that's it. There is a major documentation update coming very soon, and I'm hoping that it will be included in there.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.com
> jrgeer...@gmail.com
>
> If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
>
> On Jul 4, 2010, at 12:48 AM, Don Park wrote:
>
>
>
> > i think the jsapi approach to loading javascript is a great idea but
> > its not working for google maps v3.
>
> >  <script type="text/javascript" src="http://www.google.com/jsapi"></
> > script>
> >  <script type="text/javascript">
> >    google.load("jquery", "1.4");
> >    google.load("maps", "3");
> >  </script>
>
> > it complains that the 'sensor' value needs to be specified but im not
> > sure where to specify it. ive tried various incantations of
> > google.load with no success. help!
>
> > thanks,
> > Don
>
> > --
> > You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
> > To post to this group, send email to google-ajax...@googlegroups.com.
> > To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/google-ajax-search-api?hl=en.- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

omr

unread,
Jul 5, 2010, 11:48:46 PM7/5/10
to Google AJAX APIs

Though unfortunately not yet mentioned in Maps API v3 (non-Premier)
documentation, the "other_params" property is mentioned in the Loader
documentation, Maps API Premier documentation, and Maps API v2
documentation.

.

http://code.google.com/apis/ajax/documentation/#DetailedDocumentation

> "... other_params: This is an object that contains options
typically only supported by a particular API (and usually very
specific to the API). If you would typically send in a parameter by
via a script tag for an API, you can send it in other_params
instead. ..."

.

http://www.google.com/search?q=site:code.google.com/apis/maps/documentation+google.load+other_params+-inurl:https&filter=0

http://code.google.com/apis/maps/documentation/javascript/v2/basics.html#SpecifyingSensor

http://code.google.com/apis/maps/documentation/premier/guide.html#CommonLoader

> google.load("maps","3", {"other_params": [...] });

.

Alternatively you can load the API dynamically via script element.
For v3:

function apiLoaded() { ... }

var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.google.com/maps/api/js?
v=3&callback=apiLoaded&sensor=false";
document.body.appendChild(script);

-- omr

ciphertext

unread,
Aug 9, 2010, 10:17:45 AM8/9/10
to Google AJAX APIs
omr,

After reading the documentation you linked to, it would appear that
ability to load version 3 of the Google Maps API via JSAPI is
available only to premier members. It says you must include your
client ID.

On Jul 5, 11:48 pm, omr <omr99...@yahoo.com> wrote:
> Though unfortunately not yet mentioned inMapsAPIv3(non-Premier)
> documentation, the "other_params" property is mentioned in the Loader
> documentation,MapsAPI Premier documentation, andMapsAPI v2
> documentation.
>
> .
>
> http://code.google.com/apis/ajax/documentation/#DetailedDocumentation
>
>   > "... other_params: This is an object that contains options
> typically only supported by a particular API (and usually very
> specific to the API). If you would typically send in a parameter by
> via a script tag for an API, you can send it in other_params
> instead. ..."
>
> .
>
> http://www.google.com/search?q=site:code.google.com/apis/maps/documen...
>
> http://code.google.com/apis/maps/documentation/javascript/v2/basics.h...
>
> http://code.google.com/apis/maps/documentation/premier/guide.html#Com...

Jeremy Geerdes

unread,
Aug 9, 2010, 10:48:21 AM8/9/10
to google-ajax...@googlegroups.com
To load Maps v3 via the JSAPI, use this call:

google.load('maps','3',{other_params:'sensor=false'});

omr was simply noting that it's in the Premier docs, which are separate and distinct from Maps API v3 docs (which don't mention it).

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jrge...@gmail.com

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

omr

unread,
Aug 9, 2010, 11:38:55 AM8/9/10
to Google AJAX APIs
Thanks Jeremy.

Sorry if my previous reply confused anyone.

-- omr
Reply all
Reply to author
Forward
0 new messages