Using jsapi with google maps JavaScript API

544 views
Skip to first unread message

Alex

unread,
Feb 7, 2015, 11:52:31 PM2/7/15
to google-visua...@googlegroups.com
I just spend some time figuring out how to use Google Maps API with https://www.google.com/jsapi and wanted to leave a trace since it's not obvious.

Include the https://www.google.com/jsapi first, because it doesn't || on the window.google object. Next, place an empty <script/>. Next, include https://maps.googleapis.com/maps/api/js as so:

  <script type="text/javascript" src="https://www.google.com/jsapi"/>

  <script type="text/javascript">
  </script>





some-map-1.html

Daniel LaLiberte

unread,
Feb 9, 2015, 10:58:09 AM2/9/15
to google-visua...@googlegroups.com
The empty script is need only because your first script line to load jsapi is not actually closed.  The "/" at the end of the tag doesn't work, and so the script tag will eat up all the content until if finds a proper closing script tag: </script>.  Yes, it is not obvious, and we wrestled with a similar case ourselves very recently.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Alex Rojkov

unread,
Feb 9, 2015, 11:53:13 AM2/9/15
to google-visua...@googlegroups.com
That's correct. Verified.
> dlali...@Google.com 5CC, Cambridge MA
> daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/3XT2uKuhYRc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Reply all
Reply to author
Forward
0 new messages