@mapcatch/util 1.0.4 → 1.0.6

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapcatch/util",
3
- "version": "1.0.4",
4
- "main": "./dist/catchUtil.min.js",
3
+ "version": "1.0.6",
4
+ "main": "./dist/catchUtil.min.esm.js",
5
5
  "repository": "",
6
6
  "author": "wanyanyan",
7
7
  "license": "MIT",
@@ -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
  }
package/src/util.js CHANGED
@@ -35,7 +35,7 @@ export async function getPhotoInfo(file) { // 获取照片的经纬度
35
35
  let sliceFile = file.slice(0, 65536)
36
36
  sliceFile.name = file.name
37
37
  let exif = await getPhotoTags(sliceFile)
38
- let {GPSAltitude, GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, DateTimeOriginal, Model} = exif
38
+ let {GPSAltitude, GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, DateTimeOriginal, Model, PixelXDimension, PixelYDimension} = exif
39
39
  if (!GPSLongitude || !GPSLatitude) {
40
40
  return {}
41
41
  }
@@ -43,6 +43,8 @@ export async function getPhotoInfo(file) { // 获取照片的经纬度
43
43
  return {
44
44
  date,
45
45
  Model,
46
+ width: PixelXDimension,
47
+ height: PixelYDimension,
46
48
  position: {
47
49
  lng: getGeoCoordOperator(GPSLongitudeRef) * toRadian(GPSLongitude),
48
50
  lat: getGeoCoordOperator(GPSLatitudeRef) * toRadian(GPSLatitude),
@@ -116,9 +118,10 @@ export function diffLayers(newList, oldList = []) { // 任务详情中的任务
116
118
  if (_.isEqual(layer, oldNode)) {
117
119
  continue
118
120
  }
121
+ // 有属性更新
119
122
  if (['point', 'line', 'polygon'].includes(type)) {
120
123
  cmds.push(['updateAnnotations', layer])
121
- } if (opacity !== oldOpacity) {
124
+ } else if (opacity !== oldOpacity || (type === 'geojson' && !_.isEqual(layer.metadata, oldNode.metadata))) {
122
125
  cmds.push(['updateLayer', layer])
123
126
  } else if (visible !== oldVisible){
124
127
  cmds.push([visible?'addLayer':'removeLayer', layer])