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.
Files changed (55) hide show
  1. package/eslint.config.js +129 -0
  2. package/geo.js +93357 -93344
  3. package/geo.lean.js +64567 -64554
  4. package/geo.lean.min.js +4 -4
  5. package/geo.min.js +11 -11
  6. package/package.json +12 -10
  7. package/src/annotation/annotation.js +13 -11
  8. package/src/annotation/circleAnnotation.js +1 -1
  9. package/src/annotation/ellipseAnnotation.js +1 -1
  10. package/src/annotation/lineAnnotation.js +18 -16
  11. package/src/annotation/pointAnnotation.js +8 -8
  12. package/src/annotation/polygonAnnotation.js +12 -11
  13. package/src/annotation/rectangleAnnotation.js +19 -17
  14. package/src/annotation/squareAnnotation.js +1 -1
  15. package/src/annotationLayer.js +2 -2
  16. package/src/camera.js +22 -22
  17. package/src/canvas/canvasRenderer.js +1 -1
  18. package/src/canvas/pixelmapFeature.js +3 -3
  19. package/src/feature.js +4 -3
  20. package/src/heatmapFeature.js +1 -0
  21. package/src/isolineFeature.js +1 -1
  22. package/src/layer.js +2 -2
  23. package/src/lineFeature.js +3 -3
  24. package/src/map.js +21 -21
  25. package/src/mapInteractor.js +3 -2
  26. package/src/markerFeature.js +1 -1
  27. package/src/pixelmapFeature.js +2 -1
  28. package/src/pointFeature.js +15 -12
  29. package/src/polygonFeature.js +10 -10
  30. package/src/registry.js +2 -2
  31. package/src/svg/svgRenderer.js +2 -2
  32. package/src/tile.js +2 -2
  33. package/src/tileCache.js +1 -1
  34. package/src/tileLayer.js +7 -6
  35. package/src/trackFeature.js +2 -2
  36. package/src/transform.js +5 -5
  37. package/src/ui/colorLegendWidget.js +2 -2
  38. package/src/ui/domWidget.js +1 -1
  39. package/src/ui/scaleWidget.js +11 -11
  40. package/src/ui/widget.js +1 -2
  41. package/src/util/color.js +4 -3
  42. package/src/util/common.js +16 -13
  43. package/src/util/distanceGrid.js +1 -2
  44. package/src/util/mockVGL.js +1 -3
  45. package/src/util/polyops.js +1 -1
  46. package/src/util/throttle.js +2 -2
  47. package/src/vgl/boundingObject.js +1 -1
  48. package/src/vgl/groupNode.js +1 -0
  49. package/src/vgl/material.js +1 -1
  50. package/src/vgl/object.js +1 -1
  51. package/src/webgl/layer.js +1 -1
  52. package/src/webgl/markerFeature.js +1 -1
  53. package/src/webgl/pointFeature.js +1 -1
  54. package/src/webgl/quadFeature.js +2 -2
  55. package/src/webgl/webglRenderer.js +1 -1
package/src/feature.js CHANGED
@@ -45,6 +45,7 @@ var geo_event = require('./event');
45
45
  * Style specification for a feature.
46
46
  *
47
47
  * @typedef {object} geo.feature.styleSpec
48
+ * @property {object} The styyle.
48
49
  */
49
50
 
