web-component-gallery 2.3.23 → 2.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js.umd.js +1 -1
- package/lib/amap-draw/index.jsx +16 -15
- package/package.json +1 -1
package/lib/amap-draw/index.jsx
CHANGED
|
@@ -78,8 +78,8 @@ export default {
|
|
|
78
78
|
computed: {
|
|
79
79
|
// 绘制图层信息的计算属性,用于获取和设置绘制结果
|
|
80
80
|
drawLayersInfo: {
|
|
81
|
-
get() { return transferData(this.drawInfo, 'Object')
|
|
82
|
-
set(newValue) {
|
|
81
|
+
get() { return transferData(this.drawInfo, 'Object') },
|
|
82
|
+
set(newValue) {
|
|
83
83
|
// 触发外部事件,传递绘制的图层信息
|
|
84
84
|
this.$emit('getAMapLayersInfo', this.initDrawInfo(newValue))
|
|
85
85
|
}
|
|
@@ -89,7 +89,9 @@ export default {
|
|
|
89
89
|
watch: {
|
|
90
90
|
// 监听绘制信息变化,当变化时重新渲染对应类型的绘制图层
|
|
91
91
|
drawInfo: {
|
|
92
|
-
handler(newVal) {
|
|
92
|
+
handler(newVal) {
|
|
93
|
+
newVal && this.echoDrawLayers(this.drawType)
|
|
94
|
+
},
|
|
93
95
|
deep: true
|
|
94
96
|
},
|
|
95
97
|
// 监听所有绘制信息变化,重新渲染全部绘制图层
|
|
@@ -194,7 +196,7 @@ export default {
|
|
|
194
196
|
// 结束绘制流程
|
|
195
197
|
finishDrawing() {
|
|
196
198
|
// 关闭鼠标绘制工具
|
|
197
|
-
this.drawMouseTool
|
|
199
|
+
this.drawMouseTool?.close()
|
|
198
200
|
// 恢复操作按钮状态
|
|
199
201
|
this.updateDrawOperateState('primary')
|
|
200
202
|
// 重置活跃操作索引
|
|
@@ -228,7 +230,7 @@ export default {
|
|
|
228
230
|
// 如果没有绘制任何内容,则重置绘制状态
|
|
229
231
|
if (!this.drawLayers) {
|
|
230
232
|
return this.handleDrawReset()
|
|
231
|
-
}
|
|
233
|
+
}
|
|
232
234
|
// 分配绘制图层信息
|
|
233
235
|
this.assignDrawLayers(this.drawType)
|
|
234
236
|
},
|
|
@@ -245,10 +247,8 @@ export default {
|
|
|
245
247
|
this.handleDrawClear()
|
|
246
248
|
// 将选中的标记添加到地图
|
|
247
249
|
searchMarker.setMap(this.amap)
|
|
248
|
-
// 设置地图缩放级别和中心点
|
|
249
|
-
this.amap.setZoomAndCenter(15, searchMarker.getPosition())
|
|
250
250
|
// 如果是点类型绘制,则更新绘制信息
|
|
251
|
-
this.drawType === 'point' &&
|
|
251
|
+
this.drawType === 'point' && this.handleDrawComplete(searchMarker)
|
|
252
252
|
},
|
|
253
253
|
|
|
254
254
|
// 设置覆盖物的参数选项
|
|
@@ -442,13 +442,14 @@ export default {
|
|
|
442
442
|
// 清理现有覆盖物
|
|
443
443
|
this.cleanOverlays()
|
|
444
444
|
|
|
445
|
-
//
|
|
446
|
-
this.drawInfoAll
|
|
447
|
-
|
|
448
|
-
|
|
445
|
+
// 绘制多个类型覆盖物信息(如果存在)
|
|
446
|
+
this.drawInfoAll && this.renderAllDrawLayers()
|
|
447
|
+
// 绘制单个类型覆盖物信息(如果存在)
|
|
448
|
+
this.drawLayersInfo && this.renderSingleDrawLayer(drawType)
|
|
449
449
|
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
if (this.activeOperateIndex === -1) {
|
|
451
|
+
setTimeout(() => this.amap.setFitView(), 0)
|
|
452
|
+
}
|
|
452
453
|
},
|
|
453
454
|
|
|
454
455
|
// 清理地图上除限制区域外的所有覆盖物
|
|
@@ -471,7 +472,7 @@ export default {
|
|
|
471
472
|
this.drawInfoAll[key].forEach((item, index) => {
|
|
472
473
|
this.renderDrawLayer(item, key, index)
|
|
473
474
|
})
|
|
474
|
-
|
|
475
|
+
continue
|
|
475
476
|
}
|
|
476
477
|
|
|
477
478
|
// 如果不是数组,则直接渲染单个项目
|