类型:脚本错误
错误样例: undefined is not an object (evaluating ‘a.mapCtx.getCenterLocation’);at pages/location/location page regionchange function
以下是相关代码:
.js:
regionchange:function(e){
var that = this;
if(e.type=='end'){
// this.getCenterLocation();
that.mapCtx.getCenterLocation({
success: function (res) {
that.setData({
m_latitude: res.latitude,
m_longitude: res.longitude
})
that.requestData(res.longitude, res.latitude, 0);
}
})
}
},
.wxml
<map wx:if="{{show_tab_list==0}}" id=“aokeNear” longitude="{{longitude}}" latitude="{{latitude}}" markers="{{markers}}" bindmarkertap=“onMarkerClick” scale=“15” show-location=“true” bindregionchange=“regionchange” controls="{{controls}}" bindcontroltap=“bindcontrol”>
</map>
代码很简单,逻辑也很简单,不知道是什么原因造成的告警。有没有知道的朋友,麻烦帮忙看看,万分感谢~