Zoom function Google maps
问题 I've created a button inside my info window that needs to pan to the marker and then zoom in but I can't get it to work. Below is my Zoom function function Zoom(){ google.maps.event.addListener(marker, 'click', function() { map.panTo(marker.position); map.setZoom(18); }); and this the function that creates the marker and fills the info window with the html below. function createMarker(latlng, name, woonplaats, prijs, perceelop, woonop, address) { var html ="<a href="+address+">"+"<b>"+name+"<