关键点一:绑定手停止滑动事件 bind:touchend=“touchEnd”
关键点二:获得地图中心点坐标 this.mapCtx.getCenterLocation
关键点三:用that = this 解开闭包
js页面
// pages/map/index13.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
onReady: function (e) {
this.mapCtx = wx.createMapContext('myMap')
this.mapCtx.moveToLocation()
},
getCenterLocation: function () {
this.mapCtx.getCenterLocation({
success