@mapcatch/util 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcatch/util",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "./dist/catchUtil.min.js",
5
5
  "repository": "",
6
6
  "author": "wanyanyan",
@@ -7,14 +7,14 @@ export default [
7
7
  { // 影像地图
8
8
  type: 'raster',
9
9
  tileSize: 256,
10
- tiles: ['http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
10
+ tiles: ['https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
11
11
  maxzoom: 18,
12
12
  layerType:'bmap'
13
13
  },
14
14
  { // 影像标注
15
15
  type: 'raster',
16
16
  tileSize: 256,
17
- tiles: ['http://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
17
+ tiles: ['https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
18
18
  maxzoom: 18,
19
19
  layerType:'bmap'
20
20
  }
@@ -28,14 +28,14 @@ export default [
28
28
  { // 矢量淡雅
29
29
  type: 'raster',
30
30
  tileSize: 256,
31
- tiles: ['http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
31
+ tiles: ['https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
32
32
  maxzoom: 18,
33
33
  layerType:'bmap'
34
34
  },
35
35
  {
36
36
  type: 'raster',
37
37
  tileSize: 256,
38
- tiles: ['http://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
38
+ tiles: ['https://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0'],
39
39
  maxzoom: 18,
40
40
  layerType:'bmap'
41
41
  }
@@ -22,5 +22,13 @@ export default [
22
22
  collapsed: false,
23
23
  visible: true,
24
24
  opacity: 1
25
+ },
26
+ {
27
+ id: 'overlay',
28
+ type: 'overlay',
29
+ name: '覆盖物',
30
+ collapsed: false,
31
+ visible: true,
32
+ opacity: 1
25
33
  }
26
34
  ]
@@ -1,7 +1,11 @@
1
1
  export default {
2
2
  annotation: 'icon-biaozhu',
3
3
  output: 'icon-chengguo',
4
- dataset: 'icon-dataset',
4
+ dataset: 'icon-photos',
5
+ overlay: 'icon-dataset',
6
+ geojson: 'icon-vector',
7
+ raster: 'icon-tuxiang',
8
+ object: 'icon-cube',
5
9
  dom: 'icon-tuxiang',
6
10
  dsm: 'icon-moxing',
7
11
  ndvi: 'icon-zhishu',
package/src/util.js CHANGED
@@ -116,9 +116,10 @@ export function diffLayers(newList, oldList = []) { // 任务详情中的任务
116
116
  if (_.isEqual(layer, oldNode)) {
117
117
  continue
118
118
  }
119
+ // 有属性更新
119
120
  if (['point', 'line', 'polygon'].includes(type)) {
120
121
  cmds.push(['updateAnnotations', layer])
121
- } if (opacity !== oldOpacity) {
122
+ } else if (opacity !== oldOpacity || (type === 'geojson' && !_.isEqual(layer.metadata, oldNode.metadata))) {
122
123
  cmds.push(['updateLayer', layer])
123
124
  } else if (visible !== oldVisible){
124
125
  cmds.push([visible?'addLayer':'removeLayer', layer])
@@ -347,8 +348,8 @@ export function getTaskTreeList(taskInfo, annotations, layers) {
347
348
  lyrs.forEach(d => {
348
349
  let {group} = d
349
350
  let groupItem = groups.find(d => d.id === group)
350
- if (!groupItem.items) {
351
- groupItem.items = []
351
+ if (!groupItem) {
352
+ return
352
353
  }
353
354
  groupItem.items.push(d)
354
355
  })