geojs 1.13.0 → 1.13.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojs",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "JavaScript Geo Visualization and Analysis Library",
5
5
  "homepage": "https://github.com/OpenGeoscience/geojs",
6
6
  "license": "Apache-2.0",
@@ -1252,6 +1252,7 @@ var annotation = function (type, args) {
1252
1252
  /**
1253
1253
  * Return actions needed for the specified state of this annotation.
1254
1254
  *
1255
+ * @private
1255
1256
  * @param {object} m_this The current annotation instance.
1256
1257
  * @param {function} s_actions The parent actions method.
1257
1258
  * @param {string|undefined} state The state to return actions for. Defaults
@@ -1285,6 +1286,7 @@ function continuousVerticesActions(m_this, s_actions, state, name, originalArgs)
1285
1286
  /**
1286
1287
  * Process actions to allow drawing continuous vertices for an annotation.
1287
1288
  *
1289
+ * @private
1288
1290
  * @param {object} m_this The current annotation instance.
1289
1291
  * @param {geo.event} evt The action event.
1290
1292
  * @param {string} name The name of this annotation.
@@ -1346,6 +1348,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
1346
1348
  * that the aspect ratio of a rectangle-like selection is a specific value or
1347
1349
  * range of values.
1348
1350
  *
1351
+ * @private
1349
1352
  * @param {number|number[]|geo.geoSize|geo.geoSize[]} ratio Either a single
1350
1353
  * aspect ratio, a single size, or a list of allowed aspect ratios and sizes.
1351
1354
  * For instance, 1 will require that the selection square, 2 would require
package/src/osmLayer.js CHANGED
@@ -79,7 +79,7 @@ var osmLayer = function (arg) {
79
79
  overlap: m_this._options.tileOverlap,
80
80
  scale: m_this._options.tileScale,
81
81
  url: m_this._options.url.call(
82
- m_this, urlParams.x, urlParams.y, urlParams.level || 0,
82
+ m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
83
83
  m_this._options.subdomains),
84
84
  crossDomain: m_this._options.crossDomain
85
85
  });
@@ -81,7 +81,7 @@ var pixelmapLayer = function (arg) {
81
81
  overlap: m_this._options.tileOverlap,
82
82
  scale: m_this._options.tileScale,
83
83
  url: m_this._options.url.call(
84
- m_this, urlParams.x, urlParams.y, urlParams.level || 0,
84
+ m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
85
85
  m_this._options.subdomains),
86
86
  crossDomain: m_this._options.crossDomain
87
87
  });
package/src/tileLayer.js CHANGED
@@ -102,6 +102,7 @@ function modulo(a, b) {
102
102
  /**
103
103
  * Pick a subdomain from a list of subdomains based on a the tile location.
104
104
  *
105
+ * @private
105
106
  * @param {number} x The x tile coordinate.
106
107
  * @param {number} y The y tile coordinate.
107
108
  * @param {number} z The tile layer.
@@ -121,9 +122,9 @@ function m_getTileSubdomain(x, y, z, subdomains) {
121
122
  * all equivalent. The comma-separated list can have subdomains that are of
122
123
  * any length; the string and range both use one-character subdomains.
123
124
  *
125
+ * @private
124
126
  * @param {string} base The tile format string
125
127
  * @returns {function} A conversion function.
126
- * @private.
127
128
  */
128
129
  function m_tileUrlFromTemplate(base) {
129
130
  var xPattern = /\$?\{[xX]\}/g,
@@ -600,7 +601,7 @@ var tileLayer = function (arg) {
600
601
  size: {x: m_this._options.tileWidth, y: m_this._options.tileHeight},
601
602
  queue: m_this._queue,
602
603
  url: m_this._options.url.call(
603
- m_this, urlParams.x, urlParams.y, urlParams.level || 0,
604
+ m_this, urlParams.x, urlParams.y, Math.max(urlParams.level || 0, 0),
604
605
  m_this._options.subdomains)
605
606
  });
606
607
  };
package/src/util/color.js CHANGED
@@ -76,6 +76,7 @@ var m_memoizeConvertColor = {maxCount: 1000, count: 0, memo: {}};
76
76
  * be returned quickly. If the memoization table gets over a certain size,
77
77
  * just reset it.
78
78
  *
79
+ * @private
79
80
  * @param {geo.geoColor} origColor The original color specification.
80
81
  * @param {geo.geoColorObject} resultColor The result of the conversion.
81
82
  * @returns {geo.geoColorObject} The `resultColor`.
@@ -569,6 +569,7 @@ var util = {
569
569
  };
