geojs 1.14.10 → 1.14.12

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/geo.js CHANGED
@@ -6430,7 +6430,6 @@ var _feature = function feature(arg) {
6430
6430
  }
6431
6431
  if (m_visible !== val || direct) {
6432
6432
  m_visible = val;
6433
- m_this.modified();
6434
6433
  if (m_layer && m_layer.visible && !m_layer.visible()) {
6435
6434
  val = false;
6436
6435
  }
@@ -13258,9 +13257,16 @@ var _svgRenderer = function svgRenderer(arg) {
13258
13257
  return m_this;
13259
13258
  };
13260
13259
 
13260
+ /**
13261
+ * Schedule an update in the next render frame.
13262
+ */
13263
+ this._scheduleUpdate = function () {
13264
+ m_this.layer().map().scheduleAnimationFrame(m_this._renderFrame);
13265
+ };
13266
+
13261
13267
  /**
13262
13268
  * Render all features that are marked as needing an update. This should
13263
- * only be called duration an animation frame.
13269
+ * only be called during an animation frame.
13264
13270
  */
13265
13271
  this._renderFrame = function () {
13266
13272
  var id;
@@ -13276,6 +13282,11 @@ var _svgRenderer = function svgRenderer(arg) {
13276
13282
  m_this._renderFeature(id);
13277
13283
  }
13278
13284
  }
13285
+ for (id in m_features) {
13286
+ if (m_features.hasOwnProperty(id) && ids[id] === undefined) {
13287
+ m_this.select(id).attr('visibility', !m_features[id].visible || m_features[id].visible() ? 'visible' : 'hidden');
13288
+ }
13289
+ }
13279
13290
  };
13280
13291
 
13281
13292
  /**
@@ -13290,6 +13301,7 @@ var _svgRenderer = function svgRenderer(arg) {
13290
13301
  if (!m_features[id]) {
13291
13302
  return m_this;
13292
13303
  }
13304
+ m_this.select(id).remove();
13293
13305
  var data = m_features[id].data,
13294
13306
  index = m_features[id].index,
13295
13307
  style = m_features[id].style,
@@ -13309,7 +13321,7 @@ var _svgRenderer = function svgRenderer(arg) {
13309
13321
  rendersel.attr('class', classes.concat([id]).join(' '));
13310
13322
  setStyles(rendersel, style);
13311
13323
  if (visible) {
13312
- rendersel.style('visibility', visible() ? 'visible' : 'hidden');
13324
+ rendersel.attr('visibility', visible() ? 'visible' : 'hidden');
13313
13325
  }
13314
13326
  if (entries.size() && m_features[id].sortByZ) {
13315
13327
  selection.sort(function (a, b) {
@@ -22394,14 +22406,15 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
22394
22406
  */
