Google Maps Polyline顶点无法拖动问题求助
Google Maps Polyline 可编辑功能异常
我使用Google Maps已有多年,近期因频繁收到旧版本请求警告,将API调用修改为:
<script defer src="https://maps.googleapis.com/maps/api/js?v=weekly®ion=CA&key=*****&callback=initMap" type="application/javascript"> </script>
切换后出现功能异常:在系谱服务的地图功能中,注册用户进入编辑模式后,仅能在Polyline末端添加新点,无法拖动已有顶点调整地块边界位置,仅地图中心可正常调整。当前使用Firefox 116.0.3版本,相关代码片段如下:
var map = null; var path = []; var polyOptionsEdit = {strokeColor: "red", strokeOpacity: 0.5, strokeWeight: 2, draggable: true, editable: true}; var boundary = null; var geocoder = null; function initMap() { // 支持地图展示与地理编码 try { geocoder = new google.maps.Geocoder(); } catch(e) { geocoder = null; } map = null; } // function initMap window.initMap = initMap; boundary = new google.maps.Polyline(polyOptionsEdit); boundary.setPath(path);
内容的提问来源于stack exchange,提问作者anon
相关产品推荐
相关产品推荐

