Reply To: Click Event to Center and Zoom Map?

Home Forums MapPress Support Click Event to Center and Zoom Map? Reply To: Click Event to Center and Zoom Map?

#13002
Chris
Keymaster

Hi,

You need to know the map name (you can set it in the shortcode or it’ll default to ‘mapp0’ for the first map).

Then the code is:
mapp0.setCenter(-32,22);

Or you can get the google map object and call its functions directly:

var gmap = mapp0.getMap();
gmap.setCenter(new google.maps.LatLng(-32, 22));