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

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

上级 ff9983ce
......@@ -35,6 +35,10 @@ export class MapContext {
}
}
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) {
operateMapPlayer(this.id, this.pageVm, method, {
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册