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

update: 新增一批 nvue map组件 API

上级 195d0cd4
......@@ -18,7 +18,22 @@ UniServiceJSBridge.subscribe('onMapMethodCallback', ({
callback.invoke(callbackId, data)
})
const methods = ['getCenterLocation', 'moveToLocation', 'getScale', 'getRegion', 'includePoints', 'translateMarker']
const methods = ['getCenterLocation',
'moveToLocation',
'getScale',
'getRegion',
'includePoints',
'translateMarker',
'addCustomLayer',
'removeCustomLayer',
'addGroundOverlay',
'removeGroundOverlay',
'updateGroundOverlay',
'initMarkerCluster',
'addMarkers',
'removeMarkers',
'moveAlong',
'openMapApp']
export class MapContext {
constructor (id, pageVm) {
......
......@@ -22,6 +22,36 @@ const METHODS = {
},
getScale (ctx, cbs) {
return invokeVmMethodWithoutArgs(ctx, 'getScale', cbs)
},
addCustomLayer (ctx, args) {
return invokeVmMethod(ctx, 'addCustomLayer', args)
},
removeCustomLayer (ctx, args) {
return invokeVmMethod(ctx, 'removeCustomLayer', args)
},
addGroundOverlay (ctx, args) {
return invokeVmMethod(ctx, 'addGroundOverlay', args)
},
removeGroundOverlay (ctx, args) {
return invokeVmMethod(ctx, 'removeGroundOverlay', args)
},
updateGroundOverlay (ctx, args) {
return invokeVmMethod(ctx, 'updateGroundOverlay', args)
},
initMarkerCluster (ctx, args) {
return invokeVmMethod(ctx, 'initMarkerCluster', args)
},
addMarkers (ctx, args) {
return invokeVmMethod(ctx, 'addMarkers', args)
},
removeMarkers (ctx, args) {
return invokeVmMethod(ctx, 'removeMarkers', args)
},
moveAlong (ctx, args) {
return invokeVmMethod(ctx, 'moveAlong', args)
},
openMapApp (ctx, args) {
return invokeVmMethod(ctx, 'openMapApp', args)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册