geojs 1.6.3 → 1.6.4
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/CHANGELOG.md +12 -0
- package/README.md +14 -9
- package/geo.js +132 -117
- package/geo.lean.js +132 -117
- package/geo.lean.min.js +2 -2
- package/geo.min.js +2 -2
- package/package.json +6 -8
- package/src/annotation.js +9 -5
- package/src/annotationLayer.js +3 -3
- package/src/camera.js +5 -5
- package/src/choroplethFeature.js +1 -1
- package/src/domRenderer.js +2 -1
- package/src/featureLayer.js +1 -1
- package/src/fileReader.js +2 -2
- package/src/imageTile.js +2 -1
- package/src/isolineFeature.js +1 -1
- package/src/layer.js +4 -2
- package/src/map.js +17 -15
- package/src/mapInteractor.js +17 -17
- package/src/markerFeature.js +2 -2
- package/src/meshFeature.js +1 -1
- package/src/osmLayer.js +2 -0
- package/src/pointFeature.js +1 -1
- package/src/registry.js +2 -2
- package/src/svg/svgRenderer.js +3 -3
- package/src/tileCache.js +1 -1
- package/src/tileLayer.js +10 -10
- package/src/trackFeature.js +19 -19
- package/src/transform.js +8 -9
- package/src/typedef.js +2 -0
- package/src/ui/sliderWidget.js +1 -1
- package/src/util/clustering.js +3 -3
- package/src/util/color.js +1 -1
- package/src/util/common.js +4 -4
- package/src/util/throttle.js +1 -1
- package/src/webgl/markerFeature.js +1 -1
- package/src/webgl/pointFeature.js +1 -1
- package/src/webgl/webglRenderer.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geojs",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "JavaScript Geo Visualization and Analysis Library",
|
|
5
5
|
"homepage": "https://github.com/OpenGeoscience/geojs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"glob": "^7.2.0",
|
|
55
55
|
"glslang-validator-prebuilt": "0.0.6",
|
|
56
56
|
"imports-loader": "^3.1.1",
|
|
57
|
-
"istanbul-combine": "^0.3.0",
|
|
58
57
|
"jaguarjs-jsdoc": "^1.0.2",
|
|
59
58
|
"jasmine-core": "^4.0.0",
|
|
60
59
|
"js-yaml": "^4.1.0",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
"jsdoc-autoprivate": "0.0.1",
|
|
63
62
|
"jsonlint-mod": "^1.7.6",
|
|
64
63
|
"jstransformer-markdown-it": "^2.0.0",
|
|
65
|
-
"karma": "^6.3.
|
|
64
|
+
"karma": "^6.3.13",
|
|
66
65
|
"karma-chrome-launcher": "^3.1.0",
|
|
67
66
|
"karma-coverage": "^2.1.0",
|
|
68
67
|
"karma-firefox-launcher": "^2.1.2",
|
|
@@ -82,15 +81,15 @@
|
|
|
82
81
|
"semantic-release": "^19.0.2",
|
|
83
82
|
"serve-index": "^1.9.1",
|
|
84
83
|
"shader-loader": "^1.3.1",
|
|
85
|
-
"sinon": "^
|
|
84
|
+
"sinon": "^13.0.1",
|
|
86
85
|
"string-replace-webpack-plugin": "^0.1.3",
|
|
87
86
|
"style-loader": "^3.3.1",
|
|
88
87
|
"stylus": "^0.56.0",
|
|
89
88
|
"stylus-loader": "^6.2.0",
|
|
90
|
-
"terser-webpack-plugin": "^5.3.
|
|
89
|
+
"terser-webpack-plugin": "^5.3.1",
|
|
91
90
|
"touch-emulator": "^1.0.0",
|
|
92
91
|
"typeface-lato": "^1.1.13",
|
|
93
|
-
"webpack": "^5.
|
|
92
|
+
"webpack": "^5.68.0",
|
|
94
93
|
"webpack-cli": "^4.9.1",
|
|
95
94
|
"webpack-merge": "^5.8.0"
|
|
96
95
|
},
|
|
@@ -147,10 +146,9 @@
|
|
|
147
146
|
"ci": "npm run ci-build && npm run ci-test",
|
|
148
147
|
"ci-build": "bash -c '(webpack --config webpack.config.js & webpack --config webpack-lean.config.js & npm run docs & npm run get-data-files & npm run lint & npm run puglint & npm run glsllint & npm run build-examples & npm run build-tutorials & wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n)'",
|
|
149
148
|
"ci-build-wait": "bash -c '(webpack --config webpack.config.js & webpack --config webpack-lean.config.js & npm run docs & npm run get-data-files & npm run lint & npm run puglint & npm run glsllint & npm run build-examples & npm run build-tutorials & wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && wait -n && FAIL=0 || FAIL=1; wait; [ \"$FAIL\" == \"0\" ])'",
|
|
150
|
-
"ci-test": "npm run test-headless && npm run test-webglheadless && npm run test-headed && npm run test-tutorials
|
|
149
|
+
"ci-test": "npm run test-headless && npm run test-webglheadless && npm run test-headed && npm run test-tutorials",
|
|
151
150
|
"ci-xvfb": "npm run ci-clean && npm run ci-build && TEST_SAVE_IMAGE='all' xvfb-run -s '-ac -screen 0 1280x1024x24' npm run ci-test",
|
|
152
151
|
"start": "karma start karma.conf.js",
|
|
153
|
-
"combine-coverage": "istanbul-combine -d dist/cobertura -r cobertura 'dist/coverage/json/**/coverage-final.json'",
|
|
154
152
|
"examples": "node examples/build.js && webpack --config webpack-examples.config.js && node tutorials/build.js && webpack --config webpack-tutorials.config.js && node ./tests/runners/server.js --host \"${HOST-}\" --port ${PORT-8082} --dist",
|
|
155
153
|
"docs": "jsdoc --pedantic -d dist/apidocs -r src package.json -c jsdoc.conf.json",
|
|
156
154
|
"website": "cd website && npx hexo server",
|
package/src/annotation.js
CHANGED
|
@@ -145,7 +145,7 @@ var annotation = function (type, args) {
|
|
|
145
145
|
/**
|
|
146
146
|
* Get or set the name of this annotation.
|
|
147
147
|
*
|
|
148
|
-
* @param {string|undefined} arg If `undefined`, return the name, otherwise
|
|
148
|
+
* @param {string|undefined} [arg] If `undefined`, return the name, otherwise
|
|
149
149
|
* change it. When setting the name, the value is trimmed of
|
|
150
150
|
* whitespace. The name will not be changed to an empty string.
|
|
151
151
|
* @returns {this|string} The current name or this annotation.
|
|
@@ -293,7 +293,7 @@ var annotation = function (type, args) {
|
|
|
293
293
|
/**
|
|
294
294
|
* Get or set the state of this annotation.
|
|
295
295
|
*
|
|
296
|
-
* @param {string|undefined} arg If `undefined`, return the state,
|
|
296
|
+
* @param {string|undefined} [arg] If `undefined`, return the state,
|
|
297
297
|
* otherwise change it. This should be one of the
|
|
298
298
|
* {@link geo.annotation.state} values.
|
|
299
299
|
* @returns {this|string} The current state or this annotation.
|
|
@@ -352,7 +352,7 @@ var annotation = function (type, args) {
|
|
|
352
352
|
* `'remove'` if the annotation should be removed, falsy to not update
|
|
353
353
|
* anything.
|
|
354
354
|
*/
|
|
355
|
-
this.processAction = function () {
|
|
355
|
+
this.processAction = function (evt) {
|
|
356
356
|
return undefined;
|
|
357
357
|
};
|
|
358
358
|
|
|
@@ -1081,8 +1081,8 @@ var annotation = function (type, args) {
|
|
|
1081
1081
|
*
|
|
1082
1082
|
* @param {object} m_this The current annotation instance.
|
|
1083
1083
|
* @param {function} s_actions The parent actions method.
|
|
1084
|
-
* @param {string}
|
|
1085
|
-
* the current state.
|
|
1084
|
+
* @param {string|undefined} state The state to return actions for. Defaults
|
|
1085
|
+
* to the current state.
|
|
1086
1086
|
* @param {string} name The name of this annotation.
|
|
1087
1087
|
* @param {Array} originalArgs arguments to original call
|
|
1088
1088
|
* @returns {geo.actionRecord[]} A list of actions.
|
|
@@ -1183,6 +1183,10 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1183
1183
|
* @property {geo.polygonFeature.styleSpec} [editStyle] The style to apply to a
|
|
1184
1184
|
* rectangle in edit mode.
|
|
1185
1185
|
*/
|
|
1186
|
+
/*
|
|
1187
|
+
* @typedef {object} geo.rectangleAnnotation.subspec
|
|
1188
|
+
* @typedef {geo.annotation.spec | geo.rectangleAnnotation.subspec} geo.rectangleAnnotation.spec
|
|
1189
|
+
*/
|
|
1186
1190
|
|
|
1187
1191
|
/**
|
|
1188
1192
|
* Rectangle annotation class.
|
package/src/annotationLayer.js
CHANGED
|
@@ -399,7 +399,7 @@ var annotationLayer = function (arg) {
|
|
|
399
399
|
* @param {geo.annotation} annotation The annotation to add.
|
|
400
400
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
401
401
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
402
|
-
* @param {boolean} update If `false`, don't update the layer after adding
|
|
402
|
+
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
403
403
|
* the annotation.
|
|
404
404
|
* @returns {this} The current layer.
|
|
405
405
|
* @fires geo.event.annotation.add_before
|
|
@@ -435,7 +435,7 @@ var annotationLayer = function (arg) {
|
|
|
435
435
|
* Remove an annotation from the layer.
|
|
436
436
|
*
|
|
437
437
|
* @param {geo.annotation} annotation The annotation to remove.
|
|
438
|
-
* @param {boolean} update If `false`, don't update the layer after removing
|
|
438
|
+
* @param {boolean} [update] If `false`, don't update the layer after removing
|
|
439
439
|
* the annotation.
|
|
440
440
|
* @returns {boolean} `true` if an annotation was removed.
|
|
441
441
|
* @fires geo.event.annotation.remove
|
|
@@ -607,7 +607,7 @@ var annotationLayer = function (arg) {
|
|
|
607
607
|
* Return the current set of annotations as a geojson object. Alternately,
|
|
608
608
|
* add a set of annotations from a geojson object.
|
|
609
609
|
*
|
|
610
|
-
* @param {string|
|
|
610
|
+
* @param {string|object|File} [geojson] If present, add annotations based on
|
|
611
611
|
* the given geojson object. If `undefined`, return the current
|
|
612
612
|
* annotations as geojson. This may be a JSON string, a javascript
|
|
613
613
|
* object, or a File object.
|
package/src/camera.js
CHANGED
|
@@ -502,7 +502,7 @@ var camera = function (spec) {
|
|
|
502
502
|
* Project a vector from world space into viewport (display) space. The
|
|
503
503
|
* resulting vector always has the last component (`w`) equal to 1.
|
|
504
504
|
*
|
|
505
|
-
* @param {
|
|
505
|
+
* @param {vec3|vec4} point The point in world coordinates.
|
|
506
506
|
* @returns {vec4} The point in display coordinates.
|
|
507
507
|
*/
|
|
508
508
|
this.worldToDisplay4 = function (point) {
|
|
@@ -518,7 +518,7 @@ var camera = function (spec) {
|
|
|
518
518
|
* Project a vector from viewport (display) space into world space. The
|
|
519
519
|
* resulting vector always has the last component (`w`) equal to 1.
|
|
520
520
|
*
|
|
521
|
-
* @param {
|
|
521
|
+
* @param {vec3|vec4} point The point in display coordinates.
|
|
522
522
|
* @returns {vec4} The point in world space coordinates.
|
|
523
523
|
*/
|
|
524
524
|
this.displayToWorld4 = function (point) {
|
|
@@ -788,7 +788,7 @@ var camera = function (spec) {
|
|
|
788
788
|
/**
|
|
789
789
|
* Represent a glmatrix as a pretty-printed string.
|
|
790
790
|
* @param {mat4} mat A 4 x 4 matrix.
|
|
791
|
-
* @param {number} prec The number of decimal places.
|
|
791
|
+
* @param {number} [prec] The number of decimal places.
|
|
792
792
|
* @returns {string}
|
|
793
793
|
*/
|
|
794
794
|
this.ppMatrix = function (mat, prec) {
|
|
@@ -862,7 +862,7 @@ var camera = function (spec) {
|
|
|
862
862
|
|
|
863
863
|
/**
|
|
864
864
|
* Supported projection types.
|
|
865
|
-
* @enum
|
|
865
|
+
* @enum {boolean}
|
|
866
866
|
*/
|
|
867
867
|
camera.projection = {
|
|
868
868
|
perspective: true,
|
|
@@ -872,7 +872,7 @@ camera.projection = {
|
|
|
872
872
|
/**
|
|
873
873
|
* Default camera clipping bounds. Some features and renderers may rely on the
|
|
874
874
|
* far clip value being more positive than the near clip value.
|
|
875
|
-
* @enum
|
|
875
|
+
* @enum {number}
|
|
876
876
|
*/
|
|
877
877
|
camera.clipbounds = {
|
|
878
878
|
perspective: {
|
package/src/choroplethFeature.js
CHANGED
|
@@ -185,7 +185,7 @@ var choroplethFeature = function (arg) {
|
|
|
185
185
|
/**
|
|
186
186
|
* Add a geojson polygon feature to the current layer.
|
|
187
187
|
*
|
|
188
|
-
* @param {geojsonFeature} feature A geojson parsed feature.
|
|
188
|
+
* @param {geo.geojsonFeature} feature A geojson parsed feature.
|
|
189
189
|
* @param {geo.geoColor} fillColor The fill color for the feature.
|
|
190
190
|
* @returns {geo.polygonFeature}
|
|
191
191
|
*/
|
package/src/domRenderer.js
CHANGED
|
@@ -38,9 +38,10 @@ var domRenderer = function (arg) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Initialize.
|
|
40
40
|
*
|
|
41
|
+
* @param {object} [arg] Optional arguments.
|
|
41
42
|
* @returns {this}
|
|
42
43
|
*/
|
|
43
|
-
this._init = function () {
|
|
44
|
+
this._init = function (arg) {
|
|
44
45
|
var layer = m_this.layer().node();
|
|
45
46
|
|
|
46
47
|
if (!m_this.canvas() && layer && layer.length) {
|
package/src/featureLayer.js
CHANGED
|
@@ -109,7 +109,7 @@ var featureLayer = function (arg) {
|
|
|
109
109
|
/**
|
|
110
110
|
* Get/Set drawables.
|
|
111
111
|
*
|
|
112
|
-
* @param {geo.feature[]} val A list of features, or unspecified to return
|
|
112
|
+
* @param {geo.feature[]} [val] A list of features, or unspecified to return
|
|
113
113
|
* the current feature list. If a list is provided, features are added or
|
|
114
114
|
* removed as needed.
|
|
115
115
|
* @returns {geo.feature[]|this} The current features associated with the
|
package/src/fileReader.js
CHANGED
|
@@ -6,7 +6,7 @@ var object = require('./object');
|
|
|
6
6
|
* Object specification for a fileReader.
|
|
7
7
|
*
|
|
8
8
|
* @typedef {object} geo.fileReader.spec
|
|
9
|
-
* @property {geo.featureLayer} layer The target feature layer.
|
|
9
|
+
* @property {geo.featureLayer} [layer] The target feature layer.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -15,7 +15,7 @@ var object = require('./object');
|
|
|
15
15
|
* @class
|
|
16
16
|
* @alias geo.fileReader
|
|
17
17
|
* @extends geo.object
|
|
18
|
-
* @param {geo.fileReader.spec} arg
|
|
18
|
+
* @param {geo.fileReader.spec} [arg]
|
|
19
19
|
* @returns {geo.fileReader}
|
|
20
20
|
*/
|
|
21
21
|
var fileReader = function (arg) {
|
package/src/imageTile.js
CHANGED
|
@@ -11,7 +11,8 @@ var tile = require('./tile');
|
|
|
11
11
|
* @property {object} [size] The size of each tile.
|
|
12
12
|
* @property {number} [size.x=256] Width in pixels.
|
|
13
13
|
* @property {number} [size.y=256] Height in pixels.
|
|
14
|
-
* @property {string} [crossDomain='anonymous'] Image CORS attribute.
|
|
14
|
+
* @property {string} [crossDomain='anonymous'] Image CORS attribute. This is
|
|
15
|
+
* used for the `crossorigin` property when loading images.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
18
|
/**
|
package/src/isolineFeature.js
CHANGED
|
@@ -657,7 +657,7 @@ var isolineFeature = function (arg) {
|
|
|
657
657
|
* the generated labels. The viewport calculation is conservative, as the
|
|
658
658
|
* map could be rotated, changed size, or have other modifications.
|
|
659
659
|
*
|
|
660
|
-
* @returns {
|
|
660
|
+
* @returns {this}
|
|
661
661
|
*/
|
|
662
662
|
this._updateLabelPositions = function () {
|
|
663
663
|
var last = m_lastLabelPositions;
|
package/src/layer.js
CHANGED
|
@@ -291,7 +291,7 @@ var layer = function (arg) {
|
|
|
291
291
|
/**
|
|
292
292
|
* Get root node of the layer.
|
|
293
293
|
*
|
|
294
|
-
* @returns {
|
|
294
|
+
* @returns {HTMLDivElement}
|
|
295
295
|
*/
|
|
296
296
|
this.node = function () {
|
|
297
297
|
return m_node;
|
|
@@ -579,9 +579,11 @@ var layer = function (arg) {
|
|
|
579
579
|
* Update layer.
|
|
580
580
|
*
|
|
581
581
|
* This is a stub that should be subclassed.
|
|
582
|
+
*
|
|
583
|
+
* @param {object} [arg] An object, possibly with an ``event`` key and value.
|
|
582
584
|
* @returns {this}
|
|
583
585
|
*/
|
|
584
|
-
this._update = function () {
|
|
586
|
+
this._update = function (arg) {
|
|
585
587
|
return m_this;
|
|
586
588
|
};
|
|
587
589
|
|
package/src/map.js
CHANGED
|
@@ -517,7 +517,7 @@ var map = function (arg) {
|
|
|
517
517
|
* view center. Rotation mostly ignores `clampBoundsX`, as the behavior
|
|
518
518
|
* feels peculiar otherwise.
|
|
519
519
|
*
|
|
520
|
-
* @param {number} rotation Absolute angle in radians (positive is
|
|
520
|
+
* @param {number} [rotation] Absolute angle in radians (positive is
|
|
521
521
|
* clockwise).
|
|
522
522
|
* @param {object} [origin] If specified, rotate about this origin.
|
|
523
523
|
* @param {geo.geoPosition} origin.geo The gcs coordinates of the
|
|
@@ -830,7 +830,7 @@ var map = function (arg) {
|
|
|
830
830
|
* coordinate to convert.
|
|
831
831
|
* @param {string|geo.transform|null} [gcs] Output gcs. `undefined` to use
|
|
832
832
|
* the interface gcs, `null` to use the map gcs, or any other transform.
|
|
833
|
-
* @returns {geo.geoPosition|geoPosition[]} GCS space coordinates.
|
|
833
|
+
* @returns {geo.geoPosition|geo.geoPosition[]} GCS space coordinates.
|
|
834
834
|
*/
|
|
835
835
|
this.displayToGcs = function (c, gcs) {
|
|
836
836
|
c = m_this.displayToWorld(c); // done via camera
|
|
@@ -954,9 +954,10 @@ var map = function (arg) {
|
|
|
954
954
|
/**
|
|
955
955
|
* Initialize the map.
|
|
956
956
|
*
|
|
957
|
+
* @param {object} [arg] Optional arguments.
|
|
957
958
|
* @returns {this} The map object.
|
|
958
959
|
*/
|
|
959
|
-
this._init = function () {
|
|
960
|
+
this._init = function (arg) {
|
|
960
961
|
|
|
961
962
|
if (m_node === undefined || m_node === null) {
|
|
962
963
|
throw new Error('Map require DIV node');
|
|
@@ -1296,7 +1297,7 @@ var map = function (arg) {
|
|
|
1296
1297
|
y: p[1]
|
|
1297
1298
|
}, null, true, true);
|
|
1298
1299
|
} else {
|
|
1299
|
-
m_center = m_this.gcsToWorld({x: p[0], y: p[1]}, null
|
|
1300
|
+
m_center = m_this.gcsToWorld({x: p[0], y: p[1]}, null);
|
|
1300
1301
|
m_this.zoom(p[2], m_transition.zoomOrigin, true);
|
|
1301
1302
|
}
|
|
1302
1303
|
m_this.rotation(p[3], undefined, true);
|
|
@@ -1494,7 +1495,7 @@ var map = function (arg) {
|
|
|
1494
1495
|
* @param {number} rotation The requested rotation in clockwise radians.
|
|
1495
1496
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
1496
1497
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
1497
|
-
* @param {boolean} ignoreDiscreteZoom If `true`, ignore the `discreteZoom`
|
|
1498
|
+
* @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the `discreteZoom`
|
|
1498
1499
|
* option when determining the new view.
|
|
1499
1500
|
* @param {boolean} [ignoreClampBounds] If `true` and `clampBoundsX` or
|
|
1500
1501
|
* `clampBoundsY` is set, allow the bounds to be less clamped.
|
|
@@ -1728,11 +1729,11 @@ var map = function (arg) {
|
|
|
1728
1729
|
* @param {boolean|null} [opts.attribution=null] If `null` or unspecified,
|
|
1729
1730
|
* include the attribution only if all layers are used. If false, never
|
|
1730
1731
|
* include the attribution. If `true`, always include it.
|
|
1731
|
-
* @param {
|
|
1732
|
+
* @param {HTMLElement[]|string[]} [opts.html] A list of additional HTML
|
|
1732
1733
|
* elements, selectors, or jQuery elements to render on top of the map.
|
|
1733
1734
|
* These are rendered in order, with the last one topmost.
|
|
1734
|
-
* @returns {
|
|
1735
|
-
* either a data URL or an `HTMLCanvasElement` with the result.
|
|
1735
|
+
* @returns {jQueryDeferred} A jQuery Deferred object. The done function
|
|
1736
|
+
* receives either a data URL or an `HTMLCanvasElement` with the result.
|
|
1736
1737
|
* @fires geo.event.screenshot.ready
|
|
1737
1738
|
*/
|
|
1738
1739
|
this.screenshot = function (layers, type, encoderOptions, opts) {
|
|
@@ -1916,7 +1917,7 @@ var map = function (arg) {
|
|
|
1916
1917
|
/**
|
|
1917
1918
|
* Return the nearest valid zoom level to the requested zoom.
|
|
1918
1919
|
* @param {number} zoom A zoom level to adjust to current settings
|
|
1919
|
-
* @param {boolean} ignoreDiscreteZoom If `true`, ignore the `discreteZoom`
|
|
1920
|
+
* @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the `discreteZoom`
|
|
1920
1921
|
* option when determining the new view.
|
|
1921
1922
|
* @returns {number} The zoom level clamped to the allowed zoom range and
|
|
1922
1923
|
* with other settings applied.
|
|
@@ -1960,10 +1961,11 @@ var map = function (arg) {
|
|
|
1960
1961
|
* Draw a layer image to a canvas context. The layer's opacity and transform
|
|
1961
1962
|
* are applied. This is used as part of making a screenshot.
|
|
1962
1963
|
*
|
|
1963
|
-
* @param {
|
|
1964
|
+
* @param {CanvasRenderingContext2D} context The 2d canvas context to draw
|
|
1965
|
+
* into.
|
|
1964
1966
|
* @param {number} opacity The opacity in the range [0, 1].
|
|
1965
1967
|
* @param {object} elem A jQuery element that might have a transform.
|
|
1966
|
-
* @param {
|
|
1968
|
+
* @param {HTMLImageElement} img The image or canvas to draw to the canvas.
|
|
1967
1969
|
* @param {string} [mixBlendMode] the mix-blend-mode used to add this layer.
|
|
1968
1970
|
* @private
|
|
1969
1971
|
*/
|
|
@@ -2155,12 +2157,12 @@ var map = function (arg) {
|
|
|
2155
2157
|
* Return a valid rotation angle.
|
|
2156
2158
|
*
|
|
2157
2159
|
* @param {number} rotation Proposed rotation.
|
|
2158
|
-
* @param {boolean} ignoreRotationFunc If truthy and rotations are allowed,
|
|
2160
|
+
* @param {boolean} [ignoreRotationFunc] If truthy and rotations are allowed,
|
|
2159
2161
|
* allow any rotation. Otherwise, the rotation is passed through the
|
|
2160
2162
|
* `allowRotation` function.
|
|
2161
|
-
* @param {boolean} noRangeLimit If falsy, ensure that the rotation is in
|
|
2162
|
-
* range [0, 2*PI). If it is very close to zero, it is snapped to
|
|
2163
|
-
* If true, the rotation can have any value.
|
|
2163
|
+
* @param {boolean} [noRangeLimit] If falsy, ensure that the rotation is in
|
|
2164
|
+
* the range [0, 2*PI). If it is very close to zero, it is snapped to
|
|
2165
|
+
* zero. If true, the rotation can have any value.
|
|
2164
2166
|
* @returns {number} the validated rotation
|
|
2165
2167
|
* @private
|
|
2166
2168
|
*/
|
package/src/mapInteractor.js
CHANGED
|
@@ -2037,26 +2037,26 @@ var mapInteractor = function (args) {
|
|
|
2037
2037
|
* map in pixels relative to the map's div.
|
|
2038
2038
|
* @param {geo.screenPosition} [options.center] The position of a touch
|
|
2039
2039
|
* event center relative to the window.
|
|
2040
|
-
* @param {string} [button] One of `left`, `middle`, or `right` for
|
|
2041
|
-
* events.
|
|
2042
|
-
* @param {string} [modifiers] A space-separated list of metakeys
|
|
2043
|
-
* down on mouse events.
|
|
2044
|
-
* @param {geo.screenPosition} [wheelDelta] The amount the wheel
|
|
2045
|
-
* both directions for wheel events. One step is often 20 units
|
|
2046
|
-
*
|
|
2047
|
-
* @param {number} [wheelMode] The wheel delta mode. See
|
|
2040
|
+
* @param {string} [options.button] One of `left`, `middle`, or `right` for
|
|
2041
|
+
* mouse events.
|
|
2042
|
+
* @param {string} [options.modifiers] A space-separated list of metakeys
|
|
2043
|
+
* that are down on mouse events.
|
|
2044
|
+
* @param {geo.screenPosition} [options.wheelDelta] The amount the wheel
|
|
2045
|
+
* moved in both directions for wheel events. One step is often 20 units
|
|
2046
|
+
* of movement.
|
|
2047
|
+
* @param {number} [options.wheelMode] The wheel delta mode. See
|
|
2048
2048
|
* https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent .
|
|
2049
|
-
* @param {boolean} [touch] `truthy` if this is a touch event.
|
|
2050
|
-
* @param {number} [rotation] Touch event rotation in degrees.
|
|
2051
|
-
* @param {number} [scale] Touch event scale. Initial events should
|
|
2052
|
-
* scale of 1; subsequent events should increase or decrease this
|
|
2053
|
-
* simulate spread and pinch actions.
|
|
2054
|
-
* @param {number[]} [pointers] A list of pointer numbers involved in
|
|
2055
|
-
* touch event. Pointers are number from one up, so `[1]` is the first
|
|
2049
|
+
* @param {boolean} [options.touch] `truthy` if this is a touch event.
|
|
2050
|
+
* @param {number} [options.rotation] Touch event rotation in degrees.
|
|
2051
|
+
* @param {number} [options.scale] Touch event scale. Initial events should
|
|
2052
|
+
* have a scale of 1; subsequent events should increase or decrease this
|
|
2053
|
+
* to simulate spread and pinch actions.
|
|
2054
|
+
* @param {number[]} [options.pointers] A list of pointer numbers involved in
|
|
2055
|
+
* a touch event. Pointers are number from one up, so `[1]` is the first
|
|
2056
2056
|
* touch point, `[1, 2]` are two touch points, and `[2]` is when the first
|
|
2057
2057
|
* point was released but the second is still touching.
|
|
2058
|
-
* @param {string} [pointerType] `mouse` if this is a mouse action
|
|
2059
|
-
* than a touch action.
|
|
2058
|
+
* @param {string} [options.pointerType] `mouse` if this is a mouse action
|
|
2059
|
+
* rather than a touch action.
|
|
2060
2060
|
* @returns {mapInteractor}
|
|
2061
2061
|
*/
|
|
2062
2062
|
this.simulateEvent = function (type, options) {
|
package/src/markerFeature.js
CHANGED
|
@@ -442,7 +442,7 @@ markerFeature.primitiveShapes = pointFeature.primitiveShapes;
|
|
|
442
442
|
|
|
443
443
|
/**
|
|
444
444
|
* Marker symbols
|
|
445
|
-
* @enum
|
|
445
|
+
* @enum {number}
|
|
446
446
|
*/
|
|
447
447
|
markerFeature.symbols = {
|
|
448
448
|
// for circle (alias ellipse), the symbolValue is the ratio of the minor to
|
|
@@ -499,7 +499,7 @@ markerFeature.symbols = {
|
|
|
499
499
|
|
|
500
500
|
/**
|
|
501
501
|
* Marker scale modes
|
|
502
|
-
* @enum
|
|
502
|
+
* @enum {number}
|
|
503
503
|
*/
|
|
504
504
|
markerFeature.scaleMode = {
|
|
505
505
|
none: 0,
|
package/src/meshFeature.js
CHANGED
|
@@ -21,7 +21,7 @@ var feature = require('./feature');
|
|
|
21
21
|
* of these properties can be functions, which get passed `data`.
|
|
22
22
|
*
|
|
23
23
|
* @typedef {object} geo.meshFeature.meshSpec
|
|
24
|
-
* @property {number[]|
|
|
24
|
+
* @property {number[]|Array.<number[]>} [elements] If specified, a list of
|
|
25
25
|
* indices into the data array that form elements. If this is an array of
|
|
26
26
|
* arrays, each subarray must have at least either 3 values for triangular
|
|
27
27
|
* elements or 4 values for square elements. If this is a single array,
|
package/src/osmLayer.js
CHANGED
|
@@ -13,6 +13,8 @@ var quadFeature = require('./quadFeature');
|
|
|
13
13
|
* specified, use this as the layer opacity.
|
|
14
14
|
* @property {string} [source] If specified, use the predefined tile source
|
|
15
15
|
* (see {@link geo.osmLayer.tileSources}).
|
|
16
|
+
* @property {string} [crossDomain='anonymous'] Image CORS attribute. This is
|
|
17
|
+
* used for the `crossorigin` property when loading images.
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
20
|
/**
|
package/src/pointFeature.js
CHANGED
package/src/registry.js
CHANGED
|
@@ -60,7 +60,7 @@ util.registerRenderer = function (name, func) {
|
|
|
60
60
|
* @param {geo.layer} layer The layer associated with the renderer.
|
|
61
61
|
* @param {HTMLCanvasElement} [canvas] A canvas object to share between
|
|
62
62
|
* renderers.
|
|
63
|
-
* @param {object} options Options for the new renderer.
|
|
63
|
+
* @param {object} [options] Options for the new renderer.
|
|
64
64
|
* @returns {geo.renderer|null} The new renderer or null if no such name is
|
|
65
65
|
* registered.
|
|
66
66
|
*/
|
|
@@ -83,7 +83,7 @@ util.createRenderer = function (name, layer, canvas, options) {
|
|
|
83
83
|
*
|
|
84
84
|
* @alias geo.checkRenderer
|
|
85
85
|
* @param {string|null} name Name of the desired renderer.
|
|
86
|
-
* @param {boolean} noFallback If truthy, don't recommend a fallback.
|
|
86
|
+
* @param {boolean} [noFallback] If truthy, don't recommend a fallback.
|
|
87
87
|
* @returns {string|null|false} The name of the renderer that should be used
|
|
88
88
|
* or false if no valid renderer can be determined.
|
|
89
89
|
*/
|
package/src/svg/svgRenderer.js
CHANGED
|
@@ -484,10 +484,10 @@ var svgRenderer = function (arg) {
|
|
|
484
484
|
* Create a new feature element from an object that describes the feature
|
|
485
485
|
* attributes. To be called from feature classes only.
|
|
486
486
|
*
|
|
487
|
-
* @param {object} arg
|
|
487
|
+
* @param {object} arg
|
|
488
488
|
* @param {string} arg.id A unique string identifying the feature.
|
|
489
489
|
* @param {array} arg.data Array of data objects used in a d3 data method.
|
|
490
|
-
* @param {function} [
|
|
490
|
+
* @param {function} [arg.dataIndex] A function that returns a unique id for
|
|
491
491
|
* each data element. This is passed to the data access function.
|
|
492
492
|
* @param {object} arg.style An object with style values or functions.
|
|
493
493
|
* @param {object} arg.attributes An object containing element attributes.
|
|
@@ -500,7 +500,7 @@ var svgRenderer = function (arg) {
|
|
|
500
500
|
* attributes and styles set when new. If falsy, features always have
|
|
501
501
|
* attributes and styles updated.
|
|
502
502
|
* @param {boolean} [arg.sortByZ] If truthy, sort features by the `d.zIndex`.
|
|
503
|
-
* @param {string} [parentId] If set, the group ID of the parent element.
|
|
503
|
+
* @param {string} [arg.parentId] If set, the group ID of the parent element.
|
|
504
504
|
* @returns {this}
|
|
505
505
|
*/
|
|
506
506
|
this._drawFeatures = function (arg) {
|
package/src/tileCache.js
CHANGED
|
@@ -55,7 +55,7 @@ var tileCache = function (options) {
|
|
|
55
55
|
* Remove a tile from the cache.
|
|
56
56
|
*
|
|
57
57
|
* @param {string|geo.tile} tile The tile or its hash.
|
|
58
|
-
* @returns {
|
|
58
|
+
* @returns {boolean} `true` if a tile was removed.
|
|
59
59
|
*/
|
|
60
60
|
this.remove = function (tile) {
|
|
61
61
|
var hash = typeof tile === 'string' ? tile : tile.toString();
|
package/src/tileLayer.js
CHANGED
|
@@ -525,7 +525,7 @@ var tileLayer = function (arg) {
|
|
|
525
525
|
/**
|
|
526
526
|
* Returns a tile's bounds in a gcs.
|
|
527
527
|
*
|
|
528
|
-
* @param {object|tile} indexOrTile Either a tile or an object with
|
|
528
|
+
* @param {object|geo.tile} indexOrTile Either a tile or an object with
|
|
529
529
|
* {x, y, level}` specifying a tile.
|
|
530
530
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the
|
|
531
531
|
* interface gcs, `null` to use the map gcs, or any other transform.
|
|
@@ -668,7 +668,7 @@ var tileLayer = function (arg) {
|
|
|
668
668
|
* @param {number} maxLevel The zoom level
|
|
669
669
|
* @param {geo.geoBounds} bounds The map bounds
|
|
670
670
|
* @param {boolean} sorted Return a sorted list
|
|
671
|
-
* @param {boolean} onlyIfChanged If the set of tiles have not changed
|
|
671
|
+
* @param {boolean} [onlyIfChanged] If the set of tiles have not changed
|
|
672
672
|
* (even if their desired order has), return undefined instead of an
|
|
673
673
|
* array of tiles.
|
|
674
674
|
* @returns {geo.tile[]} An array of tile objects
|
|
@@ -1134,7 +1134,7 @@ var tileLayer = function (arg) {
|
|
|
1134
1134
|
* origin.
|
|
1135
1135
|
*
|
|
1136
1136
|
* @param {object} pt A point in world space coordinates with `x` and `y`.
|
|
1137
|
-
* @param {number
|
|
1137
|
+
* @param {number} [zoom] If unspecified, use the map zoom.
|
|
1138
1138
|
* @returns {object} Local coordinates with `x` and `y`.
|
|
1139
1139
|
*/
|
|
1140
1140
|
this.toLocal = function (pt, zoom) {
|
|
@@ -1180,7 +1180,7 @@ var tileLayer = function (arg) {
|
|
|
1180
1180
|
* create the element if it doesn't already exist.
|
|
1181
1181
|
*
|
|
1182
1182
|
* @param {number} level The zoom level of the layer to fetch.
|
|
1183
|
-
* @returns {
|
|
1183
|
+
* @returns {HTMLElement} The layer's DOM element.
|
|
1184
1184
|
*/
|
|
1185
1185
|
this._getSubLayer = function (level) {
|
|
1186
1186
|
if (!m_this.canvas()) {
|
|
@@ -1512,8 +1512,8 @@ var tileLayer = function (arg) {
|
|
|
1512
1512
|
* @param {geo.geoBounds} [bounds] The view bounds (if unspecified, assume
|
|
1513
1513
|
* global bounds)
|
|
1514
1514
|
* @param {number} bounds.level The zoom level the bounds are given as.
|
|
1515
|
-
* @param {number} zoom Keep in bound tile at this zoom level.
|
|
1516
|
-
* @param {boolean} doneLoading If true, allow purging additional tiles.
|
|
1515
|
+
* @param {number} [zoom] Keep in bound tile at this zoom level.
|
|
1516
|
+
* @param {boolean} [doneLoading] If true, allow purging additional tiles.
|
|
1517
1517
|
* @returns {boolean}
|
|
1518
1518
|
*/
|
|
1519
1519
|
this._canPurge = function (tile, bounds, zoom, doneLoading) {
|
|
@@ -1604,9 +1604,9 @@ var tileLayer = function (arg) {
|
|
|
1604
1604
|
/**
|
|
1605
1605
|
* Get or set the subdomains used for templating.
|
|
1606
1606
|
*
|
|
1607
|
-
* @param {string|
|
|
1607
|
+
* @param {string|string[]} [subdomains] A comma-separated list, a string of
|
|
1608
1608
|
* single character subdomains, or a list.
|
|
1609
|
-
* @returns {string|
|
|
1609
|
+
* @returns {string|string[]|this}
|
|
1610
1610
|
*/
|
|
1611
1611
|
this.subdomains = function (subdomains) {
|
|
1612
1612
|
if (subdomains === undefined) {
|
|
@@ -1644,8 +1644,8 @@ var tileLayer = function (arg) {
|
|
|
1644
1644
|
/**
|
|
1645
1645
|
* Get/Set visibility of the layer.
|
|
1646
1646
|
*
|
|
1647
|
-
* @param {boolean
|
|
1648
|
-
*
|
|
1647
|
+
* @param {boolean} [val] If unspecified, return the visibility, otherwise
|
|
1648
|
+
* set it.
|
|
1649
1649
|
* @returns {boolean|this} Either the visibility (if getting) or the layer
|
|
1650
1650
|
* (if setting).
|
|
1651
1651
|
*/
|