Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
038b772c
提交
038b772c
authored
8月 26, 2023
作者:
test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复 Map.on 事件通信异常写法问题
上级
d11dbf58
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
6 行删除
+5
-6
index.vue
src/components/Map/Mapbox/index.vue
+5
-5
mapbox.module.js
src/components/Map/Mapbox/mapbox.module.js
+0
-1
没有找到文件。
src/components/Map/Mapbox/index.vue
浏览文件 @
038b772c
...
@@ -58,27 +58,27 @@
...
@@ -58,27 +58,27 @@
onMapLoad
(
data
)
{
onMapLoad
(
data
)
{
this
.
loaded
=
true
this
.
loaded
=
true
Message
.
hideLoading
()
Message
.
hideLoading
()
console
.
lo
g
(
'✨ Map Loaded'
,
data
)
console
.
debu
g
(
'✨ Map Loaded'
,
data
)
// 触发 onLoaded 事件
// 触发 onLoaded 事件
this
.
onLoadedEvent
?.(
data
)
this
.
onLoadedEvent
?.(
data
)
},
},
onSourceRequestHandle
(
data
)
{
onSourceRequestHandle
(
data
)
{
console
.
lo
g
(
'✨ Request Handle'
,
data
)
console
.
debu
g
(
'✨ Request Handle'
,
data
)
// 触发 onSourceRequestHandle 事件
// 触发 onSourceRequestHandle 事件
this
.
onSourceRequestHandleEvent
?.(
data
)
this
.
onSourceRequestHandleEvent
?.(
data
)
},
},
// 尝试触发事件, 通过 changeLock 控制
// 尝试触发事件, 通过 changeLock 控制
tryTriggerChange
()
{
tryTriggerChange
()
{
if
(
!
this
.
changeLock
&&
this
.
changeOptionsQueue
.
length
)
{
if
(
!
this
.
changeLock
&&
this
.
changeOptionsQueue
.
length
)
{
this
.
changeLock
=
true
const
item
=
this
.
changeOptionsQueue
.
shift
()
const
item
=
this
.
changeOptionsQueue
.
shift
()
this
[
`
${
item
.
fn
}
Options`
]
=
item
this
[
`
${
item
.
fn
}
Options`
]
=
item
this
.
changeLock
=
true
}
}
},
},
// 监听地图配置从逻辑层到视图层的响应式变化事件
// 监听地图配置从逻辑层到视图层的响应式变化事件
onMapOptionsChangeEvent
(
event
)
{
onMapOptionsChangeEvent
(
event
)
{
console
.
lo
g
(
'✨ Map Event'
,
event
)
console
.
debu
g
(
'✨ Map Event'
,
event
)
this
.
changeLock
=
false
this
.
changeLock
=
false
this
.
tryTriggerChange
()
this
.
tryTriggerChange
()
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
customEvent
(
event
,
type
,
layer
,
...
args
)
{
customEvent
(
event
,
type
,
layer
,
...
args
)
{
// 加入到 change 事件队列中
// 加入到 change 事件队列中
this
.
changeOptionsQueue
.
push
({
this
.
changeOptionsQueue
.
push
({
fn
:
event
,
fn
:
'event'
,
event
,
event
,
type
,
type
,
layer
,
layer
,
...
...
src/components/Map/Mapbox/mapbox.module.js
浏览文件 @
038b772c
...
@@ -204,7 +204,6 @@ export default {
...
@@ -204,7 +204,6 @@ export default {
this
.
emitChangeEvent
(
options
.
fn
)
this
.
emitChangeEvent
(
options
.
fn
)
if
(
this
.
checkOnChangeValidity
(
options
))
{
if
(
this
.
checkOnChangeValidity
(
options
))
{
this
.
map
.
addLayer
(
options
.
layer
,
options
.
beforeId
)
this
.
map
.
addLayer
(
options
.
layer
,
options
.
beforeId
)
console
.
log
(
'options'
,
options
)
}
}
},
},
changeRemoveOptions
(
options
)
{
changeRemoveOptions
(
options
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论