@mapcatch/util 2.0.5-b → 2.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/dist/catchUtil.min.esm.js +4 -4
- package/dist/catchUtil.min.js +1 -1
- package/package.json +1 -21
- package/src/constants/crs.js +42098 -42098
- package/src/event/event.js +4 -5
- package/src/gl-operations/constants.js +9 -9
- package/src/gl-operations/default_options.js +97 -97
- package/src/gl-operations/index.js +532 -532
- package/src/gl-operations/reglCommands/contours.js +27 -27
- package/src/gl-operations/reglCommands/default.js +45 -45
- package/src/gl-operations/reglCommands/hillshading.js +340 -340
- package/src/gl-operations/reglCommands/index.js +6 -6
- package/src/gl-operations/reglCommands/multiLayers.js +303 -303
- package/src/gl-operations/reglCommands/transitions.js +111 -111
- package/src/gl-operations/reglCommands/util.js +71 -71
- package/src/gl-operations/renderer.js +209 -209
- package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
- package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
- package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
- package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
- package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
- package/src/gl-operations/shaders/fragment/single.js +93 -93
- package/src/gl-operations/shaders/transform.js +21 -21
- package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
- package/src/gl-operations/shaders/vertex/double.js +16 -16
- package/src/gl-operations/shaders/vertex/multi3.js +19 -19
- package/src/gl-operations/shaders/vertex/multi4.js +22 -22
- package/src/gl-operations/shaders/vertex/multi5.js +25 -25
- package/src/gl-operations/shaders/vertex/multi6.js +28 -28
- package/src/gl-operations/shaders/vertex/single.js +13 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
- package/src/gl-operations/texture_manager.js +141 -141
- package/src/gl-operations/util.js +336 -336
- package/README.md +0 -44
package/src/event/event.js
CHANGED
|
@@ -9,6 +9,10 @@ function _addEventListener (type, listener, listenerList) {
|
|
|
9
9
|
|
|
10
10
|
function _removeEventListener (type, listener, listenerList) {
|
|
11
11
|
if (listenerList && listenerList[type]) {
|
|
12
|
+
if (!listener) {
|
|
13
|
+
delete listenerList[type]
|
|
14
|
+
return
|
|
15
|
+
}
|
|
12
16
|
const index = listenerList[type].indexOf(listener)
|
|
13
17
|
if (index !== -1) {
|
|
14
18
|
listenerList[type].splice(index, 1)
|
|
@@ -54,11 +58,6 @@ class Event {
|
|
|
54
58
|
* @returns {Object} `this`
|
|
55
59
|
*/
|
|
56
60
|
off (type, listener) {
|
|
57
|
-
if (!listener) {
|
|
58
|
-
this._listeners = {}
|
|
59
|
-
this._oneTimeListeners = {}
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
61
|
_removeEventListener(type, listener, this._listeners)
|
|
63
62
|
_removeEventListener(type, listener, this._oneTimeListeners)
|
|
64
63
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const CLEAR_COLOR = [0, 0, 0, 0]
|
|
2
|
-
export const MAX_TEXTURE_DIMENSION = 1024
|
|
3
|
-
export const EARTH_SUN_DISTANCE = 149600000000
|
|
4
|
-
export const EARTH_CIRCUMFERENCE = 40075016.686
|
|
5
|
-
export const SUN_RADIUS = 695508000
|
|
6
|
-
export const DEG2RAD = 0.017453292519943295
|
|
7
|
-
export const SLOPEFACTOR = 0.0333334
|
|
8
|
-
export const RGB_REGEX = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/
|
|
9
|
-
export const HEX_REGEX = /(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig
|
|
1
|
+
export const CLEAR_COLOR = [0, 0, 0, 0]
|
|
2
|
+
export const MAX_TEXTURE_DIMENSION = 1024
|
|
3
|
+
export const EARTH_SUN_DISTANCE = 149600000000
|
|
4
|
+
export const EARTH_CIRCUMFERENCE = 40075016.686
|
|
5
|
+
export const SUN_RADIUS = 695508000
|
|
6
|
+
export const DEG2RAD = 0.017453292519943295
|
|
7
|
+
export const SLOPEFACTOR = 0.0333334
|
|
8
|
+
export const RGB_REGEX = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/
|
|
9
|
+
export const HEX_REGEX = /(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
const defaultOptions = {
|
|
2
|
-
tileFormat: 'float32',
|
|
3
|
-
tileSize: 256,
|
|
4
|
-
colorScale: [],
|
|
5
|
-
sentinelValues: [],
|
|
6
|
-
transitions: false,
|
|
7
|
-
transitionTimeMs: 800,
|
|
8
|
-
debug: false,
|
|
9
|
-
extraPixelLayers: 0,
|
|
10
|
-
colorscaleMaxLength: 16,
|
|
11
|
-
sentinelMaxLength: 16,
|
|
12
|
-
|
|
13
|
-
// default TileLayer options
|
|
14
|
-
minZoom: 0,
|
|
15
|
-
maxZoom: 18,
|
|
16
|
-
subdomains: 'abc',
|
|
17
|
-
errorTileUrl: '',
|
|
18
|
-
zoomOffset: 0,
|
|
19
|
-
tms: false,
|
|
20
|
-
zoomReverse: false,
|
|
21
|
-
detectRetina: false,
|
|
22
|
-
crossOrigin: false,
|
|
23
|
-
|
|
24
|
-
// multi-analyze default options
|
|
25
|
-
glOperation: 'none',
|
|
26
|
-
multiLayers: 0,
|
|
27
|
-
operationUrlA: '',
|
|
28
|
-
operationUrlB: '',
|
|
29
|
-
operationUrlC: '',
|
|
30
|
-
operationUrlD: '',
|
|
31
|
-
operationUrlE: '',
|
|
32
|
-
operationUrlF: '',
|
|
33
|
-
filterLowA: 0,
|
|
34
|
-
filterHighA: 100000,
|
|
35
|
-
filterLowB: 0,
|
|
36
|
-
filterHighB: 100000,
|
|
37
|
-
filterLowC: 0,
|
|
38
|
-
filterHighC: 100000,
|
|
39
|
-
filterLowD: 0,
|
|
40
|
-
filterHighD: 100000,
|
|
41
|
-
filterLowE: 0,
|
|
42
|
-
filterHighE: 100000,
|
|
43
|
-
filterLowF: 0,
|
|
44
|
-
filterHighF: 100000,
|
|
45
|
-
multiplierA: 1,
|
|
46
|
-
multiplierB: 1,
|
|
47
|
-
multiplierC: 1,
|
|
48
|
-
multiplierD: 1,
|
|
49
|
-
multiplierE: 1,
|
|
50
|
-
multiplierF: 1,
|
|
51
|
-
|
|
52
|
-
// Hillshading default options
|
|
53
|
-
hillshadeType: 'none', // none, simple or pregen
|
|
54
|
-
hsSimpleZoomdelta: 0,
|
|
55
|
-
hsSimpleSlopescale: 3.0,
|
|
56
|
-
hsSimpleAzimuth: 315,
|
|
57
|
-
hsSimpleAltitude: 70,
|
|
58
|
-
hsAdvValueScale: 1.0,
|
|
59
|
-
hsAdvPixelScale: 'auto',
|
|
60
|
-
hsAdvSoftIterations: 10,
|
|
61
|
-
hsAdvAmbientIterations: 10,
|
|
62
|
-
hsAdvSunRadiusMultiplier: 100,
|
|
63
|
-
hsAdvFinalSoftMultiplier: 1.0,
|
|
64
|
-
hsAdvFinalAmbientMultiplier: 0.25,
|
|
65
|
-
hsAdvBaselayerUrl: '',
|
|
66
|
-
hsAdvSmoothInput: false,
|
|
67
|
-
hsAdvSmoothInputKernel: 3,
|
|
68
|
-
hsPregenUrl: '',
|
|
69
|
-
_hillshadeOptions: { hillshadeType: 'none' },
|
|
70
|
-
|
|
71
|
-
// Contours default options
|
|
72
|
-
contourType: 'none', // none, lines or illuminated
|
|
73
|
-
contourSmoothLines: false,
|
|
74
|
-
contourSmoothInput: false,
|
|
75
|
-
contourSmoothInputKernel: 7,
|
|
76
|
-
contourScaleFactor: 1,
|
|
77
|
-
contourInterval: 25,
|
|
78
|
-
contourIndexInterval: 100,
|
|
79
|
-
contourLineColor: '#000000',
|
|
80
|
-
contourIlluminatedHighlightColor: 'rgba(177,174,164,.5)',
|
|
81
|
-
contourIlluminatedShadowColor: '#5b5143',
|
|
82
|
-
contourIlluminatedShadowSize: 2, // px
|
|
83
|
-
contourLineWeight: 0.5, // px
|
|
84
|
-
contourLineIndexWeight: 2.0, // px
|
|
85
|
-
contourIndexLabels: false,
|
|
86
|
-
contourLabelFont: '12px Arial',
|
|
87
|
-
contourLabelDistance: 250,
|
|
88
|
-
contourHypso: false,
|
|
89
|
-
contourHypsoDomain: [0, 1000, 2000],
|
|
90
|
-
contourHypsoColors: ['#486341', '#e5d9c9', '#dddddd'],
|
|
91
|
-
contourBathy: false,
|
|
92
|
-
contourBathyDomain: [-2000, 0],
|
|
93
|
-
contourBathyColors: ['#315d9b', '#d5f2ff'],
|
|
94
|
-
contourBathyShadowColor: '#4e5c66',
|
|
95
|
-
contourBathyHighlightColor: 'rgba(224, 242, 255, .5)'
|
|
96
|
-
}
|
|
97
|
-
|
|
1
|
+
const defaultOptions = {
|
|
2
|
+
tileFormat: 'float32',
|
|
3
|
+
tileSize: 256,
|
|
4
|
+
colorScale: [],
|
|
5
|
+
sentinelValues: [],
|
|
6
|
+
transitions: false,
|
|
7
|
+
transitionTimeMs: 800,
|
|
8
|
+
debug: false,
|
|
9
|
+
extraPixelLayers: 0,
|
|
10
|
+
colorscaleMaxLength: 16,
|
|
11
|
+
sentinelMaxLength: 16,
|
|
12
|
+
|
|
13
|
+
// default TileLayer options
|
|
14
|
+
minZoom: 0,
|
|
15
|
+
maxZoom: 18,
|
|
16
|
+
subdomains: 'abc',
|
|
17
|
+
errorTileUrl: '',
|
|
18
|
+
zoomOffset: 0,
|
|
19
|
+
tms: false,
|
|
20
|
+
zoomReverse: false,
|
|
21
|
+
detectRetina: false,
|
|
22
|
+
crossOrigin: false,
|
|
23
|
+
|
|
24
|
+
// multi-analyze default options
|
|
25
|
+
glOperation: 'none',
|
|
26
|
+
multiLayers: 0,
|
|
27
|
+
operationUrlA: '',
|
|
28
|
+
operationUrlB: '',
|
|
29
|
+
operationUrlC: '',
|
|
30
|
+
operationUrlD: '',
|
|
31
|
+
operationUrlE: '',
|
|
32
|
+
operationUrlF: '',
|
|
33
|
+
filterLowA: 0,
|
|
34
|
+
filterHighA: 100000,
|
|
35
|
+
filterLowB: 0,
|
|
36
|
+
filterHighB: 100000,
|
|
37
|
+
filterLowC: 0,
|
|
38
|
+
filterHighC: 100000,
|
|
39
|
+
filterLowD: 0,
|
|
40
|
+
filterHighD: 100000,
|
|
41
|
+
filterLowE: 0,
|
|
42
|
+
filterHighE: 100000,
|
|
43
|
+
filterLowF: 0,
|
|
44
|
+
filterHighF: 100000,
|
|
45
|
+
multiplierA: 1,
|
|
46
|
+
multiplierB: 1,
|
|
47
|
+
multiplierC: 1,
|
|
48
|
+
multiplierD: 1,
|
|
49
|
+
multiplierE: 1,
|
|
50
|
+
multiplierF: 1,
|
|
51
|
+
|
|
52
|
+
// Hillshading default options
|
|
53
|
+
hillshadeType: 'none', // none, simple or pregen
|
|
54
|
+
hsSimpleZoomdelta: 0,
|
|
55
|
+
hsSimpleSlopescale: 3.0,
|
|
56
|
+
hsSimpleAzimuth: 315,
|
|
57
|
+
hsSimpleAltitude: 70,
|
|
58
|
+
hsAdvValueScale: 1.0,
|
|
59
|
+
hsAdvPixelScale: 'auto',
|
|
60
|
+
hsAdvSoftIterations: 10,
|
|
61
|
+
hsAdvAmbientIterations: 10,
|
|
62
|
+
hsAdvSunRadiusMultiplier: 100,
|
|
63
|
+
hsAdvFinalSoftMultiplier: 1.0,
|
|
64
|
+
hsAdvFinalAmbientMultiplier: 0.25,
|
|
65
|
+
hsAdvBaselayerUrl: '',
|
|
66
|
+
hsAdvSmoothInput: false,
|
|
67
|
+
hsAdvSmoothInputKernel: 3,
|
|
68
|
+
hsPregenUrl: '',
|
|
69
|
+
_hillshadeOptions: { hillshadeType: 'none' },
|
|
70
|
+
|
|
71
|
+
// Contours default options
|
|
72
|
+
contourType: 'none', // none, lines or illuminated
|
|
73
|
+
contourSmoothLines: false,
|
|
74
|
+
contourSmoothInput: false,
|
|
75
|
+
contourSmoothInputKernel: 7,
|
|
76
|
+
contourScaleFactor: 1,
|
|
77
|
+
contourInterval: 25,
|
|
78
|
+
contourIndexInterval: 100,
|
|
79
|
+
contourLineColor: '#000000',
|
|
80
|
+
contourIlluminatedHighlightColor: 'rgba(177,174,164,.5)',
|
|
81
|
+
contourIlluminatedShadowColor: '#5b5143',
|
|
82
|
+
contourIlluminatedShadowSize: 2, // px
|
|
83
|
+
contourLineWeight: 0.5, // px
|
|
84
|
+
contourLineIndexWeight: 2.0, // px
|
|
85
|
+
contourIndexLabels: false,
|
|
86
|
+
contourLabelFont: '12px Arial',
|
|
87
|
+
contourLabelDistance: 250,
|
|
88
|
+
contourHypso: false,
|
|
89
|
+
contourHypsoDomain: [0, 1000, 2000],
|
|
90
|
+
contourHypsoColors: ['#486341', '#e5d9c9', '#dddddd'],
|
|
91
|
+
contourBathy: false,
|
|
92
|
+
contourBathyDomain: [-2000, 0],
|
|
93
|
+
contourBathyColors: ['#315d9b', '#d5f2ff'],
|
|
94
|
+
contourBathyShadowColor: '#4e5c66',
|
|
95
|
+
contourBathyHighlightColor: 'rgba(224, 242, 255, .5)'
|
|
96
|
+
}
|
|
97
|
+
|
|
98
98
|
export default defaultOptions
|