50
51
  /**
@@ -205,7 +206,7 @@ var feature = function (arg) {
205
206
  * @param {geo.geoPosition} lowerLeft Lower-left corner.
206
207
  * @param {geo.geoPosition} upperRight Upper-right corner.
207
208
  * @param {object} [opts] Additional search options.
208
- * @param {boolean} [opts.partial=false] If truthy, include features that are
209
+ * @param {boolean} [opts.partial] If truthy, include features that are
209
210
  * partially in the box, otherwise only include features that are fully
210
211
  * within the region.
211
212
  * @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
@@ -226,7 +227,7 @@ var feature = function (arg) {
226
227
  * @param {geo.polygonObject} poly A polygon as an array of coordinates or an
227
228
  * object with `outer` and optionally `inner` parameters.
228
229
  * @param {object} [opts] Additional search options.
229
- * @param {boolean} [opts.partial=false] If truthy, include features that are
230
+ * @param {boolean} [opts.partial] If truthy, include features that are
230
231
  * partially in the polygon, otherwise only include features that are
231
232
  * fully within the region.
232
233
  * @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
@@ -608,7 +609,7 @@ var feature = function (arg) {
608
609
  * each arrays.
609
610
  * @param {array} styleArray If keyOrObject is a string, an array of values
610
611
  * for the style. If keyOrObject is an object, this parameter is ignored.
611
- * @param {boolean} [refresh=false] `true` to redraw the feature when it has
612
+ * @param {boolean} [refresh] `true` to redraw the feature when it has
612
613
  * been updated. If an object with styles is passed, the redraw is only
613
614
  * done once.
614
615
  * @returns {this} The feature instance.
@@ -29,6 +29,7 @@ var util = require('./util');
29
29
  * datapoint stands on its own. If `'auto'`, bin data if there are more data
30
30
  * points than there would be bins. Using `true` or `auto` uses bins that
31
31
  * are `max(Math.floor((radius + blurRadius) / 8), 3)`.
32
+ * @property {object} [style] A style for the heatmap.
32
33
  * @property {object} [style.color] An object where the keys are numbers from
33
34
  * [0-1] and the values are {@link geo.geoColor}. This is used to transform
34
35
  * normalized intensity.
@@ -860,7 +860,7 @@ var isolineFeature = function (arg) {
860
860
  * The results of this are intended to be used as the value of the `rotation`
861
861
  * style.
862
862
  *
863
- * @param {string} [mode='higher'] The rotation mode. `higher` orients the top
863
+ * @param {string} [mode] The rotation mode. `higher` orients the top
864
864
  * of the text to high values. `lower` orients the top of the text to lower
865
865
  * values. `map` orients the top of the text so it is aligned to the isoline
866
866
  * and biased toward the top of the map. `screen` orients the top of the
package/src/layer.js CHANGED
@@ -185,7 +185,7 @@ var layer = function (arg) {
185
185
  * Bring the layer above the given number of layers. This will rotate the
186
186
  * current z-indices for this and the next `n` layers.
187
187
  *
188
- * @param {number} [n=1] The number of positions to move.
188
+ * @param {number} [n] The number of positions to move.
189
189
  * @returns {this}
190
190
  */
