Home › Forums › MapPress Support › Click Event to Center and Zoom Map? › Reply To: Click Event to Center and Zoom Map?
July 15, 2013 at 10:17 am
#13002
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));