First Look at Google Maps API v3

Google announced version 3 of the google maps API.
Some things I noticed right away:
- no API key required! before you had to sign up for an API key, but now you can shed your API key woes (I know I had them) and not have to sign up for one again.
- mobile browser support (iphone and android)

- You now have to specifiy the sensor variable in your include of google maps
<script type="text/javascript"src="http://maps.google.com/maps/api/js? *sensor=true* ">
the sensor is for detecting user’s location with mobile sensors like GPS - No more polluting the global namespace with tons of variables. Google is moving over to their google namespace. so instead of
new GMap2you donew google.maps.map - New mouse event object.
- Default UI so that as Google maps updates their UI, you get to enjoy the new interface without updating code.
- it is like 3AM now so that is enough changes to see before I go to bed. =P
The only thing I couldn’t figure out is where is the directions object? A lot of my maps applications use driving directions, so I’ll be holding off on migrating over until I figure that out with the new API.
10 comments
Hey Marc-
The sensor parameter is actually required (but not enforceably so) in API v2 as well. You need to use it to tell us whether your app is using a sensor to show the user’s location – we won’t do any sensing of our own. So, it can be either true or false, depending on your app.
Should we clarify some part of the docs to make that more clear?
It was probably just an oversight on my part. Since I haven’t done any location-based mobile work, I missed that part of API v2.
API3 appears to be backwards compatible. Nice job.
HI there.
based on your earlier tutorial I’m trying to add a custom infowindow to my marker using the getPane() function but it seems like getPane() is not available anymore in v3.
do you have any tip?
thx.
BB.
I haven’t used v3 to build anything yet, so please post the solution if you find it.
I’m trying to put together a simple webpage for Safari on iPhone (ie not using the iPhone SDK). Anyone seen any relevant info or a ‘hello world’ page for iPhone?
Thanks
Kev
I wan to shift from V2 to V3. What changes i need to do in existing code? or google maps are Backward compatible?
Haseeb, the biggest difference is MVC Objects that Google maps now has. Where you copy out their object and then extend it with your own methods. For instance, if you make a new overlay object and attach it to the map, the “draw” method will be called whenever the map zooms or determines it needs to redraw, so you need to do MyOverlay.prototype.draw = function(){ … }.
Hi,
I am using GMap V3. We have to enable the GPS functionality. Even after following the following steps, the GPS functionality is not working:-
1.BOTH
===
2.ONLY JS
==
3. ONLY LOAD
=
3.1 ONLY LOAD
==
Kindly tell me what shall I do and which one to use.
Regards,
Avishek
Hi marc, maybe you or anybody can help me achieve this with gmaps v3:
http://www.radionica.biz/map/bgml.htm