Click Event to Center and Zoom Map? Home › Forums › MapPress Support › Click Event to Center and Zoom Map? This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by backbeat. Viewing 3 posts - 1 through 3 (of 3 total) Author Posts July 15, 2013 at 10:13 am #13000 backbeatParticipant I’d like to create a click event to center and zoom on a specific ZIP code (using lat/long). I can get the map to zoom to the existing center using setZoom(), but can’t get setCenter() to work. Is it possible? If so, how? Thanks. July 15, 2013 at 10:17 am #13002 ChrisKeymaster 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)); July 15, 2013 at 10:56 am #13003 backbeatParticipant Thank you. That worked. I was making it harder than it needed to be… Author Posts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In