geojs 1.14.4 → 1.14.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/eslint.config.js +129 -0
- package/geo.js +93357 -93344
- package/geo.lean.js +64567 -64554
- package/geo.lean.min.js +4 -4
- package/geo.min.js +11 -11
- package/package.json +12 -10
- package/src/annotation/annotation.js +13 -11
- package/src/annotation/circleAnnotation.js +1 -1
- package/src/annotation/ellipseAnnotation.js +1 -1
- package/src/annotation/lineAnnotation.js +18 -16
- package/src/annotation/pointAnnotation.js +8 -8
- package/src/annotation/polygonAnnotation.js +12 -11
- package/src/annotation/rectangleAnnotation.js +19 -17
- package/src/annotation/squareAnnotation.js +1 -1
- package/src/annotationLayer.js +2 -2
- package/src/camera.js +22 -22
- package/src/canvas/canvasRenderer.js +1 -1
- package/src/canvas/pixelmapFeature.js +3 -3
- package/src/feature.js +4 -3
- package/src/heatmapFeature.js +1 -0
- package/src/isolineFeature.js +1 -1
- package/src/layer.js +2 -2
- package/src/lineFeature.js +3 -3
- package/src/map.js +21 -21
- package/src/mapInteractor.js +3 -2
- package/src/markerFeature.js +1 -1
- package/src/pixelmapFeature.js +2 -1
- package/src/pointFeature.js +15 -12
- package/src/polygonFeature.js +10 -10
- package/src/registry.js +2 -2
- package/src/svg/svgRenderer.js +2 -2
- package/src/tile.js +2 -2
- package/src/tileCache.js +1 -1
- package/src/tileLayer.js +7 -6
- package/src/trackFeature.js +2 -2
- package/src/transform.js +5 -5
- package/src/ui/colorLegendWidget.js +2 -2
- package/src/ui/domWidget.js +1 -1
- package/src/ui/scaleWidget.js +11 -11
- package/src/ui/widget.js +1 -2
- package/src/util/color.js +4 -3
- package/src/util/common.js +16 -13
- package/src/util/distanceGrid.js +1 -2
- package/src/util/mockVGL.js +1 -3
- package/src/util/polyops.js +1 -1
- package/src/util/throttle.js +2 -2
- package/src/vgl/boundingObject.js +1 -1
- package/src/vgl/groupNode.js +1 -0
- package/src/vgl/material.js +1 -1
- package/src/vgl/object.js +1 -1
- package/src/webgl/layer.js +1 -1
- package/src/webgl/markerFeature.js +1 -1
- package/src/webgl/pointFeature.js +1 -1
- package/src/webgl/quadFeature.js +2 -2
- package/src/webgl/webglRenderer.js +1 -1
package/src/util/common.js
CHANGED
|
@@ -20,7 +20,7 @@ var m_timingData = {},
|
|
|
20
20
|
* it finds.
|
|
21
21
|
*
|
|
22
22
|
* @param {...*} var_args Any number of arguments.
|
|
23
|
-
* @returns {number} The first numeric argument, or `undefined` if there are no
|
|
23
|
+
* @returns {number?} The first numeric argument, or `undefined` if there are no
|
|
24
24
|
* numeric arguments.
|
|
25
25
|
* @private
|
|
26
26
|
*/
|
|
@@ -31,6 +31,7 @@ function setNumeric() {
|
|
|
31
31
|
return arguments[i];
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
return undefined;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/**
|
|
@@ -88,7 +89,7 @@ var util = {
|
|
|
88
89
|
* @param {geo.point2D} vert0 Vertex 0 of the triangle.
|
|
89
90
|
* @param {geo.point2D} vert1 Vertex 1 (x direction) of the triangle.
|
|
90
91
|
* @param {geo.point2D} vert2 Vertex 2 (y direction) of the triangle.
|
|
91
|
-
* @returns {geo.point2D} The point in the triangle basis, or `undefined`
|
|
92
|
+
* @returns {geo.point2D?} The point in the triangle basis, or `undefined`
|
|
92
93
|
* if the triangle is degenerate.
|
|
93
94
|
* @memberof geo.util
|
|
94
95
|
*/
|
|
@@ -103,6 +104,7 @@ var util = {
|
|
|
103
104
|
if (det) {
|
|
104
105
|
return {x: (x * d - y * b) / det, y: (x * -c + y * a) / det};
|
|
105
106
|
}
|
|
107
|
+
return undefined;
|
|
106
108
|
},
|
|
107
109
|
|
|
108
110
|
/**
|
|
@@ -188,7 +190,7 @@ var util = {
|
|
|
188
190
|
* Return a random string of length n || 8. The string consists of
|
|
189
191
|
* mixed-case ASCII alphanumerics.
|
|
190
192
|
*
|
|
191
|
-
* @param {number} [n
|
|
193
|
+
* @param {number} [n] The length of the string to return.
|
|
192
194
|
* @returns {string} A string of random characters.
|
|
193
195
|
* @memberof geo.util
|
|
194
196
|
*/
|
|
@@ -252,7 +254,7 @@ var util = {
|
|
|
252
254
|
*
|
|
253
255
|
* @param {number} start The start integer.
|
|
254
256
|
* @param {number} end The end integer.
|
|
255
|
-
* @param {number} [step
|
|
257
|
+
* @param {number} [step] The step.
|
|
256
258
|
* @returns {number[]} An array of integers.
|
|
257
259
|
* @memberof geo.util
|
|
258
260
|
*/
|
|
@@ -331,10 +333,10 @@ var util = {
|
|
|
331
333
|
* @param {geo.vgl.geometryData} geom The geometry to reference and modify.
|
|
332
334
|
* @param {string} srcName The name of the source.
|
|
333
335
|
* @param {number} len The number of elements for the array.
|
|
334
|
-
* @param {number} [allowLarger
|
|
336
|
+
* @param {number} [allowLarger] If the existing buffer is larger than
|
|
335
337
|
* requested, don't reallocate it unless it exceeds the size of
|
|
336
338
|
* `len * (1 + allowLarger)`.
|
|
337
|
-
* @param {number} [allocateLarger
|
|
339
|
+
* @param {number} [allocateLarger] If reallocating an existing buffer,
|
|
338
340
|
* allocate `len * (1 + allocateLarger)` to reduce the need to reallocate
|
|
339
341
|
* on subsequent calls. If this is the first allocation (the previous
|
|
340
342
|
* size was 0), `len` is allocated.
|
|
@@ -483,7 +485,7 @@ var util = {
|
|
|
483
485
|
* @param {geo.actionRecord[]} actions A list of actions to compare to the
|
|
484
486
|
* inputs and modifiers. The first action that matches will be
|
|
485
487
|
* returned.
|
|
486
|
-
* @returns {geo.actionRecord} A matching action or `undefined`.
|
|
488
|
+
* @returns {geo.actionRecord?} A matching action or `undefined`.
|
|
487
489
|
* @memberof geo.util
|
|
488
490
|
*/
|
|
489
491
|
actionMatch: function (inputs, modifiers, actions) {
|
|
@@ -512,6 +514,7 @@ var util = {
|
|
|
512
514
|
})) {
|
|
513
515
|
return matched;
|
|
514
516
|
}
|
|
517
|
+
return undefined;
|
|
515
518
|
},
|
|
516
519
|
|
|
517
520
|
/**
|
|
@@ -550,9 +553,9 @@ var util = {
|
|
|
550
553
|
var minLevel = Math.min(0, Math.floor(Math.log(Math.min(
|
|
551
554
|
(mapW || tileWidth) / tileWidth,
|
|
552
555
|
(mapH || tileHeight) / tileHeight)) / Math.log(2))),
|
|
553
|
-
maxLevel = Math.ceil(Math.log(Math.max(
|
|
556
|
+
maxLevel = Math.max(0, Math.ceil(Math.log(Math.max(
|
|
554
557
|
width / tileWidth,
|
|
555
|
-
height / tileHeight)) / Math.log(2));
|
|
558
|
+
height / tileHeight)) / Math.log(2)));
|
|
556
559
|
var mapParams = {
|
|
557
560
|
node: node,
|
|
558
561
|
ingcs: '+proj=longlat +axis=esu',
|
|
@@ -918,7 +921,7 @@ var util = {
|
|
|
918
921
|
* minimum.
|
|
919
922
|
* @param {number} [max] If specified, use this instead of calculating the
|
|
920
923
|
* maximum.
|
|
921
|
-
* @param {boolean} [limit
|
|
924
|
+
* @param {boolean} [limit] If truthy, if `min` is specified, the
|
|
922
925
|
* returned `min` will be the larger of the specified value and the
|
|
923
926
|
* computed value, and if `max` is specified, the returned value will
|
|
924
927
|
* be the smaller of the specified value and the computed value.
|
|
@@ -994,7 +997,7 @@ var util = {
|
|
|
994
997
|
|
|
995
998
|
/**
|
|
996
999
|
* Recursively merge two objects. This is intended to replace
|
|
997
|
-
*
|
|
1000
|
+
* $.extend(target, ...sources).
|
|
998
1001
|
*
|
|
999
1002
|
* @param {object} target target object to modify.
|
|
1000
1003
|
* @param {object} sources object(s) to merge into the target.
|
|
@@ -1397,9 +1400,9 @@ var util = {
|
|
|
1397
1400
|
*
|
|
1398
1401
|
* @param {boolean} [stop] Falsy to start tracking, truthy to start tracking.
|
|
1399
1402
|
* @param {boolean} [reset] If truthy, reset the statistics.
|
|
1400
|
-
* @param {number} [threshold
|
|
1403
|
+
* @param {number} [threshold] If present, set the threshold in
|
|
1401
1404
|
* milliseconds used in tracking slow callbacks.
|
|
1402
|
-
* @param {number} [keep
|
|
1405
|
+
* @param {number} [keep] If present, set the number of recent frame
|
|
1403
1406
|
* times to track.
|
|
1404
1407
|
* @memberof geo.util
|
|
1405
1408
|
*/
|
package/src/util/distanceGrid.js
CHANGED
|
@@ -55,7 +55,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
55
55
|
* @copyright 2012, David Leaver
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
var $ = require('jquery');
|
|
59
58
|
var L = {};
|
|
60
59
|
L.Util = {
|
|
61
60
|
// return unique ID of an object
|
|
@@ -181,7 +180,7 @@ DistanceGrid.prototype = {
|
|
|
181
180
|
|
|
182
181
|
/* return the point coordinates contained in the structure */
|
|
183
182
|
contents: function () {
|
|
184
|
-
return
|
|
183
|
+
return Object.values(this._objectPoint);
|
|
185
184
|
},
|
|
186
185
|
|
|
187
186
|
_getCoord: function (x) {
|
package/src/util/mockVGL.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
|
-
|
|
3
1
|
var webglRenderer = require('../webgl/webglRenderer');
|
|
4
2
|
|
|
5
3
|
var _renderWindow, _supported;
|
|
@@ -11,7 +9,7 @@ module.exports = {};
|
|
|
11
9
|
* state. Use restoreWebglRenderer to unmock. Call vgl.mockCounts() to get
|
|
12
10
|
* the number of times different webGL functions have been called.
|
|
13
11
|
*
|
|
14
|
-
* @param {boolean} [supported
|
|
12
|
+
* @param {boolean} [supported] If false, then the webgl renderer will
|
|
15
13
|
* indicate that this is an unsupported browser environment.
|
|
16
14
|
* @alias geo.util.mockWebglRenderer
|
|
17
15
|
*/
|
package/src/util/polyops.js
CHANGED
|
@@ -26,7 +26,7 @@ var util = require('../util/common');
|
|
|
26
26
|
* @property {number} [epsilon1] A precision value to use when computing the
|
|
27
27
|
* operation. If not specified, this is computed from the range of values in
|
|
28
28
|
* ``poly1``. It is used for processing ``poly1`` and the general operation.
|
|
29
|
-
* @property {number} [
|
|
29
|
+
* @property {number} [epsilon2] A precision value to use when processing
|
|
30
30
|
* ``poly2``. If not specified, this is computed from the range of values in
|
|
31
31
|
* ``poly2``.
|
|
32
32
|
* @property {string|object} [style] If specified, the preferred output style.
|
package/src/util/throttle.js
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* @alias geo.util.throttle
|
|
38
38
|
* @param {number} delay A zero-or-greater delay in milliseconds. For event
|
|
39
39
|
* callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
40
|
-
* @param {boolean} [no_trailing
|
|
40
|
+
* @param {boolean} [no_trailing] If no_trailing is
|
|
41
41
|
* true, callback will only execute every `delay` milliseconds while the
|
|
42
42
|
* throttled-function is being called. If no_trailing is false or
|
|
43
43
|
* unspecified, callback will be executed one final time after the last
|
|
@@ -173,7 +173,7 @@ var throttle = function (delay, no_trailing, callback, accumulator, debounce_mod
|
|
|
173
173
|
* @method geo.util.debounce
|
|
174
174
|
* @param {number} delay A zero-or-greater delay in milliseconds. For event
|
|
175
175
|
* callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
176
|
-
* @param {boolean} [at_begin
|
|
176
|
+
* @param {boolean} [at_begin] If at_begin is false or
|
|
177
177
|
* unspecified, callback will only be executed `delay` milliseconds after
|
|
178
178
|
* the last debounced-function call. If at_begin is true, callback will be
|
|
179
179
|
* executed only at the first debounced-function call. (After the
|
package/src/vgl/groupNode.js
CHANGED
package/src/vgl/material.js
CHANGED
package/src/vgl/object.js
CHANGED
package/src/webgl/layer.js
CHANGED
|
@@ -85,7 +85,7 @@ var webgl_layer = function () {
|
|
|
85
85
|
* renderers for multiple layers, rerendering can be delayed.
|
|
86
86
|
*
|
|
87
87
|
* @param {geo.webgl.webglRenderer} newRenderer The renderer to move to.
|
|
88
|
-
* @param {boolean} [rerender
|
|
88
|
+
* @param {boolean} [rerender] If truthy, rerender after the switch.
|
|
89
89
|
* @returns {this}
|
|
90
90
|
* @memberof geo.webgl.layer
|
|
91
91
|
*/
|
|
@@ -275,7 +275,7 @@ var webgl_markerFeature = function (arg) {
|
|
|
275
275
|
* each arrays.
|
|
276
276
|
* @param {array} styleArray If keyOrObject is a string, an array of values
|
|
277
277
|
* for the style. If keyOrObject is an object, this parameter is ignored.
|
|
278
|
-
* @param {boolean} [refresh
|
|
278
|
+
* @param {boolean} [refresh] `true` to redraw the feature when it has
|
|
279
279
|
* been updated. If an object with styles is passed, the redraw is only
|
|
280
280
|
* done once.
|
|
281
281
|
* @returns {this}
|
|
@@ -250,7 +250,7 @@ var webgl_pointFeature = function (arg) {
|
|
|
250
250
|
* each arrays.
|
|
251
251
|
* @param {array} styleArray If keyOrObject is a string, an array of values
|
|
252
252
|
* for the style. If keyOrObject is an object, this parameter is ignored.
|
|
253
|
-
* @param {boolean} [refresh
|
|
253
|
+
* @param {boolean} [refresh] `true` to redraw the feature when it has
|
|
254
254
|
* been updated. If an object with styles is passed, the redraw is only
|
|
255
255
|
* done once.
|
|
256
256
|
* @returns {this}
|
package/src/webgl/quadFeature.js
CHANGED
|
@@ -508,7 +508,7 @@ var webgl_quadFeature = function (arg) {
|
|
|
508
508
|
* @param {string} shaderType One of `image_vertex`, `image_fragment`,
|
|
509
509
|
* `color_vertex`, or `color_fragment`.
|
|
510
510
|
* @param {string} shaderCode The shader program.
|
|
511
|
-
* @returns {this} The class instance on success, undefined in an unknown
|
|
511
|
+
* @returns {this?} The class instance on success, undefined in an unknown
|
|
512
512
|
* shaderType was specified.
|
|
513
513
|
*/
|
|
514
514
|
this.setShader = function (shaderType, shaderCode) {
|
|
@@ -518,7 +518,7 @@ var webgl_quadFeature = function (arg) {
|
|
|
518
518
|
case 'color_vertex': vertexShaderColor = shaderCode; break;
|
|
519
519
|
case 'color_fragment': fragmentShaderColor = shaderCode; break;
|
|
520
520
|
default:
|
|
521
|
-
return;
|
|
521
|
+
return undefined;
|
|
522
522
|
}
|
|
523
523
|
return m_this;
|
|
524
524
|
};
|
|
@@ -319,7 +319,7 @@ var checkedWebGL;
|
|
|
319
319
|
webglRenderer.supported = function () {
|
|
320
320
|
if (checkedWebGL === undefined) {
|
|
321
321
|
/* This is extracted from what Modernizr uses. */
|
|
322
|
-
var canvas, ctx, exts;
|
|
322
|
+
var canvas, ctx, exts;
|
|
323
323
|
try {
|
|
324
324
|
canvas = document.createElement('canvas');
|
|
325
325
|
/** @type {WebGLRenderingContext} */
|