2010/02/26: New Release

75 views
Skip to first unread message

Luke (Google Employee)

unread,
Feb 26, 2010, 2:08:09 PM2/26/10
to Google Maps JavaScript API v3
Hey everyone!

We've recently pushed out a new version of the API. See the list of
changes below:
http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog

Changed Issues:
- Issue 1651: Added mousemove/mouseout/mouseover to the Map.
- Issue 2142: Options added to DirectionsRenderer for suppressing
overlays and changing marker/polygon styles.
- Issue 2148: Fixed polygon click event bug where latLng was
obfuscated to .Hk.
- Issue 2109: Fixed Navigation controls not rendering correctly in IE.
- Issue 2153: MVCArray.push() now returns the new length.

Noticeable Changes:
- Add opacity to ImageMapType.
- Fixed the bug where rightclick on a rectangle/circle was not being
fired.
- Info window's content events are no longer being removed on hide.


Please test and provide feedback.

Thanks!

Luke

shsavage

unread,
Mar 2, 2010, 9:45:00 AM3/2/10
to Google Maps JavaScript API v3
Hi Luke,

So far I've not had any luck getting the mouse location in response
to the mousemove event. I have tried it this way:

google.maps.event.addListener(map, 'mousemove', reportLoc);

and this:

google.maps.event.addListener(map, 'mousemove', function()
{reportLoc(event);});


where reportLoc does this:

//------------------------------------------------------------------------------------
function reportLoc(event) {
var myLoc = RoundTo(event.latLon.lat(),5) + ", " +
RoundTo(event.latLng.lng(),5);
document.getElementById('mapLoc').innerHTML = 'Location: ' +
myLoc;
}


and in both cases, I get an error that "latLng is not an object" in
the reportLoc function. What am i doing wrong here?

Thanks,

-Steve

On Feb 26, 12:08 pm, "Luke (Google Employee)" <lu...@google.com>
wrote:


> Hey everyone!
>
> We've recently pushed out a new version of the API.  See the list of

> changes below:http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Cha...

shsavage

unread,
Mar 2, 2010, 11:32:08 AM3/2/10
to Google Maps JavaScript API v3
Hi Luke,

Never mind. This does it:

google.maps.event.addListener(map, 'mousemove' ,function(event)
{var myLat = event.latLng.lat();
var myLon = event.latLng.lng();
var myLoc = "Lat: " + RoundTo(myLat,5) + ", Lon: " +
RoundTo(myLon,5);
document.getElementById('mapLoc').innerHTML = myLoc;
} );

//--------------------------------------------------
function RoundTo(myVar, numDP) {
myFactor = Math.pow(10, numDP);
return Math.round(myVar * myFactor) / myFactor;
}

putting the cursor location into this div:

<div style="padding:.3em; background-color: #324164; color:
white"><b>Cursor location: </b><span id="mapLoc"></span></div>

-Steve

On Mar 2, 7:45 am, shsavage <shsav...@asu.edu> wrote:
> Hi Luke,
>
>    So far I've not had any luck getting the mouse location in response
> to the mousemove event.  I have tried it this way:
>
>       google.maps.event.addListener(map, 'mousemove', reportLoc);
>
> and this:
>
>       google.maps.event.addListener(map, 'mousemove', function()
> {reportLoc(event);});
>
> where reportLoc does this:
>

>     //-------------------------------------------------------------------------­-----------

> > Luke- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages