收藏
回答

map regionChange提示Invoke event regionChange?

<map

bindregionchange="regionChange"

></map>

regionChange 里请求接口

 if (res.type == 'end' && res.causedBy == "drag" && drag) {

        let mapCtx = wx.createMapContext('indexMap', this);

        mapCtx.getCenterLocation({

          success: (res) => {

            console.log('getCenterLocation succ', res)

            let loc = transformLoc(res, GCJ02, BD09);

            //这里用新loc请求接口 此函数没有触发

          },

          fail: (error) => {

            console.log('getCenterLocation err', error);

            drag = true;

          }

        })

      }

最后一次编辑于  2021-07-02
回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容