Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 谷歌地图禁用可编辑多边形上的新顶点按钮_Google Maps_Google Maps Api 3 - Fatal编程技术网

Google maps 谷歌地图禁用可编辑多边形上的新顶点按钮

Google maps 谷歌地图禁用可编辑多边形上的新顶点按钮,google-maps,google-maps-api-3,Google Maps,Google Maps Api 3,我有一张地图,我正在使用绘图库在上面绘图 基本上,在我创建形状之后,它是可编辑的,但是你可以在图像中看到,我已经圈出了允许你创建新顶点的点。我想禁用这些,但我仍然希望能够在拐角处移动 这可能吗 请勿使用DrawingManager。创建4个可拖动标记,将它们绑定到多边形的顶点。在vuejs中使用 GeoJSON({shapes.value}})重置多边形路径 从“vue2谷歌地图”导入{gmapApi} 导出默认值{ 数据(){ 返回{ 地图中心:{ 拉丁美洲:49.282730, 液化天然

我有一张地图,我正在使用绘图库在上面绘图

基本上,在我创建形状之后,它是可编辑的,但是你可以在图像中看到,我已经圈出了允许你创建新顶点的点。我想禁用这些,但我仍然希望能够在拐角处移动

这可能吗


请勿使用DrawingManager。创建4个可拖动标记,将它们绑定到多边形的顶点。

在vuejs中使用


GeoJSON({shapes.value}})重置多边形路径
从“vue2谷歌地图”导入{gmapApi}
导出默认值{
数据(){
返回{
地图中心:{
拉丁美洲:49.282730,
液化天然气:-123.120735
},//温哥华
形状选项:{
填充颜色:'#777',
填充不透明度:0.5,
冲程重量:2,
strokeColor:“#999”,
真的,
是的,
},
矩形边界:{},
环比:10000,
形状:{
值:“多边形”,
选项:{
“多边形”:“多边形”,
},
},
多基因路径:[],
mvcpath:null,
geoJSON:“”,
位置:“”,
PolygonObject路径:“”,
}
},
计算:{
谷歌:GMAPPI
},
方法:{
更新中心(地点){
此.mapCenter={
lat:place.geometry.location.lat(),
lng:place.geometry.location.lng(),
}
},
syntaxHighlight(json){
json=json.replace(//&/g,“&;”).replace(//g,”);
返回json.replace(/(“(\\u[a-zA-Z0-9]{4}\\[^u]\\\\\\”)*”(\s*:)?\b(true | false | null)\b |-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)/g,
(匹配)=>{
var cls='数字';
如果(/^”/.test(匹配)){
如果(/:$/.test(匹配)){
cls=‘键’;
}否则{
cls='字符串';
}
}else if(/true | false/.test(匹配)){
cls='布尔';
}else if(/null/.test(匹配)){
cls='null';
}
返回“”+匹配+“”;
});
},
矩形处理程序(事件){
这.$refs.rectangleRef.$rectanglePromise.then((res)=>{
常量边界=res.getBounds();
此位置={
lat:event.latLng.lat(),
lng:event.latLng.lng()
}
/* 
南:bounds.getNorthEast().lat(),
west:bounds.getSouthWest().lng(),
北:bounds.getSouthWest().lat(),
east:bounds.getNorthEast().lng(),
*/
/* 
const topLeftLat=bounds.south;
const topLeftLon=bounds.west;
const bottomRightLat=bounds.north;
const bottomRightLon=bounds.east;
*/
此参数为0.rectangleBounds={
南:bounds.getNorthEast().lat(),
west:bounds.getSouthWest().lng(),
北:bounds.getSouthWest().lat(),
east:bounds.getNorthEast().lng(),
};
}).catch(错误=>{
console.log(错误)
toastr.错误(err)
})
},
circleHandler(事件){
此.$refs.circleRef.$circlePromise.then((res)=>{
this.getShapeBound(事件,res)
}).catch(错误=>{
console.log(错误)
toastr.错误(err)
})
},
polygonHandler(事件){
让它=这个
如果(!that.mvcpath)返回null
设路径=[];
for(设i=0;i