获取当前地图中心的经纬度陷入无限运行状态
发布于 5 年前 作者 tqian 11122 次浏览 来自 问答

// 地图视野发生变化时

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 回复

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

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

回到顶部