diff --git a/packages/uni-template-compiler/lib/module.js b/packages/uni-template-compiler/lib/module.js index 9dd9d44f985dcc9e246c42b587587977a6300dd3..82cb4e7e66d6619f0487a98ab2c66e51d39dd80c 100644 --- a/packages/uni-template-compiler/lib/module.js +++ b/packages/uni-template-compiler/lib/module.js @@ -10,7 +10,10 @@ function removeAttr (el, name) { module.exports = { preTransformNode (el, { warn - }) { + }) { + if (process.env.UNI_PLATFORM === 'app-plus' && el.tag === 'ad') { + warn("app-vue平台, 组件暂不支持非 V3 编译, 详见: https://ask.dcloud.net.cn/article/36599") + } if (el.tag === 'slot' && !el.attrsMap['name']) { el.attrsList.push({ name: 'SLOT_DEFAULT', 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__ = []