@mapcatch/util 2.0.4 → 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 (68) 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/README.md +44 -0
  6. package/debug/app.js +26 -0
  7. package/debug/index.html +55 -0
  8. package/debug/libs/vue.global.js +16159 -0
  9. package/debug/my_icon.png +0 -0
  10. package/docs/Catolog.md +24 -0
  11. package/docs/Constant.md +92 -0
  12. package/docs/Event.md +90 -0
  13. package/docs/Util.md +345 -0
  14. package/package.json +21 -1
  15. package/src/constants/crs.js +42098 -42098
  16. package/src/constants/default_layers.js +42 -94
  17. package/src/gl-operations/constants.js +9 -9
  18. package/src/gl-operations/default_options.js +97 -97
  19. package/src/gl-operations/index.js +532 -532
  20. package/src/gl-operations/reglCommands/contours.js +27 -27
  21. package/src/gl-operations/reglCommands/default.js +45 -45
  22. package/src/gl-operations/reglCommands/hillshading.js +340 -340
  23. package/src/gl-operations/reglCommands/index.js +6 -6
  24. package/src/gl-operations/reglCommands/multiLayers.js +303 -303
  25. package/src/gl-operations/reglCommands/transitions.js +111 -111
  26. package/src/gl-operations/reglCommands/util.js +71 -71
  27. package/src/gl-operations/renderer.js +209 -209
  28. package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
  29. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
  30. package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
  31. package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
  32. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
  33. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
  34. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
  35. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
  36. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
  37. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
  38. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
  39. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
  40. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
  41. package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
  42. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
  43. package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
  44. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
  45. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
  46. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
  47. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
  48. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
  49. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
  50. package/src/gl-operations/shaders/fragment/single.js +93 -93
  51. package/src/gl-operations/shaders/transform.js +21 -21
  52. package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
  53. package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
  54. package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
  55. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
  56. package/src/gl-operations/shaders/vertex/double.js +16 -16
  57. package/src/gl-operations/shaders/vertex/multi3.js +19 -19
  58. package/src/gl-operations/shaders/vertex/multi4.js +22 -22
  59. package/src/gl-operations/shaders/vertex/multi5.js +25 -25
  60. package/src/gl-operations/shaders/vertex/multi6.js +28 -28
  61. package/src/gl-operations/shaders/vertex/single.js +13 -13
  62. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
  63. package/src/gl-operations/texture_manager.js +141 -141
  64. package/src/gl-operations/util.js +336 -336
  65. package/src/util.js +14 -6
  66. package/vite.config.js +58 -0
  67. package/dist/catchUtil.min.esm.js +0 -113044
  68. package/dist/catchUtil.min.js +0 -2928
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/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>