tags:

views:

9

answers:

1

OK, so here's my scenario.

I have a Google map on the left, and a corresponding contents on the right.

When a user moves around the map or zoom in or zoom out, how can I dynamically change the contnets on the right given the "new" map now?

I guess I need to know the "current" map information and then use that to retrieve the content corresponding to this information.

Thank you in advance!

+1  A: 

Since I don't specifically know what you want to do, hopefully these JS snippets can get you started.

You'll need to attach an event handler to your map probably in body.onload. The GMap2 "move" event fires any time the map view is changing, which may be a lot if the user is dragging or constantly zooming.

function onBodyLoad() {
   //assumes you have a GMap2 object named 'map' already declared somewhere
   GEvent.addListener(map, "move", onMapMove);
}

function onMapMove() {
  //update right div content
}
Steve Danner
yep! that would work. thanks.
ebae