@mapcatch/util 2.0.4 → 2.0.5-b

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.
Files changed (56) hide show
  1. package/README.md +44 -0
  2. package/dist/catchUtil.min.esm.js +56 -102
  3. package/dist/catchUtil.min.js +2 -2
  4. package/package.json +26 -2
  5. package/src/constants/crs.js +42098 -42098
  6. package/src/constants/default_layers.js +42 -94
  7. package/src/gl-operations/constants.js +9 -9
  8. package/src/gl-operations/default_options.js +97 -97
  9. package/src/gl-operations/index.js +532 -532
  10. package/src/gl-operations/reglCommands/contours.js +27 -27
  11. package/src/gl-operations/reglCommands/default.js +45 -45
  12. package/src/gl-operations/reglCommands/hillshading.js +340 -340
  13. package/src/gl-operations/reglCommands/index.js +6 -6
  14. package/src/gl-operations/reglCommands/multiLayers.js +303 -303
  15. package/src/gl-operations/reglCommands/transitions.js +111 -111
  16. package/src/gl-operations/reglCommands/util.js +71 -71
  17. package/src/gl-operations/renderer.js +209 -209
  18. package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
  19. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
  20. package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
  21. package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
  22. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
  23. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
  24. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
  25. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
  26. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
  27. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
  28. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
  29. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
  30. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
  31. package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
  32. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
  33. package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
  34. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
  35. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
  36. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
  37. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
  38. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
  39. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
  40. package/src/gl-operations/shaders/fragment/single.js +93 -93
  41. package/src/gl-operations/shaders/transform.js +21 -21
  42. package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
  43. package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
  44. package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
  45. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
  46. package/src/gl-operations/shaders/vertex/double.js +16 -16
  47. package/src/gl-operations/shaders/vertex/multi3.js +19 -19
  48. package/src/gl-operations/shaders/vertex/multi4.js +22 -22
  49. package/src/gl-operations/shaders/vertex/multi5.js +25 -25
  50. package/src/gl-operations/shaders/vertex/multi6.js +28 -28
  51. package/src/gl-operations/shaders/vertex/single.js +13 -13
  52. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
  53. package/src/gl-operations/texture_manager.js +141 -141
  54. package/src/gl-operations/util.js +336 -336
  55. package/src/util.js +14 -6
  56. package/CHANGELOG.md +0 -72
package/src/util.js CHANGED
@@ -370,12 +370,20 @@ export function getLineLabelFeature (lineFeature) {
370
370
  * @param {*} icons 要添加的图标列表,包含图标的url以及是否作为sdf符号
371
371
  */
372
372
  export function addIcons2Map (map, icons) {
373
- icons.forEach(({url, sdf}) => {
374
- map.loadImage(url, (error, image) => {
375
- let iconName = url.split('/').pop().split('.')[0]
376
- if(map.hasImage(iconName)) return
377
- if (error) throw error
378
- map.addImage(iconName, image, {sdf})
373
+ return new Promise((resolve, reject) => {
374
+ let cnt = icons.length
375
+ icons.forEach(({url, sdf}) => {
376
+ map.loadImage(url, (error, image) => {
377
+ cnt--
378
+ let iconName = url.split('/').pop().split('.')[0]
379
+ if(map.hasImage(iconName)) return
380
+ if (error) {
381
+ reject(error)
382
+ return
383
+ }
384
+ map.addImage(iconName, image, {sdf})
385
+ if (cnt <= 0) resolve(true)
386
+ })
379
387
  })
380
388
  })
381
389
  }
package/CHANGELOG.md DELETED
@@ -1,72 +0,0 @@
1
- ## v1.0.2
2
-
3
- - [fix] 修复图片解析报错的问题。
4
-
5
- ## v1.0.3
6
-
7
- - [fix] 修复`util.formatDate(date)`日期一直是当前日期的bug
8
- - [add] 增加`util.getTaskTreeList()`工具函数
9
- - [add] 增加`layerGroups`、`bmapTypes`、`colors`、`defaultLayers`、`layerFolders`、`layerIcons`、`mapViewModes`、`taskParams`、`tools`常量
10
-
11
- ## v1.0.4
12
-
13
- - [add] 常量`layerGroups`增加覆盖物分组
14
- - [add] 常量`layerIcons`增加overlay/geojson/raster/object类型图标
15
-
16
- ## v1.0.5
17
-
18
- - [fix] 地图底图的服务地址修改为https协议
19
- - [fix] 工具函数`diffLayers`增加覆盖物图层更新的比较
20
-
21
- ## v1.0.6
22
-
23
- - [improve] `util.getPhotoInfo`函数返回值增加图像的width和height
24
-
25
- ## v1.0.7
26
-
27
- - [fix] 修复获取exif中可能存在宽高错误的问题
28
- - [improve] 获取照片属性时没有GPS也会返回其他的属性信息
29
-
30
- ## v1.0.8
31
-
32
- - [improve] 支持tiff等其他格式图片获取宽高
33
-
34
- ## v1.0.9
35
-
36
- - [fix] 修复华为相机的照片解析失败的问题
37
-
38
- ## v1.0.10
39
-
40
- - [add] 增加`util.hasNaN()`和`util.getRotationMatrix()`接口
41
- - [add] 增加常量`crsTypes` `measurementFields`
42
- - [improve] 更新常量`defaultLayers`和`layerFolders`
43
- - [delete] 删除`getPhotoTags`接口
44
-
45
- ## v1.0.11
46
-
47
- - [add] 增加`util.getWKTString(epsg_code)`接口
48
- - [add] 增加常量`crsList`
49
-
50
- ## v1.0.12
51
-
52
- - [improve] 点标注的显示字段增加经度(lng)和纬度(lat)
53
-
54
- ## v1.0.13
55
-
56
- - [improve] diffLayers检查所有图层的metadata,有变化则提交更新
57
-
58
- ## v1.0.14
59
-
60
- - [improve] addIcons2Map支持sdf符号
61
-
62
- ## v2.0.3
63
-
64
- - [add] 增加坐标转换函数库
65
- - [add] 增加量测工具集
66
- - [add] 增加空三解析工具集
67
- - [add] 增加报告生成函数
68
- - [improve] 坐标系列表增加“常用坐标系”分组
69
-
70
- ## v2.0.4
71
- - [add] 增加多光谱图层信息
72
- - [improve] glOperation渲染增加颜色配置