Discussion:
Cannot Use GMap2
Steve Sanders
2010-03-16 15:23:56 UTC
Permalink
I am having a problem using the google maps api. I have this call in
my header to get the API. However, whenever I try to create a GMap2
object, it tells me that this is not a function. am I not including
the APi correctly?

<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false&v=3
&key=API_KEY"></script>

This is my call to create the Map2 object
var map = new google.maps.Map2(document.getElementById("map_canvas"),
myOptions);
I have tried it with GMap2 but no dice.

It is also telling me that addOverlay is not a function of the object,
which after looking at the API, it most certainly is. So obviously I
am not including the API correctly. Anyone know what I should try?
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-***@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
Andrew Leach
2010-03-16 16:30:25 UTC
Permalink
Post by Steve Sanders
I am having a problem using the google maps api. I have this call in
my header to get the API. However, whenever I try to create a GMap2
object, it tells me that this is not a function. am I not including
the APi correctly?
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false&v=3
&key=API_KEY"></script>
That loads the Version 3 API (although v=3 isn't needed and Version 3
doesn't use a key). Version 3 doesn't include GMap2.

If you want to use an AJAX loader, see
http://code.google.com/apis/maps/documentation/index.html#AJAX_Loader
otherwise you need a <script> tag that looks like the one used at
http://code.google.com/apis/maps/documentation/index.html#Localization
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-***@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
Rossko
2010-03-16 16:40:09 UTC
Permalink
Post by Steve Sanders
I am having a problem using the google maps api. I have this call in
my header to get the API. However, whenever I try to create a GMap2
object, it tells me that this is not a function. am I not including
the APi correctly?
Not really, no.
Here's the docs for v2
http://code.google.com/apis/maps/documentation/introduction.html
or if you are trying to use v3, here
http://code.google.com/apis/maps/documentation/v3/basics.html
You can't mix-n-match the methods
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-***@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
Continue reading on narkive:
Loading...