@mapcatch/util 2.0.3 → 2.0.5-a

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 (74) hide show
  1. package/.eslintrc.js +54 -0
  2. package/.husky/pre-commit +1 -0
  3. package/.prettierrc +4 -0
  4. package/.vscode/settings.json +2 -0
  5. package/CHANGELOG.md +5 -1
  6. package/README.md +44 -0
  7. package/debug/app.js +26 -0
  8. package/debug/index.html +55 -0
  9. package/debug/libs/vue.global.js +16159 -0
  10. package/debug/my_icon.png +0 -0
  11. package/docs/Catolog.md +24 -0
  12. package/docs/Constant.md +92 -0
  13. package/docs/Event.md +90 -0
  14. package/docs/Util.md +345 -0
  15. package/package.json +2 -2
  16. package/src/constants/crs.js +42098 -42098
  17. package/src/constants/default_layers.js +102 -11
  18. package/src/constants/index.js +1 -0
  19. package/src/constants/layer_groups_multispectral.js +34 -0
  20. package/src/constants/layer_icons.js +1 -0
  21. package/src/gl-operations/constants.js +9 -9
  22. package/src/gl-operations/default_options.js +97 -97
  23. package/src/gl-operations/index.js +532 -520
  24. package/src/gl-operations/reglCommands/contours.js +27 -27
  25. package/src/gl-operations/reglCommands/default.js +45 -43
  26. package/src/gl-operations/reglCommands/hillshading.js +340 -332
  27. package/src/gl-operations/reglCommands/index.js +6 -6
  28. package/src/gl-operations/reglCommands/multiLayers.js +303 -301
  29. package/src/gl-operations/reglCommands/transitions.js +111 -109
  30. package/src/gl-operations/reglCommands/util.js +71 -71
  31. package/src/gl-operations/renderer.js +209 -192
  32. package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
  33. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
  34. package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
  35. package/src/gl-operations/shaders/fragment/drawResult.js +46 -41
  36. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
  37. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -54
  38. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
  39. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -55
  40. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
  41. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
  42. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
  43. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
  44. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -49
  45. package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -62
  46. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -46
  47. package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -123
  48. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
  49. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
  50. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
  51. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
  52. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
  53. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
  54. package/src/gl-operations/shaders/fragment/single.js +93 -88
  55. package/src/gl-operations/shaders/transform.js +21 -21
  56. package/src/gl-operations/shaders/util/computeColor.glsl +85 -84
  57. package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
  58. package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
  59. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
  60. package/src/gl-operations/shaders/vertex/double.js +16 -16
  61. package/src/gl-operations/shaders/vertex/multi3.js +19 -19
  62. package/src/gl-operations/shaders/vertex/multi4.js +22 -22
  63. package/src/gl-operations/shaders/vertex/multi5.js +25 -25
  64. package/src/gl-operations/shaders/vertex/multi6.js +28 -28
  65. package/src/gl-operations/shaders/vertex/single.js +13 -13
  66. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
  67. package/src/gl-operations/texture_manager.js +141 -141
  68. package/src/gl-operations/util.js +336 -336
  69. package/src/measure/index.js +14 -8
  70. package/src/transform.js +3 -0
  71. package/src/util.js +14 -6
  72. package/vite.config.js +58 -0
  73. package/dist/catchUtil.min.esm.js +0 -112833
  74. package/dist/catchUtil.min.js +0 -2922
package/.eslintrc.js ADDED
@@ -0,0 +1,54 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ browser: true,
6
+ es6: true
7
+ },
8
+ extends: ['eslint:recommended'],
9
+ parser: '@babel/eslint-parser',
10
+ ignorePatterns: ['src/photo-parser/exif', 'src/photo-parser/image-size'],
11
+ rules: {
12
+ 'no-extra-semi': 'error',
13
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
14
+ quotes: [
15
+ 'error',
16
+ 'single',
17
+ {
18
+ avoidEscape: true,
19
+ allowTemplateLiterals: true,
20
+ },
21
+ ],
22
+ semi: ['error', 'never'],
23
+ indent: [
24
+ 'error',
25
+ 2,
26
+ {
27
+ SwitchCase: 1,
28
+ flatTernaryExpressions: true,
29
+ },
30
+ ],
31
+ 'comma-dangle': ['error', 'never'],
32
+ 'no-multi-spaces': [
33
+ 'error',
34
+ {
35
+ ignoreEOLComments: true,
36
+ },
37
+ ],
38
+ 'space-infix-ops': 'error',
39
+ 'space-unary-ops': [
40
+ 'error',
41
+ {
42
+ words: true,
43
+ nonwords: false,
44
+ },
45
+ ],
46
+ 'space-before-function-paren': 'error',
47
+ },
48
+ parserOptions: {
49
+ ecmaVersion: 'latest',
50
+ sourceType: 'module',
51
+ allowImportExportEverywhere: true,
52
+ requireConfigFile: false
53
+ },
54
+ }
@@ -0,0 +1 @@
1
+ yarn lint-staged
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "singleQuote": true,
3
+ "semi": false
4
+ }
@@ -0,0 +1,2 @@
1
+ {
2
+ }
package/CHANGELOG.md CHANGED
@@ -65,4 +65,8 @@
65
65
  - [add] 增加量测工具集
