收藏
回答

mapCtx.includePoints API 只能通过点击事件调用?

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug mapCtx.includePoints 工具 7.0.3 2.6.4

想在onLoad中调用,提示

VM3568:1 thirdScriptError

Cannot read property 'includePoints' of undefined;at pages/index/index page lifeCycleMethod onLoad function

TypeError: Cannot read property 'includePoints' of undefined

    at s.onLoad (http://127.0.0.1:32768/appservice/pages/index/index.js:1167:16)

    at s.(http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:979296)

    at s.__callPageLifeTime__ (http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:979050)

    at kt (http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:998756)

    at http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:1001435

    at It (http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:1001498)

    at Function.(http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:1002450)

    at Be.(http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:974690)

    at Be.emit (http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:333900)

    at Object.emit (http://127.0.0.1:32768/appservice/__dev__/WAService.js:1:353303)

,点击是调用好使,在onLoad中就报错,请问什么原因?

this.mapCtx.includePoints({

padding: [10],

points: [{

latitude: latitude,

longitude: longitude,

}, {

latitude: endlat,

longitude: endlng,

}]

});









回答关注问题邀请回答
收藏
登录 后发表内容