how to pan in API 3

110 views
Skip to first unread message

Amir

unread,
Aug 6, 2009, 4:49:51 AM8/6/09
to Google Maps JavaScript API v3
Hi there,

Maybe it seems a very simple question, but I don't know the syntax for
pan on my map on API version 3, I searched this Forum and also the one
for API 2 and flash, I have something like this:

CustomControllerBase.prototype.addMoveDown = function(element, event)
{
if (!event)
event = 'click';
var me = this;
google.maps.event.addDomListener(element.getElement(), event, function
() {
me.map.panBy(new Point (0,100));
});
this.element.appendChild(element.getElement());
}

but it's not working for me because I'm using API 3 and this panBy
function is not suitable for 3, would you plz gimme a hint to fix
this.

Cheers

Esa

unread,
Aug 6, 2009, 6:06:08 AM8/6/09
to Google Maps JavaScript API v3
The panBy() method of v3 is not exposed but it is there internally.
The navigating pan buttons trigger an animated 1/3 viewport pan.

One possible hack would be trying to access those pan buttons in DOM.

Panning with set_center() is instant with no animation. You had to
perform a series of small delayed movements to make the animation.

Amir

unread,
Aug 6, 2009, 6:26:09 AM8/6/09
to Google Maps JavaScript API v3
oom, thanx for this, I'll give it a try, but it would be great if they
put a function like panBy for V3, I have a totally customized map now
that it works awesome but I just have this last issue with pan.

pamela (Google Employee)

unread,
Aug 6, 2009, 8:34:28 AM8/6/09
to google-map...@googlegroups.com
Hi Amir - 

That feature request has been filed here, please star it to be notified when the status changes:

- pamela

Amir

unread,
Aug 6, 2009, 9:32:14 AM8/6/09
to Google Maps JavaScript API v3
okei, thanx Pamela,

but at the moment I put a hack like what Esa suggested. but it's
acting strange, I mean if you click on pan buttons like pan to right
it move the markers and after 3 click on the pan to right finaly it
moves the map to right? (I uploaded the files here: gmap-
customized.zip)

any idea for this?

On Aug 6, 4:34 pm, "pamela (Google Employee)" <pamela...@gmail.com>
wrote:
> Hi Amir -
>
> That feature request has been filed here, please star it to be notified when
> the status changes:http://code.google.com/p/gmaps-api-issues/issues/detail?id=1467
>
> - pamela
>
Reply all
Reply to author
Forward
0 new messages