diff --git a/src/core/service/api/context/create-map-context.js b/src/core/service/api/context/create-map-context.js index 9396dc9bd1f060cd9b6fbf653ff57eeef9ea70c5..2241c03a4ead824fbd255052bbfbb3b4f47cccde 100644 --- a/src/core/service/api/context/create-map-context.js +++ b/src/core/service/api/context/create-map-context.js @@ -34,6 +34,10 @@ export class MapContext { operateMapPlayer(this.id, this.pageVm, 'includePoints', args) } } + +MapContext.prototype.$getAppMap = function() { + return plus.maps.getMapById(this.pageVm.$page.id + '-map-' + this.id); +} methods.forEach(function (method) { MapContext.prototype[method] = callback.warp(function (options, callbackId) { diff --git a/src/platforms/app-plus/view/components/map/index.vue b/src/platforms/app-plus/view/components/map/index.vue index 3fa1268a965b1fccc5ef5aba17769b738e4a3435..53d64ea50ada1f0ec35c2c28121ecf67e35a7f9c 100644 --- a/src/platforms/app-plus/view/components/map/index.vue +++ b/src/platforms/app-plus/view/components/map/index.vue @@ -188,7 +188,7 @@ export default { if (this.latitude && this.longitude) { mapStyle.center = new plus.maps.Point(this.longitude, this.latitude) } - const map = this.map = plus.maps.create('map' + Date.now(), mapStyle) + const map = this.map = plus.maps.create(this.$page.id + '-map-' + (this.id || Date.now()), mapStyle) map.__markers__ = {} map.__lines__ = [] map.__circles__ = []