22395
22407
  this.updateStyleFromArray = function (keyOrObject, styleArray, refresh) {
22396
22408
  var bufferedKeys = {
22409
+ radius: 1,
22397
22410
  fillColor: 3,
22398
22411
  fillOpacity: 1,
22399
- radius: 1,
22400
22412
  strokeColor: 3,
22401
22413
  strokeOpacity: 1,
22402
22414
  strokeWidth: 1,
22403
22415
  symbolComputed: 1,
22404
- symbolValueComputed: 1
22416
+ symbolValueComputed: 1,
22417
+ rotation: 1
22405
22418
  };
22406
22419
  var needsRefresh, needsRender;
22407
22420
  if (typeof keyOrObject === 'string') {
@@ -22410,12 +22423,12 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
22410
22423
  keyOrObject = obj;
22411
22424
  }
22412
22425
  $.each(keyOrObject, function (key, styleArray) {
22426
+ var sbkey = key === 'symbolComputed' ? 'symbol' : key === 'symbolValueComputed' ? 'symbolValue' : key;
22413
22427
  if (m_this.visible() && m_actor && bufferedKeys[key] && !needsRefresh && !m_this.clustering()) {
22414
- var vpf, mapper, buffer, numPts, value, i, j, v, bpv, sbkey;
22428
+ var vpf, mapper, buffer, numPts, value, i, j, v, bpv;
22415
22429
  bpv = bufferedKeys[key];
22416
22430
  numPts = m_this.data().length;
22417
22431
  mapper = m_actor.mapper();
22418
- sbkey = key === 'symbolComputed' ? 'symbol' : key === 'symbolValueComputed' ? 'symbolValue' : key;
22419
22432
  buffer = mapper.getSourceBuffer(sbkey);
22420
22433
  vpf = m_this.verticesPerFeature();
22421
22434
  if (!buffer || !numPts || numPts * vpf * bpv !== buffer.length) {
@@ -22451,15 +22464,13 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
22451
22464
  } else {
22452
22465
  needsRefresh = true;
22453
22466
  }
22454
- if (key === sbkey) {
22455
- var mod = m_this.modified;
22456
- if (!needsRefresh) {
22457
- // don't allow modified to be adjusted if we don't need to refresh
22458
- m_this.modified = function () {};
22459
- }
22460
- s_updateStyleFromArray(key, styleArray, false);
22461
- m_this.modified = mod;
22467
+ var mod = m_this.modified;
22468
+ if (!needsRefresh && key === sbkey) {
22469
+ // don't allow modified to be adjusted if we don't need to refresh
22470
+ m_this.modified = function () {};
22462
22471
  }
22472
+ s_updateStyleFromArray(key, styleArray, false);
22473
+ m_this.modified = mod;
22463
22474
  });
22464
22475
  if (refresh) {
22465
22476
  if (m_this.visible() && needsRefresh) {
@@ -22505,15 +22516,15 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
22505
22516
  name: 'pos'
22506
22517
  }),
22507
22518
  attr = {
22508
- radius: 1,
22509
22519
  fillColor: 3,
22510
22520
  fillOpacity: 1,
22521
+ radius: 1,
22522
+ rotation: 1,
22511
22523
  strokeColor: 3,
22512
22524
  strokeOpacity: 1,
22513
22525
  strokeWidth: 1,
22514
22526
  symbol: 1,
22515
- symbolValue: 1,
22516
- rotation: 1
22527
+ symbolValue: 1
22517
22528
  },
22518
22529
  uniforms = {
22519
22530
  pixelWidth: vgl.GL.FLOAT,
@@ -26455,7 +26466,7 @@ module.exports = svg_tileLayer;
26455
26466
  * @constant
26456
26467
  * @type {string}
26457
26468
  */
26458
- module.exports = "1.14.10";
26469
+ module.exports = "1.14.12";
26459
26470
 
26460
26471
  /***/ }),
26461
26472
 
@@ -28772,6 +28783,7 @@ var _svg_object = function svg_object(arg) {
28772
28783
  var m_id = 'svg-' + uniqueID(),
28773
28784
  s_exit = this._exit,
28774
28785
  m_this = this,
28786
+ s_visible = this.visible,
28775
28787
  s_draw = this.draw;
28776
28788
  this._svgid = function () {
28777
28789
  return m_id;
@@ -28806,6 +28818,26 @@ var _svg_object = function svg_object(arg) {
28806
28818
  m_this.renderer()._removeFeature(m_this._svgid());
28807
28819
  s_exit();
28808
28820
  };
28821
+
28822
+ /**
28823
+ * Get/Set the visibility of the feature.
28824
+ *
28825
+ * @param {boolean} [val] A boolean to change the visibility, or `undefined`
28826
+ * to return the visibility.
28827
+ * @param {boolean} [direct] If `true`, when getting the visibility,
28828
+ * disregard the visibility of the parent layer, and when setting, refresh
28829
+ * the state regardless of whether it has changed or not. Otherwise, the
28830
+ * functional visibility is returned, where both the feature and the layer
28831
+ * must be visible for a `true` result.
28832
+ * @returns {boolean|this} Either the visibility (if getting) or the feature
28833
+ * (if setting).
28834
+ */
28835
+ this.visible = function (val, direct) {
28836
+ if (val !== undefined && val !== s_visible(undefined, true) && m_this.renderer()) {
28837
+ m_this.renderer()._scheduleUpdate();
28838
+ }
28839
+ return s_visible(val, direct);
28840
+ };
28809
28841
  return this;
28810
28842
  };
28811
28843
  module.exports = _svg_object;
@@ -89676,12 +89708,6 @@ var _pointFeature = function pointFeature(arg) {
89676
89708
  var d = clusters[cidx];
89677
89709
  // mark the datum as a cluster for accessor methods
89678
89710
  d.__cluster = true;
89679
-
89680
- // store all of the data objects for each point in the cluster as __data
89681
- d.__data = new Array(d.obj.length);
89682
- for (var idx = 0; idx < d.obj.length; idx += 1) {
89683
- d.__data[idx] = m_allData[d.obj[idx].index];
89684
- }
89685
89711
  data[didx] = d;
89686
89712
  }
89687
89713
 
@@ -97909,7 +97935,7 @@ module.exports = "/* quadFeature Color fragment shader */\n\nvarying mediump vec
97909
97935
  * @constant
97910
97936
  * @type {string}
97911
97937
  */
97912
- module.exports = "2491144d1392414c721b090477fd5a80894538c4";
97938
+ module.exports = "77d74f3f2551728136c961f0023bcf74e19e6fb0";
97913
97939
 
97914
97940
  /***/ }),
97915
97941
 
@@ -103056,10 +103082,10 @@ function earcut(data, holeIndices) {
103056
103082
 
103057
103083
  // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
103058
103084
  if (data.length > 80 * dim) {
103059
- minX = Infinity;
103060
- minY = Infinity;
103061
- var maxX = -Infinity;
103062
- var maxY = -Infinity;
103085
+ minX = data[0];
103086
+ minY = data[1];
103087
+ var maxX = minX;
103088
+ var maxY = minY;
103063
103089
  for (var i = dim; i < outerLen; i += dim) {
103064
103090
  var x = data[i];
103065
103091
  var y = data[i + 1];
@@ -103308,7 +103334,7 @@ function compareXYSlope(a, b) {
103308
103334
  return result;
103309
103335
  }
103310
103336
 
103311
- // find a bridge between vertices that connects hole with an outer ring and and link it
103337
+ // find a bridge between vertices that connects hole with an outer ring and link it
103312
103338
  function eliminateHole(hole, outerNode) {
103313
103339
  var bridge = findHoleBridge(hole, outerNode);
103314
103340
  if (!bridge) {
@@ -103471,7 +103497,7 @@ function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
103471
103497
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
103472
103498
  function isValidDiagonal(a, b) {
103473
103499
  return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (
103474
- // dones't intersect other edges
103500
+ // doesn't intersect other edges
103475
103501
  locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (
103476
103502
  // locally visible
103477
103503
  area(a.prev, a, b.prev) || area(a, b.prev, b)) ||
package/geo.lean.js CHANGED
@@ -6430,7 +6430,6 @@ var _feature = function feature(arg) {
6430
6430
  }
6431
6431
  if (m_visible !== val || direct) {
6432
6432
  m_visible = val;
6433
- m_this.modified();
6434
6433
  if (m_layer && m_layer.visible && !m_layer.visible()) {
6435
6434
  val = false;
6436
6435
  }
@@ -13258,9 +13257,16 @@ var _svgRenderer = function svgRenderer(arg) {
13258
13257
  return m_this;
13259
13258
  };
13260
13259
 
13260
+ /**
13261
+ * Schedule an update in the next render frame.
13262
+ */
13263
+ this._scheduleUpdate = function () {
13264
+ m_this.layer().map().scheduleAnimationFrame(m_this._renderFrame);
13265
+ };
13266
+
13261
13267
  /**
13262
13268
  * Render all features that are marked as needing an update. This should
13263
- * only be called duration an animation frame.
13269
+ * only be called during an animation frame.
13264
13270
  */
13265
13271
  this._renderFrame = function () {
13266
13272
  var id;
@@ -13276,6 +13282,11 @@ var _svgRenderer = function svgRenderer(arg) {
13276
13282
  m_this._renderFeature(id);
13277
13283
  }
13278
13284
  }
13285
+ for (id in m_features) {
13286
+ if (m_features.hasOwnProperty(id) && ids[id] === undefined) {
13287
+ m_this.select(id).attr('visibility', !m_features[id].visible || m_features[id].visible() ? 'visible' : 'hidden');
13288
+ }
13289
+ }
13279
13290
  };
13280
13291
 
13281
13292
  /**
@@ -13290,6 +13301,7 @@ var _svgRenderer = function svgRenderer(arg) {
13290
13301
  if (!m_features[id]) {
13291
13302
  return m_this;
13292
13303
  }
13304
+ m_this.select(id).remove();
13293
13305
  var data = m_features[id].data,
13294
13306
  index = m_features[id].index,
13295
13307
  style = m_features[id].style,
@@ -13309,7 +13321,7 @@ var _svgRenderer = function svgRenderer(arg) {
13309
13321
  rendersel.attr('class', classes.concat([id]).join(' '));
13310
13322
  setStyles(rendersel, style);
13311
13323
  if (visible) {
13312
- rendersel.style('visibility', visible() ? 'visible' : 'hidden');
13324
+ rendersel.attr('visibility', visible() ? 'visible' : 'hidden');
13313
13325
  }
13314
13326
  if (entries.size() && m_features[id].sortByZ) {
13315
13327
  selection.sort(function (a, b) {
@@ -19393,14 +19405,15 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
19393
19405
  */
19394
19406
  this.updateStyleFromArray = function (keyOrObject, styleArray, refresh) {
19395
19407
  var bufferedKeys = {
19408
+ radius: 1,
19396
19409
  fillColor: 3,
19397
19410
  fillOpacity: 1,
19398
- radius: 1,
19399
19411
  strokeColor: 3,
19400
19412
  strokeOpacity: 1,
19401
19413
  strokeWidth: 1,
19402
19414
  symbolComputed: 1,
19403
- symbolValueComputed: 1
19415
+ symbolValueComputed: 1,
19416
+ rotation: 1
19404
19417
  };
19405
19418
  var needsRefresh, needsRender;
19406
19419
  if (typeof keyOrObject === 'string') {
@@ -19409,12 +19422,12 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
19409
19422
  keyOrObject = obj;
19410
19423
  }
19411
19424
  $.each(keyOrObject, function (key, styleArray) {
19425
+ var sbkey = key === 'symbolComputed' ? 'symbol' : key === 'symbolValueComputed' ? 'symbolValue' : key;
19412
19426
  if (m_this.visible() && m_actor && bufferedKeys[key] && !needsRefresh && !m_this.clustering()) {
19413
- var vpf, mapper, buffer, numPts, value, i, j, v, bpv, sbkey;
19427
+ var vpf, mapper, buffer, numPts, value, i, j, v, bpv;
19414
19428
  bpv = bufferedKeys[key];
19415
19429
  numPts = m_this.data().length;
19416
19430
  mapper = m_actor.mapper();
19417
- sbkey = key === 'symbolComputed' ? 'symbol' : key === 'symbolValueComputed' ? 'symbolValue' : key;
19418
19431
  buffer = mapper.getSourceBuffer(sbkey);
19419
19432
  vpf = m_this.verticesPerFeature();
19420
19433
  if (!buffer || !numPts || numPts * vpf * bpv !== buffer.length) {
@@ -19450,15 +19463,13 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
19450
19463
  } else {
19451
19464
  needsRefresh = true;
19452
19465
  }
19453
- if (key === sbkey) {
19454
- var mod = m_this.modified;
19455
- if (!needsRefresh) {
19456
- // don't allow modified to be adjusted if we don't need to refresh
19457
- m_this.modified = function () {};
19458
- }
19459
- s_updateStyleFromArray(key, styleArray, false);
19460
- m_this.modified = mod;
19466
+ var mod = m_this.modified;
19467
+ if (!needsRefresh && key === sbkey) {
19468
+ // don't allow modified to be adjusted if we don't need to refresh
19469
+ m_this.modified = function () {};
19461
19470
  }
19471
+ s_updateStyleFromArray(key, styleArray, false);
19472
+ m_this.modified = mod;
19462
19473
  });
19463
19474
  if (refresh) {
19464
19475
  if (m_this.visible() && needsRefresh) {
@@ -19504,15 +19515,15 @@ var _webgl_markerFeature = function webgl_markerFeature(arg) {
19504
19515
  name: 'pos'
19505
19516
  }),
19506
19517
  attr = {
19507
- radius: 1,
19508
19518
  fillColor: 3,
19509
19519
  fillOpacity: 1,
19520
+ radius: 1,
19521
+ rotation: 1,
19510
19522
  strokeColor: 3,
19511
19523
  strokeOpacity: 1,
19512
19524
  strokeWidth: 1,
19513
19525
  symbol: 1,
19514
- symbolValue: 1,
19515
- rotation: 1
19526
+ symbolValue: 1
19516
19527
  },
19517
19528
  uniforms = {
19518
19529
  pixelWidth: vgl.GL.FLOAT,
@@ -23464,7 +23475,7 @@ module.exports = svg_tileLayer;
23464
23475
  * @constant
23465
23476
  * @type {string}
23466
23477
  */
23467
- module.exports = "1.14.10";
23478
+ module.exports = "1.14.12";
23468
23479
 
23469
23480
  /***/ }),
23470
23481
 
@@ -25781,6 +25792,7 @@ var _svg_object = function svg_object(arg) {
25781
25792
  var m_id = 'svg-' + uniqueID(),
25782
25793
  s_exit = this._exit,
25783
25794
  m_this = this,
25795
+ s_visible = this.visible,
25784
25796
  s_draw = this.draw;
25785
25797
  this._svgid = function () {
25786
25798
  return m_id;
@@ -25815,6 +25827,26 @@ var _svg_object = function svg_object(arg) {
25815
25827
  m_this.renderer()._removeFeature(m_this._svgid());
25816
25828
  s_exit();
25817
25829
  };
25830
+
25831
+ /**
25832
+ * Get/Set the visibility of the feature.
25833
+ *
25834
+ * @param {boolean} [val] A boolean to change the visibility, or `undefined`
25835
+ * to return the visibility.
25836
+ * @param {boolean} [direct] If `true`, when getting the visibility,
25837
+ * disregard the visibility of the parent layer, and when setting, refresh
25838
+ * the state regardless of whether it has changed or not. Otherwise, the
25839
+ * functional visibility is returned, where both the feature and the layer
25840
+ * must be visible for a `true` result.
25841
+ * @returns {boolean|this} Either the visibility (if getting) or the feature
25842
+ * (if setting).
25843
+ */
25844
+ this.visible = function (val, direct) {
25845
+ if (val !== undefined && val !== s_visible(undefined, true) && m_this.renderer()) {
25846
+ m_this.renderer()._scheduleUpdate();
25847
+ }
25848
+ return s_visible(val, direct);
25849
+ };
25818
25850
  return this;
25819
25851
  };
25820
25852
  module.exports = _svg_object;
@@ -61852,12 +61884,6 @@ var _pointFeature = function pointFeature(arg) {
61852
61884
  var d = clusters[cidx];
61853
61885
  // mark the datum as a cluster for accessor methods
61854
61886
  d.__cluster = true;
61855
-
61856
- // store all of the data objects for each point in the cluster as __data
61857
- d.__data = new Array(d.obj.length);
61858
- for (var idx = 0; idx < d.obj.length; idx += 1) {
61859
- d.__data[idx] = m_allData[d.obj[idx].index];
61860
- }
61861
61887
  data[didx] = d;
61862
61888
  }
61863
61889
 
@@ -70095,7 +70121,7 @@ module.exports = "/* quadFeature Color fragment shader */\n\nvarying mediump vec
70095
70121
  * @constant
70096
70122
  * @type {string}
70097
70123
  */
70098
- module.exports = "2491144d1392414c721b090477fd5a80894538c4";
70124
+ module.exports = "77d74f3f2551728136c961f0023bcf74e19e6fb0";
70099
70125
 
70100
70126
  /***/ }),
70101
70127
 
@@ -75242,10 +75268,10 @@ function earcut(data, holeIndices) {
75242
75268
 
75243
75269
  // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
75244
75270
  if (data.length > 80 * dim) {
75245
- minX = Infinity;
75246
- minY = Infinity;
75247
- var maxX = -Infinity;
75248
- var maxY = -Infinity;
75271
+ minX = data[0];
75272
+ minY = data[1];
75273
+ var maxX = minX;
75274
+ var maxY = minY;
75249
75275
  for (var i = dim; i < outerLen; i += dim) {
75250
75276
  var x = data[i];
75251
75277
  var y = data[i + 1];
@@ -75494,7 +75520,7 @@ function compareXYSlope(a, b) {
75494
75520
  return result;
75495
75521
  }
75496
75522
 
75497
- // find a bridge between vertices that connects hole with an outer ring and and link it
75523
+ // find a bridge between vertices that connects hole with an outer ring and link it
75498
75524
  function eliminateHole(hole, outerNode) {
75499
75525
  var bridge = findHoleBridge(hole, outerNode);
75500
75526
  if (!bridge) {
@@ -75657,7 +75683,7 @@ function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
75657
75683
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
75658
75684
  function isValidDiagonal(a, b) {
75659
75685
  return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (
75660
- // dones't intersect other edges
75686
+ // doesn't intersect other edges
75661
75687
  locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (
75662
75688
  // locally visible
75663
75689
  area(a.prev, a, b.prev) || area(a, b.prev, b)) ||