191
191
  this.moveUp = function (n) {
@@ -232,7 +232,7 @@ var layer = function (arg) {
232
232
  * Bring the layer below the given number of layers. This will rotate the
233
233
  * current z-indices for this and the previous `n` layers.
234
234
  *
235
- * @param {number} [n=1] The number of positions to move.
235
+ * @param {number} [n] The number of positions to move.
236
236
  * @returns {this}
237
237
  */
238
238
  this.moveDown = function (n) {
@@ -289,7 +289,7 @@ var lineFeature = function (arg) {
289
289
  * @param {geo.polygonObject} poly A polygon as an array of coordinates or an
290
290
  * object with `outer` and optionally `inner` parameters.
291
291
  * @param {object} [opts] Additional search options.
292
- * @param {boolean} [opts.partial=false] If truthy, include lines that are
292
+ * @param {boolean} [opts.partial] If truthy, include lines that are
293
293
  * partially in the polygon, otherwise only include lines that are fully
294
294
  * within the region.
295
295
  * @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
@@ -418,9 +418,9 @@ var lineFeature = function (arg) {
418
418
  * units. A value of zero will only remove perfectly collinear points.
419
419
  * If not specified, this is set to a half display pixel at the map's
420
420
  * current zoom level.
421
- * @param {function} [posFunc=this.style.get('position')] The function to
421
+ * @param {function} [posFunc] The function to
422
422
  * get the position of each vertex.
423
- * @param {function} [lineFunc=this.style.get('line')] The function to get
423
+ * @param {function} [lineFunc] The function to get
424
424
  * each line.
425
425
  * @returns {this}
426
426
  */
package/src/map.js CHANGED
@@ -28,8 +28,8 @@ var sceneObject = require('./sceneObject');
28
28
  * bounds.
29
29
  * @property {number} [zoom=4] Initial zoom.
30
30
  * @property {object} [center] Initial map center.
31
- * @property {number} center.x=0
32
- * @property {number} center.y=0
31
+ * @property {number} [center.x=0] Initial map center.
32
+ * @property {number} [center.y=0] Initial map center.
33
33
  * @property {number} [rotation=0] Initial clockwise rotation in radians.
34
34
  * @property {number} [width] The map width (default node width).
35
35
  * @property {number} [height] The map height (default node height).
@@ -176,7 +176,7 @@ var map = function (arg) {
176
176
  * Get/set the number of world space units per display pixel at the given
177
177
  * zoom level.
178
178
  *
179
- * @param {number} [zoom=0] The target zoom level.
179
+ * @param {number} [zoom] The target zoom level.
180
180
  * @param {number?} [unit] If present, set the `unitsPerPixel` at the
181
181
  * specified zoom level. Otherwise return the current value.
182
182
  * @returns {number|this}
@@ -214,7 +214,7 @@ var map = function (arg) {
214
214
  * existing requestAnimationFrame. By using a property of window,
215
215
  * tests can override this if needed. */
216
216
  if (queue.length && queue[0] !== m_animationQueue[0]) {
217
- window['cancelAnimationFrame'](m_animationQueue[0]); // eslint-disable-line dot-notation
217
+ window['cancelAnimationFrame'](m_animationQueue[0]);
218
218
  }
219
219
  for (var i = queue.length ? 1 : 0; i < m_animationQueue.length; i += 1) {
220
220
  queue.push(m_animationQueue[i]);
@@ -1127,7 +1127,7 @@ var map = function (arg) {
1127
1127
  * @param {geo.geoPosition} [opts.zoomOrigin] An origin to use when zooming
1128
1128
  * to a new zoom level.
1129
1129
  * @param {number} [opts.rotation] A new map rotation.
1130
- * @param {number} [opts.duration=1000] Transition duration in milliseconds.
1130
+ * @param {number} [opts.duration] Transition duration in milliseconds.
1131
1131
  * @param {function} [opts.ease] Easing function for the transition. This is
1132
1132
  * in the style of a d3 easing function.
1133
1133
  * @param {function} [opts.interp] Function to use when interpolating
@@ -1143,7 +1143,7 @@ var map = function (arg) {
1143
1143
  * a value based on what canceled a transition, `transition`: the current
1144
1144
  * transition that just completed, `next`: a boolean if another transition
1145
1145
  * follows immediately.
1146
- * @param {boolean} [opts.endClamp=true] If `false`, the last center change
1146
+ * @param {boolean} [opts.endClamp] If `false`, the last center change
1147
1147
  * will not clamp to the bounds and zoom values.
1148
1148
  * @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
1149
1149
  * the interface gcs, `null` to use the map gcs, or any other transform.
@@ -1726,8 +1726,8 @@ var map = function (arg) {
1726
1726
  * attribution notices into a single element. By default, this method
1727
1727
  * is called on each of the following events:
1728
1728
  *
1729
- * * {@link geo.event.layerAdd}
1730
- * * {@link geo.event.layerRemove}
1729
+ * {@link geo.event.layerAdd}
1730
+ * {@link geo.event.layerRemove}
1731
1731
  *
1732
1732
  * In addition, layers should call this method when their own attribution
1733
1733
  * notices have changed. Users, in general, should not need to call this.
@@ -1776,23 +1776,23 @@ var map = function (arg) {
1776
1776
  * optional values of `layers`, `type`, `encoderOptions`, and additional
1777
1777
  * values listed in the `opts` parameter (this last form allows a single
1778
1778
  * argument for the function).
1779
- * @param {string} [type='image/png'] See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
1779
+ * @param {string} [type] See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
1780
1780
  * canvas.toDataURL}. Use `'canvas'` to return the canvas element (this
1781
1781
  * can be used to get the results as a blob, which can be faster for some
1782
1782
  * operations but is not supported as widely).
1783
1783
  * @param {number} [encoderOptions] See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
1784
1784
  * canvas.toDataURL}.
1785
1785
  * @param {object} [opts] Additional screenshot options.
1786
- * @param {false|string|CanvasRenderingContext2D.fillStyle}
1787
- * [opts.background='white'] If `false` or `null`, don't prefill the
1788
- * background. Otherwise, a css color or
1789
- * `CanvasRenderingContext2D.fillStyle` to fill the initial canvas. This
1790
- * could match the background of the browser page, for instance.
1791
- * @param {boolean|'idle'} [opts.wait=false] If `'idle'`, wait for the map to
1786
+ * @param {false|string|CanvasRenderingContext2D.fillStyle} [opts.background]
1787
+ * If `false` or `null`, don't prefill the background. Otherwise, a css
1788
+ * color or `CanvasRenderingContext2D.fillStyle` to fill the initial
1789
+ * canvas. This could match the background of the browser page, for
1790
+ * instance. Default is 'white'.
1791
+ * @param {boolean|'idle'} [opts.wait] If `'idle'`, wait for the map to
1792
1792
  * be idle and one additional animation frame to occur. If truthy, wait
1793
1793
  * for an animation frame to occur. Otherwise, take the screenshot as
1794
1794
  * soon as possible.
1795
- * @param {boolean|null} [opts.attribution=null] If `null` or unspecified,
1795
+ * @param {boolean|null} [opts.attribution] If `null` or unspecified,
1796
1796
  * include the attribution only if all layers are used. If false, never
1797
1797
  * include the attribution. If `true`, always include it.
1798
1798
  * @param {HTMLElement[]|string[]} [opts.html] A list of additional HTML
@@ -1951,11 +1951,11 @@ var map = function (arg) {
1951
1951
  * @param {function} callback Function to call during the animation frame.
1952
1952
  * It is called with an animation epoch, exactly as
1953
1953
  * `requestAnimationFrame`.
1954
- * @param {boolean|'remove'} [action=false] Falsy to only add the callback if
1954
+ * @param {boolean|'remove'} [action] Falsy to only add the callback if
1955
1955
  * it is not already scheduled. `'remove'` to remove the callback (use
1956
1956
  * this instead of `cancelAnimationFrame`). Any other truthy value moves
1957
1957
  * the callback to the end of the list.
1958
- * @returns {number} An integer as returned by
1958
+ * @returns {number?} An integer as returned by
1959
1959
  * `window.requestAnimationFrame`.
1960
1960
  */
1961
1961
  this.scheduleAnimationFrame = function (callback, action) {
@@ -1964,16 +1964,16 @@ var map = function (arg) {
1964
1964
  * explicitly using window.requestAnimationFrame, we prevent the
1965
1965
  * stripping of 'window' off of the reference and allow our tests to
1966
1966
  * override this if needed. */
1967
- m_animationQueue.push(window['requestAnimationFrame'](processAnimationFrame)); // eslint-disable-line dot-notation
1967
+ m_animationQueue.push(window['requestAnimationFrame'](processAnimationFrame));
1968
1968
  }
1969
1969
  var pos = m_animationQueue.indexOf(callback, 1);
1970
1970
  if (pos >= 0) {
1971
1971
  if (!action) {
1972
- return;
1972
+ return undefined;
1973
1973
  }
1974
1974
  m_animationQueue.splice(pos, 1);
1975
1975
  if (action === 'remove') {
1976
- return;
1976
+ return undefined;
1977
1977
  }
1978
1978
  }
1979
1979
  m_animationQueue.push(callback);
@@ -40,7 +40,7 @@ var Mousetrap = require('mousetrap');
40
40
  * up for that scale action to trigger. If the value of the meta key is
41
41
  * truthy, it must be down. If `false`, it must be up.
42
42
  * @property {string[]} [keyboard.metakeyMouseEvents] A list of meta keys
43
- * * that, when typed singly, trigger a repeat of the last mousemove or
43
+ * that, when typed singly, trigger a repeat of the last mousemove or
44
44
  * actionmove event so that listeners can update metakey information.
45
45
  * @property {boolean} [keyboard.focusHighlight=true] If truthy, when the map
46
46
  * gains focus, a highlight style is shown around it. This gives an
@@ -2176,7 +2176,7 @@ var mapInteractor = function (args) {
2176
2176
  simulated: true
2177
2177
  };
2178
2178
  m_keyHandler.trigger(keys, options.event);
2179
- return;
2179
+ return m_this;
2180
2180
  }
2181
2181
 
2182
2182
  page = options.page || {};
@@ -2236,6 +2236,7 @@ var mapInteractor = function (args) {
2236
2236
  if (type.indexOf('.geojs') >= 0) {
2237
2237
  $(document).trigger(evt);
2238
2238
  }
2239
+ return m_this;
2239
2240
  };
2240
2241
  this._connectEvents();
2241
2242
  return this;
@@ -280,7 +280,7 @@ var markerFeature = function (arg) {
280
280
  * @param {geo.polygonObject} poly A polygon as an array of coordinates or an
281
281
  * object with `outer` and optionally `inner` parameters.
282
282
  * @param {object} [opts] Additional search options.
283
- * @param {boolean} [opts.partial=false] If truthy, include markers that are
283
+ * @param {boolean} [opts.partial] If truthy, include markers that are
284
284
  * partially in the polygon, otherwise only include markers that are fully
285
285
  * within the region. If 'center', only markers whose centers are inside
286
286
  * the polygon are returned.
@@ -172,7 +172,7 @@ var pixelmapFeature = function (arg) {
172
172
  * Get the maximum index value from the pixelmap. This is a value present in
173
173
  * the pixelmap.
174
174
  *
175
- * @returns {number} The maximum index value.
175
+ * @returns {number?} The maximum index value.
176
176
  */
177
177
  this.maxIndex = function () {
178
178
  if (m_this.m_info) {
@@ -188,6 +188,7 @@ var pixelmapFeature = function (arg) {
188
188
  }
189
189
  return m_this.m_info.maxIndex;
190
190
  }
191
+ return undefined;
191
192
  };
192
193
 
193
194
  /**
@@ -185,23 +185,26 @@ var pointFeature = function (arg) {
185
185
  // store the current zoom level privately
186
186
  m_lastZoom = z;
187
187
 
188
- // get the raw data elements for the points at the current level
189
- var data = m_clusterTree.points(z).map(function (d) {
190
- return m_allData[d.index];
191
- });
188
+ const points = m_clusterTree.points(z);
189
+ const clusters = m_clusterTree.clusters(z);
190
+ const data = new Array(points.length + clusters.length);
191
+ for (let pidx = 0; pidx < points.length; pidx += 1) {
192
+ data[pidx] = m_allData[points[pidx].index];
193
+ }
192
194
 
193
195
  // append the clusters at the current level
194
- m_clusterTree.clusters(z).forEach(function (d) {
196
+ for (let cidx = 0, didx = points.length; cidx < clusters.length; cidx += 1, didx += 1) {
197
+ const d = clusters[cidx];
195
198
  // mark the datum as a cluster for accessor methods
196
199
  d.__cluster = true;
197
200
 
198
201
  // store all of the data objects for each point in the cluster as __data
199
- d.__data = [];
200
- d.obj.each(function (e) {
201
- d.__data.push(m_allData[e.index]);
202
- });
203
- data.push(d);
204
- });
202
+ d.__data = new Array(d.obj.length);
203
+ for (let idx = 0; idx < d.obj.length; idx += 1) {
204
+ d.__data[idx] = m_allData[d.obj[idx].index];
205
+ }
206
+ data[didx] = d;
207
+ }
205
208
 
206
209
  // prevent recomputing the clustering and set the new data array
207
210
  m_ignoreData = true;
@@ -366,7 +369,7 @@ var pointFeature = function (arg) {
366
369
  * @param {geo.polygonObject} poly A polygon as an array of coordinates or an
367
370
  * object with `outer` and optionally `inner` parameters.
368
371
  * @param {object} [opts] Additional search options.
369
- * @param {boolean} [opts.partial=false] If truthy, include points that are
372
+ * @param {boolean} [opts.partial] If truthy, include points that are
370
373
  * partially in the polygon, otherwise only include points that are fully
371
374
  * within the region. If 'center', only points whose centers are inside
372
375
  * the polygon are returned.
@@ -103,10 +103,10 @@ var polygonFeature = function (arg) {
103
103
  * in the polygon.
104
104
  *
105
105
  * @private
106
- * @param {object[]} [data=this.data()] The data to process.
107
- * @param {function} [posFunc=this.style.get('position')] The function to
106
+ * @param {object[]} [data] The data to process.
107
+ * @param {function} [posFunc] The function to
108
108
  * get the position of each vertex.
109
- * @param {function} [polyFunc=this.style.get('polygon')] The function to
109
+ * @param {function} [polyFunc] The function to
110
110
  * get each polygon.
111
111
  * @returns {geo.polygonObject[]} An array of polygon positions. Each has
112
112
  * `outer` and `inner` if it has any coordinates, or is `undefined`.
@@ -302,7 +302,7 @@ var polygonFeature = function (arg) {
302
302
  * @param {geo.polygonObject} poly A polygon as an array of coordinates or an
303
303
  * object with `outer` and optionally `inner` parameters.
304
304
  * @param {object} [opts] Additional search options.
305
- * @param {boolean} [opts.partial=false] If truthy, include polygons that are
305
+ * @param {boolean} [opts.partial] If truthy, include polygons that are
306
306
  * partially in the polygon, otherwise only include polygons that are fully
307
307
  * within the region.
308
308
  * @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
@@ -434,9 +434,9 @@ var polygonFeature = function (arg) {
434
434
  * Get an outer or inner loop of a polygon and return the necessary data to
435
435
  * use it for a closed polyline.
436
436
  *
437
- * @param {object} item: the polygon.
438
- * @param {number} itemIndex: the index of the polygon
439
- * @param {Array} loop: the inner or outer loop.
437
+ * @param {object} item the polygon.
438
+ * @param {number} itemIndex the index of the polygon
439
+ * @param {Array} loop the inner or outer loop.
440
440
  * @returns {Array} the loop with the data necessary to send to the position
441
441
  * function for each vertex.
442
442
  */
@@ -568,11 +568,11 @@ var polygonFeature = function (arg) {
568
568
  * units. A value of zero will only remove perfectly collinear points.
569
569
  * If not specified, this is set to a half display pixel at the map's
570
570
  * current zoom level.
571
- * @param {function} [posFunc=this.style.get('position')] The function to
571
+ * @param {function} [posFunc] The function to
572
572
  * get the position of each vertex.
573
- * @param {function} [polyFunc=this.style.get('polygon')] The function to
573
+ * @param {function} [polyFunc] The function to
574
574
  * get each polygon.
575
- * @param {boolean} [returnData=false] If truthy, return the new data array
575
+ * @param {boolean} [returnData] If truthy, return the new data array
576
576
  * rather than modifying the feature.
577
577
  * @returns {this|array}
578
578
  */
package/src/registry.js CHANGED
@@ -410,12 +410,12 @@ registry.registerAnnotation = function (name, func, features) {
410
410
  * @alias geo.createAnnotation
411
411
  * @param {string} name The annotation name
412
412
  * @param {object} options The options for the annotation.
413
- * @returns {object} the new annotation.
413
+ * @returns {object?} the new annotation.
414
414
  */
415
415
  registry.createAnnotation = function (name, options) {
416
416
  if (!annotations[name]) {
417
417
  console.warn('The ' + name + ' annotation is not registered');
418
- return;
418
+ return undefined;
419
419
  }
420
420
  var annotation = annotations[name].func(options);
421
421
  return annotation;
@@ -12,7 +12,7 @@ var renderer = require('../renderer');
12
12
  * @param {geo.layer} [arg.layer] Layer associated with the renderer.
13
13
  * @param {HTMLElement} [arg.canvas] Canvas element associated with the
14
14
  * renderer.
15
- * @param {boolean} [arg.widget=false] Set to `true` if this is a stand-alone
15
+ * @param {boolean} [arg.widget] Set to `true` if this is a stand-alone
16
16
  * widget. If it is not a widget, svg elements are wrapped in a parent
17
17
  * group.
18
18
  * @param {HTMLElement} [arg.d3Parent] If specified, the parent for any
@@ -324,7 +324,7 @@ var svgRenderer = function (arg) {
324
324
  * Initialize.
325
325
  *
326
326
  * @param {object} arg The options used to create the renderer.
327
- * @param {boolean} [arg.widget=false] Set to `true` if this is a stand-alone
327
+ * @param {boolean} [arg.widget] Set to `true` if this is a stand-alone
328
328
  * widget. If it is not a widget, svg elements are wrapped in a parent
329
329
  * group.
330
330
  * @param {HTMLElement} [arg.d3Parent] If specified, the parent for any
package/src/tile.js CHANGED
@@ -11,8 +11,8 @@ var $ = require('jquery');
11
11
  * @property {number} size.y Height (usually in pixels).
12
12
  * @property {object|string} url A url or jQuery ajax config object.
13
13
  * @property {object} [overlap] The size of overlap with neighboring tiles.
14
- * @property {number} overlap.x=0
15
- * @property {number} overlap.y=0
14
+ * @property {number} [overlap.x=0] Overlap in the x direction.
15
+ * @property {number} [overlap.y=0] Overlap in the y direction.
16
16
  */
17
17
 
18
18
  /**
package/src/tileCache.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * @alias geo.tileCache
9
9
  *
10
10
  * @param {object} [options] A configuration object for the cache.
11
- * @param {number} [options.size=64] The maximum number of tiles to store.
11
+ * @param {number} [options.size] The maximum number of tiles to store.
12
12
  */
13
13
  var tileCache = function (options) {
14
14
  if (!(this instanceof tileCache)) {
package/src/tileLayer.js CHANGED
@@ -415,12 +415,12 @@ var tileLayer = function (arg) {
415
415
  * Returns undefined if the tile should not be cropped.
416
416
  *
417
417
  * @param {object} tile The tile to compute crop values for.
418
- * @returns {object} Either `undefined` or an object with `x` and `y` values
418
+ * @returns {object?} Either `undefined` or an object with `x` and `y` values
419
419
  * which is the size in pixels for the tile.
420
420
  */
421
421
  this.tileCropFromBounds = function (tile) {
422
422
  if (!m_this._options.tilesMaxBounds) {
423
- return;
423
+ return undefined;
424
424
  }
425
425
  var level = tile.index.level,
426
426
  bounds = m_this._tileBounds(tile);
@@ -434,6 +434,7 @@ var tileLayer = function (arg) {
434
434
  y: Math.max(0, Math.min(m_maxBounds[level].y, bounds.bottom) - bounds.top)
435
435
  };
436
436
  }
437
+ return undefined;
437
438
  };
438
439
 
439
440
  /**
@@ -692,7 +693,7 @@ var tileLayer = function (arg) {
692
693
  * @param {boolean} [onlyIfChanged] If the set of tiles have not changed
693
694
  * (even if their desired order has), return undefined instead of an
694
695
  * array of tiles.
695
- * @returns {geo.tile[]} An array of tile objects
696
+ * @returns {geo.tile[]?} An array of tile objects
696
697
  */
697
698
  this._getTiles = function (maxLevel, bounds, sorted, onlyIfChanged) {
698
699
  var i, j, tiles = [], index, nTilesLevel,
@@ -767,7 +768,7 @@ var tileLayer = function (arg) {
767
768
 
768
769
  if (onlyIfChanged) {
769
770
  if (!changed && tiles.length === m_lastTileSet.length) {
770
- return;
771
+ return undefined;
771
772
  }
772
773
  m_lastTileSet.splice(0, m_lastTileSet.length);
773
774
  $.each(tiles, function (idx, tile) {
@@ -1204,11 +1205,11 @@ var tileLayer = function (arg) {
1204
1205
  * create the element if it doesn't already exist.
1205
1206
  *
1206
1207
  * @param {number} level The zoom level of the layer to fetch.
1207
- * @returns {HTMLElement} The layer's DOM element.
1208
+ * @returns {HTMLElement?} The layer's DOM element.
1208
1209
  */
1209
1210
  this._getSubLayer = function (level) {
1210
1211
  if (!m_this.canvas()) {
1211
- return;
1212
+ return undefined;
1212
1213
  }
1213
1214
  var node = m_this.canvas()
1214
1215
  .find('div[data-tile-layer=' + level.toFixed() + ']').get(0);
@@ -460,7 +460,7 @@ var trackFeature = function (arg) {
460
460
  * set the named style to the specified value. Otherwise, extend the
461
461
  * current style with the values in the specified object.
462
462
  * @param {*} [arg2] If `arg1` is a string, the new value for that style.
463
- * @param {string} [styleType='style'] The name of the style type, such as
463
+ * @param {string} [styleType] The name of the style type, such as
464
464
  * `markerStyle`, `textStyle`, `pastStyle`, `currentStyle`, or
465
465
  * `futureStyle`.
466
466
  * @returns {object|this} Either the entire style object, the value of a
@@ -746,7 +746,7 @@ var trackFeature = function (arg) {
746
746
  * object with `outer` and optionally `inner` parameters. All coordinates
747
747
  * are in map interface gcs.
748
748
  * @param {object} [opts] Additional search options.
749
- * @param {boolean} [opts.partial=false] If truthy, include tracks that are
749
+ * @param {boolean} [opts.partial] If truthy, include tracks that are
750
750
  * partially in the polygon, otherwise only include tracks that are fully
751
751
  * within the region.
752
752
  * @returns {object} An object with `index`: a list of track indices,
package/src/transform.js CHANGED
@@ -650,9 +650,9 @@ transform.affineInverse = function (def, coords) {
650
650
  * @param {geo.geoPosition} pt2 The second point.
651
651
  * @param {string|geo.transform} [gcs] `undefined` to use the same gcs as the
652
652
  * ellipsoid, otherwise the gcs of the points.
653
- * @param {string|geo.transform} [baseGcs='EPSG:4326'] the gcs of the
653
+ * @param {string|geo.transform} [baseGcs] the gcs of the
654
654
  * ellipsoid.
655
- * @param {object} [ellipsoid=proj4.WGS84] An object with at least `a` and one
655
+ * @param {object} [ellipsoid] An object with at least `a` and one
656
656
  * of `b`, `f`, or `rf` (1 / `f`) -- this works with proj4 ellipsoid
657
657
  * definitions.
658
658
  * @returns {number} The distance in meters (or whatever units the ellipsoid
@@ -690,12 +690,12 @@ transform.sphericalDistance = function (pt1, pt2, gcs, baseGcs, ellipsoid) {
690
690
  * @param {geo.geoPosition} pt2 The second point.
691
691
  * @param {string|geo.transform} [gcs] `undefined` to use the same gcs as the
692
692
  * ellipsoid, otherwise the gcs of the points.
693
- * @param {string|geo.transform} [baseGcs='EPSG:4326'] the gcs of the
693
+ * @param {string|geo.transform} [baseGcs] the gcs of the
694
694
  * ellipsoid.
695
- * @param {object} [ellipsoid=proj4.WGS84] An object with at least `a` and one
695
+ * @param {object} [ellipsoid] An object with at least `a` and one
696
696
  * of `b`, `f`, or `rf` (1 / `f`) -- this works with proj4 ellipsoid
697
697
  * definitions.
698
- * @param {number} [maxIterations=100] Maximum number of iterations to use
698
+ * @param {number} [maxIterations] Maximum number of iterations to use
699
699
  * to test convergence.
700
700
  * @returns {object} An object with `distance` in meters (or whatever units the
701
701
  * ellipsoid was specified in), `alpha1` and `alpha2`, the azimuths at the
@@ -44,8 +44,8 @@ require('./colorLegendWidget.styl');
44
44
  * container.
45
45
  * @param {geo.gui.colorLegendWidget.category[]} [arg.categories] An array
46
46
  * of category definitions for the initial color legends
47
- * @param {number} [arg.width=300] The width of the widget in pixels.
48
- * @param {number} [arg.ticks=6] The maximum number of ticks on the axis of a legend, default is 6.
47
+ * @param {number} [arg.width] The width of the widget in pixels.
48
+ * @param {number} [arg.ticks] The maximum number of ticks on the axis of a legend, default is 6.
49
49
  * @returns {geo.gui.colorLegendWidget}
50
50
  */
51
51
  var colorLegendWidget = function (arg) {
@@ -10,7 +10,7 @@ var registerWidget = require('../registry').registerWidget;
10
10
  * @extends geo.gui.widget
11
11
  * @param {object} arg
12
12
  * @param {geo.widget} [parent] A parent widget for this widget.
13
- * @param {string} [el='div'] The type of DOM element to create.
13
+ * @param {string} [el] The type of DOM element to create.
14
14
  * @returns {geo.domWidget}
15
15
  */
16
16
  var domWidget = function (arg) {
@@ -326,9 +326,9 @@ inherit(scaleWidget, svgWidget);
326
326
  * entry is an array that must be in ascending order. Use unicode in strings,
327
327
  * not html entities. It makes it more reusable.
328
328
  * @name unitsTable
329
- * @property unitsTable {object} The key names are the names of unit systems,
329
+ * @property {object} unitsTable The key names are the names of unit systems,
330
330
  * such as `si`.
331
- * @property unitsTable.unit {geo.gui.scaleWidget.unitTableRecord[]} A list of
331
+ * @property {geo.gui.scaleWidget.unitTableRecord[]} unitsTable.unit A list of
332
332
  * units within the unit system from smallest to largest.
333
333
  * @memberof geo.gui.scaleWidget
334
334
  */
@@ -373,9 +373,9 @@ scaleWidget.unitsTable = {
373
373
  * meter. Each entry is an array that must be in ascending order. This table
374
374
  * can be passed to formatUnit.
375
375
  * @name areaUnitsTable
376
- * @property areaUnitsTable {object} The key names are the names of unit
376
+ * @property {object} areaUnitsTable The key names are the names of unit
377
377
  * systems, such as `si`.
378
- * @property areaUnitsTable.unit {geo.gui.scaleWidget.unitTableRecord[]} A list
378
+ * @property {geo.gui.scaleWidget.unitTableRecord[]} areaUnitsTable.unit A list
379
379
  * of units within the unit system from smallest to largest.
380
380
  * @memberof geo.gui.scaleWidget
381
381
  */
@@ -413,21 +413,21 @@ scaleWidget.areaUnitsTable = {
413
413
  * @param {number} val The value. A length or area in base units. With the
414
414
  * default unit table, this is in meters. With the `areaUnitsTable`, this
415
415
  * is square meters.
416
- * @param {string|object[]} [unit='si'] The name of the unit system or a unit
416
+ * @param {string|object[]} [unit] The name of the unit system or a unit
417
417
  * table.
418
- * @param {object} [table=unitTable] The table of the unit system. Ignored if
418
+ * @param {object} [table] The table of the unit system. Ignored if
419
419
  * `unit` is a unit table.
420
- * @param {number} [digits=3] The minimum number of significant figures.
421
- * @returns {string} A formatted string or `undefined`.
420
+ * @param {number} [digits] The minimum number of significant figures.
421
+ * @returns {string?} A formatted string or `undefined`.
422
422
  */
423
423
  scaleWidget.formatUnit = function (val, unit, table, digits) {
424
424
  if (val === undefined || val === null) {
425
- return;
425
+ return undefined;
426
426
  }
427
427
  if (!Array.isArray(unit)) {
428
428
  table = table || scaleWidget.unitsTable;
429
429
  if (!table || !table[unit || 'si']) {
430
- return;
430
+ return undefined;
431
431
  }
432
432
  unit = table[unit || 'si'];
433
433
  }
@@ -441,7 +441,7 @@ scaleWidget.formatUnit = function (val, unit, table, digits) {
441
441
  val /= unit.scale;
442
442
  digits = Math.max(0, -Math.ceil(Math.log10(val)) + (digits === undefined || digits < 0 ? 3 : digits));
443
443
  if (digits > 10) {
444
- return;
444
+ return undefined;
445
445
  }
446
446
  let result = val.toFixed(digits);
447
447
  if (digits) {
package/src/ui/widget.js CHANGED
@@ -10,8 +10,7 @@ var sceneObject = require('../sceneObject');
10
10
  * @property {string|number} [bottom] The position to the bottom of the
11
11
  * container. A string css position or a number in pixels.
12
12
  * @property {string|number} [left] The position to the left of the container.
13
- * @property {string|number} [top] The position to the top of the container.
14
- * @property {*} [...] Additional css properties that affect position are
13
+ * @property {*} [any] Additional css properties that affect position are
15
14
  * allowed. See the css specification for details.
16
15
  */
17
16
 
package/src/util/color.js CHANGED
@@ -175,9 +175,9 @@ var colorUtils = {
175
175
  *
176
176
  * @param {geo.geoColor} [color] Any valid color input. If an invalid value
177
177
  * or no value is supplied, the `defaultColor` is used.
178
- * @param {number} [opacity=1] A value from [0-1]. This is multiplied with
178
+ * @param {number} [opacity] A value from [0-1]. This is multiplied with
179
179
  * the opacity from `color`.
180
- * @param {geo.geoColorObject} [defaultColor={r: 0, g: 0, b: 0}] The color
180
+ * @param {geo.geoColorObject} [defaultColor] The color
181
181
  * to use if an invalid color is supplied.
182
182
  * @returns {geo.geoColorObject} An rgba color object.
183
183
  * @memberof geo.util
@@ -269,7 +269,8 @@ var colorUtils = {
269
269
  * standard, `rgb` and `rgba` are aliases of each other, as are `hsl` and
270
270
  * `hsla`.
271
271
  * @name cssColorConversions
272
- * @property cssColorConversions {geo.util.cssColorConversionRecord[]}
272
+ * @property {geo.util.cssColorConversionRecord[]} cssColorConversions A list
273
+ * of conversion records.
273
274
  * @memberof geo.util
274
275
  */
275
276
  colorUtils.cssColorConversions = [{