获取当前地图中心的经纬度陷入无限运行状态

发布于 7 年前作者 tqian11276 次浏览最后编辑 7 年前来自 ask

// 地图视野发生变化时

bindRegion: function(e){

    if (e.type == “end”){

        this.mapCtx.getCenterLocation({

            success: res => {

                console.log(res);

                this.setData({

                latitude: res.latitude,

                longitude: res.longitude,

                });

            },

            fail: res => {

                console.log(res);

            }

        });

    }

},

地图视野发生变化时,获取当前中心的坐标就会一直执行getCenterLocation,我只拖动了一下,但是反复执行了无数次

1 回复
mingshen
mingshen1 楼5 年前

https://developers.weixin.qq.com/community/develop/doc/0006ac52470fd07f49470ee0351000

看帖吧,如果只是本地调试,你把基础调试库改到1.9.97就好