首页 > 解决方案 > 标记 setPosition 不起作用

问题描述

我有这个代码

var new = new google.maps.LatLng(lat, lng);
marker.setPosition(new);
infowindow.setPosition(marker.getPosition());

并且标记没有移动,但信息窗口移动了

我在控制台中没有错误

10天前还在工作,可以从5月11日更新吗?

标签: google-mapsmarker

解决方案


我的问题是最新版本

<script src="//maps.googleapis.com/maps/api/js?v=3.31&key=

以前是

 <script src="//maps.googleapis.com/maps/api/js?v=3&key=...

https://developers.google.com/maps/documentation/javascript/versions


推荐阅读