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

fix: v3 vue <map> API 不支持通过 $getAppMap 获取原生map对象的Bug

上级 ff9983ce
......@@ -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) {
......
......@@ -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__ = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册