66
66
  - [add] 增加空三解析工具集
67
67
  - [add] 增加报告生成函数
68
- - [improve] 坐标系列表增加“常用坐标系”分组
68
+ - [improve] 坐标系列表增加“常用坐标系”分组
69
+
70
+ ## v2.0.4
71
+ - [add] 增加多光谱图层信息
72
+ - [improve] glOperation渲染增加颜色配置
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # catchUtil
2
+ Mapcatch系列产品的公共函数、js工具以及相关的配置信息。
3
+
4
+ ## 使用方法
5
+
6
+ ### cdn引入
7
+ ```html
8
+ <script src="//unpkg.com/@mapcatch/util@latest/dist/catchUtil.min.js"></script>
9
+
10
+ <script>
11
+ // 解析jpg中的exif信息
12
+ catchUtil.getPhotoTags(file).then(info => {
13
+ console.log(info)
14
+ })
15
+ // 生成随机Id
16
+ catchUtil.generateId()
17
+ </script>
18
+
19
+ ```
20
+
21
+ ### 通过npm安装
22
+ ```
23
+ npm install @mapcatch/util
24
+ ```
25
+
26
+ ```js
27
+ import {getPhotoTags, generateId} from '@mapcatch/util'
28
+
29
+ // 解析jpg中的exif信息
30
+ getPhotoTags(file).then(info => {
31
+ console.log(info)
32
+ })
33
+ // 生成随机Id
34
+ generateId()
35
+ ```
36
+ ## 文档
37
+ 更多文档查看[在线文档](./docs/Catolog.md)
38
+
39
+ ## 开发
40
+ ```bash
41
+ yarn
42
+
43
+ yarn build
44
+ ```
package/debug/app.js ADDED
@@ -0,0 +1,26 @@
1
+ import * as util from '../src/index.js'
2
+
3
+ Vue.createApp({
4
+ methods: {
5
+ coustom() {
6
+ console.log(util.getWKTString({
7
+ type: 3,
8
+ epsg_code: 4527
9
+ }))
10
+ },
11
+ coustom2() {
12
+ },
13
+ async parsePhoto(e) {
14
+ let file = e.target.files[0]
15
+ let exif = await util.parsePhoto(file)
16
+ console.log(exif)
17
+ }
18
+ },
19
+ mounted() {
20
+
21
+ },
22
+ data() {
23
+ return {
24
+ }
25
+ }
26
+ }).mount('#app')
@@ -0,0 +1,55 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset=utf-8 />
5
+ <title>Catch3d-js</title>
6
+
7
+ <style>
8
+ body {
9
+ position: absolute;
10
+ width: 100%;
11
+ height: 100%;
12
+ margin:0;
13
+ padding:0;
14
+ overflow: hidden;
15
+ }
16
+ #map {
17
+ position: absolute;
18
+ width: 100%;
19
+ height: 100%;
20
+ background-color: #000000;
21
+ }
22
+ .btn{
23
+ position: absolute;
24
+ z-index: 5;
25
+ top: 20px;
26
+ left: 220px;
27
+ }
28
+ .btn2{
29
+ position: absolute;
30
+ z-index: 5;
31
+ top: 20px;
32
+ left: 320px;
33
+ }
34
+ .btn3{
35
+ position: absolute;
36
+ z-index: 5;
37
+ top: 20px;
38
+ left: 20px;
39
+ }
40
+ input{
41
+ width: 60px;
42
+ }
43
+ </style>
44
+ <script src="./libs/vue.global.js"></script>
45
+ </head>
46
+ <body>
47
+ <div id="app">
48
+ <div id='map'></div>
49
+ <button class="btn" @click="coustom">测试1</button>
50
+ <button class="btn2" @click="coustom2">测试2</button>
51
+ <input class="btn3" type="file" @change="parsePhoto">
52
+ </div>
53
+ <script type='module' src="./app.js"></script>
54
+ </body>
55
+ </html>