gpt4 book ai didi

javascript - 单击超链接时如何使用 Google Maps API v3 缩放 map ?

转载 作者:行者123 更新时间:2023-12-02 19:22:27 25 4
gpt4 key购买 nike

当我点击超链接时,我无法访问 Google Maps 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>

关于javascript - 单击超链接时如何使用 Google Maps API v3 缩放 map ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12379820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com