570
570
  var layerParams = {
571
571
  maxLevel: maxLevel,
572
+ minLevel: Math.min(0, maxLevel),
572
573
  wrapX: false,
573
574
  wrapY: false,
574
575
  tileOffset: function () {
@@ -998,7 +999,7 @@ var util = {
998
999
  * @param {object} target target object to modify.
999
1000
  * @param {object} sources object(s) to merge into the target.
1000
1001
  * @returns {object} The merged object.
1001
- * @member geo.util
1002
+ * @memberof geo.util
1002
1003
  */
1003
1004
  deepMerge: function (target, ...sources) {
1004
1005
  for (const source of sources) {
package/src/util/mesh.js CHANGED
@@ -33,6 +33,7 @@
33
33
  * elements, falsy for vertices.
34
34
  * @returns {geo.meshFeature.meshColoredInfo} An object with the colored mesh
35
35
  * information.
36
+ * @memberof geo.util
36
37
  */
37
38
  function createColoredMesh(feature, elementValues) {
38
39
  var util = require('../util');
@@ -82,6 +82,7 @@ const AlternateOpNames = {
82
82
  *
83
83
  * @param {object[]} seglist A PolyBool segment list.
84
84
  * @returns {geo.polygonList|undefined} A polygon list.
85
+ * @private
85
86
  */
86
87
  function seglistToPolygonList(seglist) {
87
88
  // This single line doesn't arrange holes correctly
@@ -157,6 +158,7 @@ function seglistToPolygonList(seglist) {
157
158
  * around 0.11 mm in ground distance.
158
159
  * @param {object} seglist A seglist array as used by the polybool library.
159
160
  * @returns {object} A seglist array.
161
+ * @private
160
162
  */
161
163
  function polygonOperationSeglist(op, epsilon, seglist) {
162
164
  op = 'select' + op.charAt(0).toUpperCase() + op.slice(1);
@@ -223,6 +225,7 @@ function polygonOperationSeglist(op, epsilon, seglist) {
223
225
  * @param {geo.util.polyop.spec} [opts] Options for the operation. Only used
224
226
  * if poly is an object with a toPolygonList method.
225
227
  * @returns {geo.polygonList} A list of polygons.
228
+ * @memberof geo.util.polyops
226
229
  */
227
230
  function toPolygonList(poly, mode, opts) {
228
231
  mode = mode || {};
@@ -292,6 +295,7 @@ function toPolygonList(poly, mode, opts) {
292
295
  * @param {geo.util.polyop.spec} [opts] Options for the operation. Only used
293
296
  * if ``mode.style`` is an object with a fromPolygonList method.
294
297
  * @returns {geo.polygonAny} A polygon in one of several formats.
298
+ * @memberof geo.util.polyops
295
299
  */
296
300
  function fromPolygonList(poly, mode, opts) {
297
301
  if (mode.style.fromPolygonList) {
@@ -316,6 +320,7 @@ function fromPolygonList(poly, mode, opts) {
316
320
  /**
317
321
  * Use a minimum style for output to include all of the results.
318
322
  *
323
+ * @private
319
324
  * @param {geo.polygonList} polylist A list of polygons.
320
325
  * @param {string} style the proposed style.
321
326
  * @returns {string} The preferred style.
@@ -346,6 +351,7 @@ function minimumPolygonStyle(polylist, style) {
346
351
  * Generate the correspondence between the source polygons and the output
347
352
  * polygons. A polygon corresponds if it has at least two points in common.
348
353
  *
354
+ * @private
349
355
  * @param {geo.polygonList} poly1 First set of source polygons.
350
356
  * @param {geo.polygonList} poly2 Second set of source polygons.
351
357
  * @param {geo.polygonList} newpoly Output polygons.
@@ -408,6 +414,7 @@ function generateCorrespondence(poly1, poly2, newpoly, results) {
408
414
  /**
409
415
  * Perform a general operation of a set of polygons.
410
416
  *
417
+ * @private
411
418
  * @param {string} op The operation to handle. One of union, intersect,
412
419
  * difference, or xor.
413
420
  * @param {geo.polygonAny|geo.util.polyop.spec} poly1 Either the first polygon
@@ -483,6 +490,7 @@ function generalOperationProcess(op, poly1, poly2, opts) {
483
490
  /**
484
491
  * Generate a polygon function for a specific operation.
485
492
  *
493
+ * @private
486
494
  * @param {string} op The operation to handle. One of union, intersect,
487
495
  * difference, or xor.
488
496
  * @returns {function} a function for the polygons.
@@ -20,6 +20,7 @@ var webgl_layer = function () {
20
20
  * @param {number} [opacity] If specified, set the opacity. Otherwise,
21
21
  * return the opacity.
22
22
  * @returns {number|this} The current opacity or the current layer.
23
+ * @memberof geo.webgl.layer
23
24
  */
24
25
  this.opacity = function (opacity) {
25
26
  var result = s_opacity.apply(m_this, arguments);
@@ -36,6 +37,7 @@ var webgl_layer = function () {
36
37
  * get it.
37
38
  * @returns {boolean|this} either the visibility (if getting) or the layer
38
39
  * (if setting).
40
+ * @memberof geo.webgl.layer
39
41
  */
40
42
  this.visible = function (val) {
41
43
  if (val === undefined) {
@@ -60,6 +62,7 @@ var webgl_layer = function () {
60
62
  * truthy, allow other layers to have the same z-index. Otherwise,
61
63
  * ensure that other layers have distinct z-indices from this one.
62
64
  * @returns {number|this}
65
+ * @memberof geo.webgl.layer
63
66
  */
64
67
  this.zIndex = function (zIndex, allowDuplicate) {
65
68
  var result = s_zIndex.apply(m_this, arguments);
@@ -84,6 +87,7 @@ var webgl_layer = function () {
84
87
  * @param {geo.webgl.webglRenderer} newRenderer The renderer to move to.
85
88
  * @param {boolean} [rerender=false] If truthy, rerender after the switch.
86
89
  * @returns {this}
90
+ * @memberof geo.webgl.layer
87
91
  */
88
92
  this.switchRenderer = function (newRenderer, rerender) {
89
93
  if (newRenderer instanceof webglRenderer && newRenderer !== m_this.renderer()) {
@@ -122,6 +126,7 @@ var webgl_layer = function () {
122
126
  * Initialize after the layer is added to the map.
123
127
  *
124
128
  * @returns {this}
129
+ * @memberof geo.webgl.layer
125
130
  */
126
131
  this._init = function () {
127
132
 
@@ -8,6 +8,7 @@ var vgl = require('../vgl');
8
8
  * @param {vgl.renderState} renderState An object that contains the context
9
9
  * used for drawing.
10
10
  * @param {number} textureUnit The number of the texture unit [0-15].
11
+ * @private
11
12
  */
12
13
  function activateTextureUnit(renderState, textureUnit) {
13
14
  if (textureUnit >= 0 && textureUnit <= 31) {
@@ -6,6 +6,7 @@ var pointFeature = require('../pointFeature');
6
6
  * @param {this} m_this The point-like feature.
7
7
  * @param {object} [arg] Feature definition object that might specify the
8
8
  * primitive shape.
9
+ * @memberof geo.webgl
9
10
  */
10
11
  function pointUtil(m_this, arg) {
11
12
  arg = arg || {};
@@ -20,6 +20,7 @@ var webgl_tileLayer = function () {
20
20
  * Add a tile to the list of quads.
21
21
  *
22
22
  * @param {geo.tile} tile The tile to add and draw.
23
+ * @memberof geo.webgl.tileLayer
23
24
  */
24
25
  this._drawTile = function (tile) {
25
26
  if (!m_quadFeature) {
@@ -108,6 +109,7 @@ var webgl_tileLayer = function () {
108
109
  * @param {boolean} [val] If specified, change the visibility, otherwise
109
110
  * return it.
110
111
  * @returns {boolean|this} The current visibility or the layer.
112
+ * @memberof geo.webgl.tileLayer
111
113
  */
112
114
  this.visible = function (val) {
113
115
  if (val === undefined) {
@@ -132,6 +134,7 @@ var webgl_tileLayer = function () {
132
134
  * truthy, allow other layers to have the same z-index. Otherwise,
133
135
  * ensure that other layers have distinct z-indices from this one.
134
136
  * @returns {number|this}
137
+ * @memberof geo.webgl.tileLayer
135
138
  */
136
139
  this.zIndex = function (zIndex, allowDuplicate) {
137
140
  if (zIndex !== undefined) {
@@ -146,6 +149,7 @@ var webgl_tileLayer = function () {
146
149
  *
147
150
  * @param {geo.event} [evt] If specified, the layer add or remove event that
148
151
  * triggered this. If `undefined`, clear the quads but don't redraw.
152
+ * @memberof geo.webgl.tileLayer
149
153
  */
150
154
  this._clearQuads = function (evt) {
151
155
  if (evt && (!evt.layer || !(evt.layer instanceof tileLayer) || !evt.layer.autoshareRenderer() || (
@@ -168,6 +172,7 @@ var webgl_tileLayer = function () {
168
172
  *
169
173
  * @param {object} request A value to pass to the parent class.
170
174
  * @returns {this}
175
+ * @memberof geo.webgl.tileLayer
171
176
  */
172
177
  this._update = function (request) {
173
178
  s_update.call(m_this, request);
@@ -180,6 +185,7 @@ var webgl_tileLayer = function () {
180
185
 
181
186
  /**
182
187
  * Cleanup. This purges the texture and tile cache.
188
+ * @memberof geo.webgl.tileLayer
183
189
  */
184
190
  this._cleanup = function () {
185
191
  var tile;
@@ -197,6 +203,7 @@ var webgl_tileLayer = function () {
197
203
 
198
204
  /**
199
205
  * Destroy.
206
+ * @memberof geo.webgl.tileLayer
200
207
  */
201
208
  this._exit = function () {
202
209
  var map = m_this.map();
@@ -211,6 +218,7 @@ var webgl_tileLayer = function () {
211
218
 
212
219
  /**
213
220
  * Initialize after the layer is added to the map.
221
+ * @memberof geo.webgl.tileLayer
214
222
  */
215
223
  this._init = function () {
216
224
  s_init.apply(m_this, arguments);