提交 efa1fd3d 编写于 作者: fxy060608's avatar fxy060608

refactor(v3): createMapContext

上级 e65a042d
......@@ -13,74 +13,28 @@ class MapContext {
this.pageVm = pageVm
}
getCenterLocation ({
success,
fail,
complete
}) {
operateMapPlayer(this.id, this.pageVm, 'getCenterLocation', {
success,
fail,
complete
})
getCenterLocation (args) {
operateMapPlayer(this.id, this.pageVm, 'getCenterLocation', args)
}
moveToLocation () {
operateMapPlayer(this.id, this.pageVm, 'moveToLocation')
}
translateMarker ({
markerId,
destination,
autoRotate,
rotate,
duration,
animationEnd,
fail
}) {
operateMapPlayer(this.id, this.pageVm, 'translateMarker', {
markerId,
destination,
autoRotate,
rotate,
duration,
animationEnd,
fail
})
translateMarker (args) {
operateMapPlayer(this.id, this.pageVm, 'translateMarker', args)
}
includePoints ({
points,
padding
}) {
operateMapPlayer(this.id, this.pageVm, 'includePoints', {
points,
padding
})
includePoints (args) {
operateMapPlayer(this.id, this.pageVm, 'includePoints', args)
}
getRegion ({
success,
fail,
complete
}) {
operateMapPlayer(this.id, this.pageVm, 'getRegion', {
success,
fail,
complete
})
getRegion (args) {
operateMapPlayer(this.id, this.pageVm, 'getRegion', args)
}
getScale ({
success,
fail,
complete
}) {
operateMapPlayer(this.id, this.pageVm, 'getScale', {
success,
fail,
complete
})
getScale (args) {
operateMapPlayer(this.id, this.pageVm, 'getScale', args)
}
}
......
......@@ -5,8 +5,8 @@ import {
operateMapPlayer as operateNVueMapPlayer
} from 'uni-platforms/app-plus-nvue/service/api/context/operate-map-player'
export function operateMapPlayer(mapId, pageVm, type, data) {
pageVm.$page.meta.isNVue ?
operateNVueMapPlayer(mapId, pageVm, type, data) :
operateVueMapPlayer(mapId, pageVm, type, data)
export function operateMapPlayer (mapId, pageVm, type, data) {
pageVm.$page.meta.isNVue
? operateNVueMapPlayer(mapId, pageVm, type, data)
: operateVueMapPlayer(mapId, pageVm, type, data)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册