PanTo

396 views
Skip to first unread message

Meenakshi Tadepalli

unread,
Aug 31, 2009, 3:49:23 PM8/31/09
to google-map...@googlegroups.com
Hi
 
I wanto to capture the event when user is moving on the map. i.e Panning . How do i do that? Please advise.
 
Meena 

pamela (Google Employee)

unread,
Sep 3, 2009, 10:52:19 AM9/3/09
to google-map...@googlegroups.com
Hi Meena -

Depending on your use case, the 'bounds_changed' or 'dragend' event
may be what you're looking for. More info in the reference:
http://code.google.com/apis/maps/documentation/v3/reference.html#Map

- pamela

adszhu

unread,
Sep 16, 2009, 9:30:18 AM9/16/09
to Google Maps JavaScript API v3
Hi Pamela and Meena,

I face the same problem. I apply a map.panTo function to move the map,
and the bounds_changes event is fired. However, when I want this event
to draw a marker at map.getCenter, it just does not do anything. When
I use map.setCenter instead of panTo, it works fine.

Some piece of code below:

google.maps.event.addListener(map, 'bounds_changed',
function() {
// newCenter = map.getCenter();
if (overlay) {
removeOverlay();
};
alert(map.getBounds());
overlay = new CustomMarker(map.getCenter(), map);
});

How may I capture the end of panning?

Ádám

On szept. 3, 16:52, "pamela (Google Employee)" <pamela...@gmail.com>
wrote:

pamela (Google Employee)

unread,
Sep 17, 2009, 10:41:54 AM9/17/09
to google-map...@googlegroups.com
Hi Adam-

The bounds_changed event fires everytime the bounds changes, which is
probably too often for you. We're working on an event similar to
"moveend" in the v2 API which would fire when the map stopped moving,
such as after a panTo. Please star this issue:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=1371

We hope to offer this event soon.

- pamela

Ádám Szigeti

unread,
Sep 17, 2009, 10:46:31 AM9/17/09
to google-map...@googlegroups.com
Thank You, Pamela!

Ádám
Reply all
Reply to author
Forward
0 new messages