Javascript 单击超链接时,如何使用Google Maps API v3缩放地图?

Javascript 单击超链接时,如何使用Google Maps API v3缩放地图?,javascript,google-maps-api-3,Javascript,Google Maps Api 3,当我点击我的超链接时,我无法进入谷歌地图API v3进行放大/缩小。我让它在v2中工作: <a href="javascript:map.setCenter(new GLatLng(58.37,62.66), 16);map.setMapType(G_SATELLITE_MAP);" >Some Place</a> 在v3中,我尝试过: <a href="javascript:map.setCenter(new google.maps.LatLng(58.37

当我点击我的超链接时,我无法进入谷歌地图API v3进行放大/缩小。我让它在v2中工作:

<a href="javascript:map.setCenter(new GLatLng(58.37,62.66), 16);map.setMapType(G_SATELLITE_MAP);" >Some Place</a>

在v3中,我尝试过:

<a href="javascript:map.setCenter(new google.maps.LatLng(58.37,62.66));">Some Place</a>


如何解决此问题?

在v3中,您还必须调用
setZoom

<a href="javascript:map.setCenter(new google.maps.LatLng(58.37,62.66));map.setZoom(16);">Some Place</a>


谢谢。但是错误:TypeError:map.setCenter不是函数源文件:javascript:map.setCenter(新的%20google.maps.LatLng(58.37,62.66));map.setZoom(16);行:1当您没有发布的代码中出现错误时。还要确保“map”变量是全局定义的。