提交 3864781e 编写于 作者: d-u-a's avatar d-u-a

feat(map): new feature: MapContext.on

上级 c9500005
......@@ -39,6 +39,13 @@ export class MapContext {
constructor (id, pageVm) {
this.id = id
this.pageVm = pageVm
}
on (name, callback) {
operateMapPlayer(this.id, this.pageVm, 'on', {
name,
callback
})
}
}
......@@ -46,7 +53,7 @@ MapContext.prototype.$getAppMap = function () {
if (__PLATFORM__ === 'app-plus') {
return plus.maps.getMapById(this.pageVm.$page.id + '-map-' + this.id)
}
}
}
methods.forEach(function (method) {
MapContext.prototype[method] = callback.warp(function (options, callbackId) {
......
......@@ -52,6 +52,9 @@ const METHODS = {
},
openMapApp (ctx, args) {
return invokeVmMethod(ctx, 'openMapApp', args)
},
on (ctx, args) {
return ctx.on(args.name, args.callback)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册