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

fix: app map getCenterLocation 有时为上次的位置

上级 b20b1709
......@@ -166,7 +166,7 @@ export default {
this.map && this.map[val ? 'hide' : 'show']()
},
scale (val) {
this.map && this.map.setZoom(val)
this.map && this.map.setZoom(parseInt(val))
},
latitude (val) {
this.map && this.map.setStyles({
......@@ -197,7 +197,7 @@ export default {
map.__markers__ = {}
map.__lines__ = []
map.__circles__ = []
map.setZoom(this.scale)
map.setZoom(parseInt(this.scale))
plus.webview.currentWebview().append(map)
if (this.hidden) {
map.hide()
......@@ -238,11 +238,12 @@ export default {
})
},
getCenterLocation ({ callbackId }) {
const center = this.map.getCenter()
this._publishHandler(callbackId, {
longitude: center.longitude,
latitude: center.latitude,
errMsg: 'getCenterLocation:ok'
this.map.getCurrentCenter((state, point) => {
this._publishHandler(callbackId, {
longitude: point.longitude,
latitude: point.latitude,
errMsg: 'getCenterLocation:ok'
})
})
},
getRegion ({ callbackId }) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册