提交 038b772c 作者: test

fix: 修复 Map.on 事件通信异常写法问题

上级 d11dbf58
......@@ -58,27 +58,27 @@
onMapLoad(data) {
this.loaded = true
Message.hideLoading()
console.log('✨ Map Loaded', data)
console.debug('✨ Map Loaded', data)
// 触发 onLoaded 事件
this.onLoadedEvent?.(data)
},
onSourceRequestHandle(data) {
console.log('✨ Request Handle', data)
console.debug('✨ Request Handle', data)
// 触发 onSourceRequestHandle 事件
this.onSourceRequestHandleEvent?.(data)
},
// 尝试触发事件, 通过 changeLock 控制
tryTriggerChange() {
if (!this.changeLock && this.changeOptionsQueue.length) {
this.changeLock = true
const item = this.changeOptionsQueue.shift()
this[`${item.fn}Options`] = item
this.changeLock = true
}
},
// 监听地图配置从逻辑层到视图层的响应式变化事件
onMapOptionsChangeEvent(event) {
console.log('✨ Map Event', event)
console.debug('✨ Map Event', event)
this.changeLock = false
this.tryTriggerChange()
......@@ -99,7 +99,7 @@
customEvent(event, type, layer, ...args) {
// 加入到 change 事件队列中
this.changeOptionsQueue.push({
fn: event,
fn: 'event',
event,
type,
layer,
......
......@@ -204,7 +204,6 @@ export default {
this.emitChangeEvent(options.fn)
if (this.checkOnChangeValidity(options)) {
this.map.addLayer(options.layer, options.beforeId)
console.log('options', options)
}
},
changeRemoveOptions(options) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论