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

fix: v3 <map> @tap无效, scale属性无效的问题

上级 9c91f8d9
......@@ -93,7 +93,7 @@ export default {
},
scale: {
type: [String, Number],
default: 1
default: 16
},
markers: {
type: Array,
......@@ -163,6 +163,9 @@ export default {
hidden (val) {
this.map && this.map[val ? 'hide' : 'show']()
},
scale (val) {
this.map && this.map.setZoom(val)
},
latitude (val) {
this.map && this.map.setStyles({
center: new plus.maps.Point(this.longitude, this.latitude)
......@@ -192,6 +195,7 @@ export default {
map.__markers__ = {}
map.__lines__ = []
map.__circles__ = []
map.setZoom(this.scale)
plus.webview.currentWebview().append(map)
if (this.hidden) {
map.hide()
......@@ -201,9 +205,9 @@ export default {
}, {
deep: true
})
map.onclick((data = {}) => {
this.$trigger('tap', {}, data)
})
map.onclick = (e) => {
this.$trigger('click', {}, e)
}
map.onstatuschanged((data = {}) => {
this.$trigger('end', {}, data)
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册