From 88954196f30fce7d637945505b54e310fd4adfc7 Mon Sep 17 00:00:00 2001 From: handongxun Date: Tue, 2 Mar 2021 17:11:53 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=96=B0=E5=A2=9E=E4=B8=80=E6=89=B9?= =?UTF-8?q?=20nvue=20map=E7=BB=84=E4=BB=B6=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/api/context/create-map-context.js | 17 ++++++++++- .../service/api/context/operate-map-player.js | 30 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/core/service/api/context/create-map-context.js b/src/core/service/api/context/create-map-context.js index 58c3ddd72..7708f6e2e 100644 --- a/src/core/service/api/context/create-map-context.js +++ b/src/core/service/api/context/create-map-context.js @@ -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) { diff --git a/src/platforms/app-plus-nvue/service/api/context/operate-map-player.js b/src/platforms/app-plus-nvue/service/api/context/operate-map-player.js index d458aa88d..01cd7b1dd 100644 --- a/src/platforms/app-plus-nvue/service/api/context/operate-map-player.js +++ b/src/platforms/app-plus-nvue/service/api/context/operate-map-player.js @@ -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) } } -- GitLab