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

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

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