You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Maps Polyline顶点无法拖动问题求助

Google Maps Polyline 可编辑功能异常

我使用Google Maps已有多年,近期因频繁收到旧版本请求警告,将API调用修改为:

<script defer src="https://maps.googleapis.com/maps/api/js?v=weekly&region=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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 17:00:00