百度地图Vue Baidu Map画圆形区域,只有两点不显示区域

有个项目,需要点击回显之前绘制的圆形区域,第一次回显可以正常显示,第二次再回显的时候出现问题,跪求各位大佬帮忙看看

<baidu-map class="map h-full" style="height:calc(100vh - 6.6rem)" ak="TIj3pFan1kg1l**********nW1gR" :center="mapForm.center" :zoom="mapForm.zoom" :scroll-wheel-zoom="true"  @ready="mapSelhandler">
    <bm-circle v-if="mapForm.shapeType == 1" :center="mapForm.circlePath.center" :radius="mapForm.circlePath.radius" stroke-color="blue" :stroke-opacity="0.5" :stroke-weight="2" @lineupdate="updateCirclePath" :editing="true"></bm-circle>
</baidu-map>

js

goEdit(param){
    //点击编辑,获取信息
    let obj = {id : param.id};
    this.$api.eleFenceDetail(obj).then((res) => {
        if (res.success == true) {
            let  data = res.data;
            this.$nextTick(() => {
                this.editForm = JSON.parse(JSON.stringify(data)) ;
                this.carInfoList = JSON.parse(JSON.stringify(data.carInfoList)) ;
                this.editForm.shapeDetail = JSON.parse(this.editForm.shapeDetail);
                let {lng, lat} = GpsConverter.gps_baidu(this.editForm.shapeDetail.center.lng, this.editForm.shapeDetail.center.lat);
                this.editForm.shapeDetail.center.lng = lng;
                this.editForm.shapeDetail.center.lat = lat;
                //解析图形
                this.addRegion();
            });
        } else {
            this.$message({
                message: res.msg,
                type: 'error'
            });
        }
    })
},
addRegion(){
    this.mapForm.polygonPath = [];
    this.mapForm.circlePath.center = {
        lng: '',
        lat: ''
    };
    this.mapForm.circlePath.radius = "";
    this.$set(this.mapForm.circlePath,"center",this.editForm.shapeDetail.center)
    this.$set(this.mapForm.circlePath,"radius",this.editForm.shapeDetail.radius)
    that.$set(this.mapForm,"center",this.editForm.shapeDetail.center);
},
//修改图形返回的数据
updateCirclePath (e) {
    this.mapForm.circlePath.center = e.target.getCenter();
    this.mapForm.circlePath.radius = e.target.getRadius();
    e.target.enableEditing();
},
阅读 2.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题