Try something like this:

 GEvent.addListener(marker, "click", function() {
          map.setCenter(marker.getLatLng());
          map.zoomIn();
          marker.openInfoWindowHtml(html);
        });

Or if you want to specify the zoom level to zoom to rather than simply
zoom in a level then:

 GEvent.addListener(marker, "click", function() {
          map.setCenter(marker.getLatLng(), 16);
          marker.openInfoWindowHtml(html);
        });

That example will zoom to level 16.

See the documentation for the GMap2 setCenter() method at:
http://code.google.com/apis/maps/documentation/reference.html#GMap2

Both the two examples i used assume that your map object is called
'map' and that it's a global variable - that is the click event
function can access the 'map' object.

If you post a link to your map then it's possible to give a better
example of how to modify your click event function.

Martin.



On 13 Nov, 01:58, Sean <[EMAIL PROTECTED]> wrote:
> HI There,
>
> I have a listener which is added to my map at runtime to allow me to
> open in infowindow when I click the link.  This works fine but now I
> want to know how I can make the map zoom in on that partcular
> location?
>
> Can someone post a some code or a link to where I can find some code
> to achieve this please?
>
> Sean
>
>  GEvent.addListener(marker, "click", function() {
>           marker.openInfoWindowHtml(html);
>         });
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to