geojs 1.5.0 → 1.6.3

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 (49) hide show
  1. package/.github/workflows/main.yml +4 -4
  2. package/.nvmrc +1 -0
  3. package/CHANGELOG.md +26 -5
  4. package/geo.js +82956 -86701
  5. package/geo.lean.js +70006 -64329
  6. package/geo.lean.min.js +28 -41
  7. package/geo.min.js +30 -47
  8. package/package.json +63 -79
  9. package/src/annotationLayer.js +20 -16
  10. package/src/canvas/heatmapFeature.js +2 -2
  11. package/src/choroplethFeature.js +3 -3
  12. package/src/feature.js +4 -4
  13. package/src/geojsonReader.js +5 -4
  14. package/src/index.js +1 -1
  15. package/src/isolineFeature.js +4 -4
  16. package/src/lineFeature.js +4 -4
  17. package/src/map.js +2 -2
  18. package/src/mapInteractor.js +3 -0
  19. package/src/markerFeature.js +8 -8
  20. package/src/object.js +1 -3
  21. package/src/osmLayer.js +5 -3
  22. package/src/pixelmapFeature.js +1 -1
  23. package/src/pointFeature.js +1 -1
  24. package/src/polygonFeature.js +4 -4
  25. package/src/registry.js +1 -1
  26. package/src/svg/svgRenderer.js +3 -0
  27. package/src/svg/vectorFeature.js +1 -1
  28. package/src/tile.js +1 -1
  29. package/src/tileLayer.js +4 -4
  30. package/src/trackFeature.js +12 -12
  31. package/src/transform.js +11 -10
  32. package/src/ui/colorLegendWidget.js +6 -6
  33. package/src/ui/colorLegendWidget.styl +1 -1
  34. package/src/ui/legendWidget.js +3 -3
  35. package/src/ui/sliderWidget.js +4 -4
  36. package/src/util/common.js +9 -8
  37. package/src/util/mockVGL.js +2 -2
  38. package/src/util/throttle.js +3 -3
  39. package/src/vendor.js +0 -2
  40. package/src/vtkjs/pointFeature.js +1 -1
  41. package/src/vtkjs/vtkjsRenderer.js +3 -0
  42. package/src/webgl/layer.js +1 -1
  43. package/src/webgl/markerFeature.js +4 -4
  44. package/src/webgl/meshColored.js +3 -3
  45. package/src/webgl/pointFeature.js +11 -11
  46. package/src/webgl/polygonFeature.js +3 -3
  47. package/src/webgl/quadFeatureColor.vert +0 -1
  48. package/src/webgl/webglRenderer.js +1 -2
  49. package/src/polyfills.js +0 -4
@@ -681,6 +681,9 @@ svgRenderer.supported = function () {
681
681
  // webpack expects optional dependencies to be wrapped in a try-catch
682
682
  try {
683
683
  svgRenderer.d3 = require('d3');
684
+ if (!svgRenderer.d3 || !svgRenderer.d3.rgb) {
685
+ svgRenderer.d3 = undefined;
686
+ }
684
687
  } catch (_error) {}
685
688
  return svgRenderer.d3 !== undefined;
686
689
  };
@@ -157,7 +157,7 @@ var svg_vectorFeature = function (arg) {
157
157
  .each(function (d) {
158
158
  var marker = d3.select(this);
159
159
  var markerData = d.head ? markerConfigs[endStyle(d.data, d.dataIndex)] : markerConfigs[originStyle(d.data, d.dataIndex)];
160
- Object.keys(markerData.attrs).map(function (attrName) {
160
+ Object.keys(markerData.attrs).forEach(function (attrName) {
161
161
  marker.attr(attrName, markerData.attrs[attrName]);
162
162
  });
163
163
  })
package/src/tile.js CHANGED
@@ -144,7 +144,7 @@ var tile = function (spec) {
144
144
  };
145
145
 
146
146
  /**
147
- * Return a unique string representation of the given tile useble as a hash
147
+ * Return a unique string representation of the given tile usable as a hash
148
148
  * key. Possibly extend later to include url information to make caches
149
149
  * aware of the tile source.
150
150
  *
package/src/tileLayer.js CHANGED
@@ -121,10 +121,10 @@ function m_getTileSubdomain(x, y, z, subdomains) {
121
121
  * @private.
122
122
  */
123
123
  function m_tileUrlFromTemplate(base) {
124
- var xPattern = new RegExp(/\$?\{[xX]\}/g),
125
- yPattern = new RegExp(/\$?\{[yY]\}/g),
126
- zPattern = new RegExp(/\$?\{[zZ]\}/g),
127
- sPattern = new RegExp(/\$?\{(s|S|[sS]:[^{}]+|[^-{}]-[^-{}]|([^,{}]+,)+[^,{}]+)\}/);
124
+ var xPattern = /\$?\{[xX]\}/g,
125
+ yPattern = /\$?\{[yY]\}/g,
126
+ zPattern = /\$?\{[zZ]\}/g,
127
+ sPattern = /\$?\{(s|S|[sS]:[^{}]+|[^-{}]-[^-{}]|([^,{}]+,)+[^,{}]+)\}/;
128
128
  var url = base
129
129
  .replace(new RegExp(sPattern, 'g'), '{s}')
130
130
  .replace(xPattern, '{x}')
@@ -228,21 +228,21 @@ var trackFeature = function (arg) {
228
228
  if (d.posidx1 === undefined) {
229
229
  pos = m_tracks.positionFunc(tracks[i][d.posidx], d.posidx, tracks[i], i);
230
230
  } else {
231
- pos0 = trans.forward(m_tracks.positionFunc(tracks[i][d.posidx0], d.posidx0, tracks[i], i));
232
- pos1 = trans.forward(m_tracks.positionFunc(tracks[i][d.posidx1], d.posidx1, tracks[i], i));
231
+ pos0 = trans.forward(m_tracks.positionFunc(tracks[i][d.posidx0], d.posidx0, tracks[i], i), true);
232
+ pos1 = trans.forward(m_tracks.positionFunc(tracks[i][d.posidx1], d.posidx1, tracks[i], i), true);
233
233
  pos = trans.inverse({
234
234
  x: pos0.x * d.factor0 + pos1.x * d.factor1,
235
235
  y: pos0.y * d.factor0 + pos1.y * d.factor1,
236
236
  z: (pos0.z || 0) * d.factor0 + (pos1.z || 0) * d.factor1
237
- });
237
+ }, true);
238
238
  }
239
239
  d.x = pos.x;
240
240
  d.y = pos.y;
241
241
  d.z = pos.z || 0;
242
242
  if (calcAngle) {
243
243
  if (d.posidx1 === undefined) {
244
- pos0 = trans.forward(d.angidx0 === d.posidx ? pos : m_tracks.positionFunc(tracks[i][d.angidx0], d.angidx0, tracks[i], i));
245
- pos1 = trans.forward(d.angidx1 === d.posidx ? pos : m_tracks.positionFunc(tracks[i][d.angidx1], d.angidx1, tracks[i], i));
244
+ pos0 = trans.forward(d.angidx0 === d.posidx ? pos : m_tracks.positionFunc(tracks[i][d.angidx0], d.angidx0, tracks[i], i), true);
245
+ pos1 = trans.forward(d.angidx1 === d.posidx ? pos : m_tracks.positionFunc(tracks[i][d.angidx1], d.angidx1, tracks[i], i), true);
246
246
  }
247
247
  d.angle = Math.atan2(pos1.y - pos0.y, pos1.x - pos0.x);
248
248
  }
@@ -319,25 +319,25 @@ var trackFeature = function (arg) {
319
319
  });
320
320
  if (hasMarker && !m_markerFeature) {
321
321
  if (!(registry.registries.features[m_this.layer().rendererName()] || {}).marker) {
322
- let renderer = registry.rendererForFeatures(['marker']);
322
+ const renderer = registry.rendererForFeatures(['marker']);
323
323
  m_markerLayer = registry.createLayer('feature', m_this.layer().map(), {renderer: renderer});
324
324
  m_this.layer().addChild(m_markerLayer);
325
325
  m_this.layer().node().append(m_markerLayer.node());
326
326
  }
327
327
  m_markerFeature = (m_markerLayer || m_this.layer()).createFeature('marker');
328
- let df = m_this.dependentFeatures();
328
+ const df = m_this.dependentFeatures();
329
329
  df.push(m_markerFeature);
330
330
  m_this.dependentFeatures(df);
331
331
  }
332
332
  if (hasText && !m_textFeature) {
333
333
  if (!(registry.registries.features[m_this.layer().rendererName()] || {}).text) {
334
- let renderer = registry.rendererForFeatures(['text']);
334
+ const renderer = registry.rendererForFeatures(['text']);
335
335
  m_textLayer = registry.createLayer('feature', m_this.layer().map(), {renderer: renderer});
336
336
  m_this.layer().addChild(m_textLayer);
337
337
  m_this.layer().node().append(m_textLayer.node());
338
338
  }
339
339
  m_textFeature = (m_textLayer || m_this.layer()).createFeature('text');
340
- let df = m_this.dependentFeatures();
340
+ const df = m_this.dependentFeatures();
341
341
  df.push(m_textFeature);
342
342
  m_this.dependentFeatures(df);
343
343
  }
@@ -348,7 +348,7 @@ var trackFeature = function (arg) {
348
348
  .gcs(m_this.gcs())
349
349
  .data(data)
350
350
  .position(m_this._headPosition);
351
- let radiusFunc = m_markerFeature.style.get('radius');
351
+ const radiusFunc = m_markerFeature.style.get('radius');
352
352
  m_markerFeature.style('radius', (d, i) => {
353
353
  if (m_tracks.text[i] || m_tracks.startPosition[i].posidx < 0) {
354
354
  return 0;
@@ -728,7 +728,7 @@ var trackFeature = function (arg) {
728
728
  * if the point was found in the current part of the track.
729
729
  */
730
730
  this.pointSearch = function (p) {
731
- let result = m_lineFeatures.current.pointSearch(p),
731
+ const result = m_lineFeatures.current.pointSearch(p),
732
732
  past = m_lineFeatures.past.pointSearch(p),
733
733
  future = m_lineFeatures.future.pointSearch(p),
734
734
  marker = m_markerFeature ? m_markerFeature.pointSearch(p) : {index: []};
@@ -759,7 +759,7 @@ var trackFeature = function (arg) {
759
759
  * the current part of the track.
760
760
  */
761
761
  this.polygonSearch = function (poly, opts) {
762
- let result = m_lineFeatures.current.polygonSearch(poly, opts),
762
+ const result = m_lineFeatures.current.polygonSearch(poly, opts),
763
763
  past = m_lineFeatures.past.polygonSearch(poly, opts),
764
764
  future = m_lineFeatures.future.polygonSearch(poly, opts),
765
765
  marker = m_markerFeature ? m_markerFeature.polygonSearch(poly, opts) : {index: []};
package/src/transform.js CHANGED
@@ -19,8 +19,8 @@ var maxTransformCacheSize = 10;
19
19
 
20
20
  /* A RegExp to detect if two transforms only different by the middle axis's
21
21
  * direction. */
22
- var axisPattern = new RegExp('^(.* |)\\+axis=e(n|s)u(| .*)$');
23
- var affinePattern = new RegExp(/(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/);
22
+ var axisPattern = /^(.* |)\\+axis=e(n|s)u(| .*)$/;
23
+ var affinePattern = /(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/;
24
24
 
25
25
  /**
26
26
  * This purpose of this class is to provide a generic interface for computing
@@ -49,13 +49,13 @@ var transform = function (options) {
49
49
  if (!(this instanceof transform)) {
50
50
  options = options || {};
51
51
  if (!(options.source in transformCache)) {
52
- if (Object.size(transformCache) >= maxTransformCacheSize) {
52
+ if (Object.keys(transformCache).length >= maxTransformCacheSize) {
53
53
  transformCache = {};
54
54
  }
55
55
  transformCache[options.source] = {};
56
56
  }
57
57
  if (!(options.target in transformCache[options.source])) {
58
- if (Object.size(transformCache[options.source]) >= maxTransformCacheSize) {
58
+ if (Object.keys(transformCache[options.source]).length >= maxTransformCacheSize) {
59
59
  transformCache[options.source] = {};
60
60
  }
61
61
  transformCache[options.source][options.target] = new transform(options);
@@ -193,7 +193,7 @@ var transform = function (options) {
193
193
  var mp = vec3.transformMat4(util.vec3AsArray(), [point.x, point.y, point.z || 0], m_source_matrix_inv);
194
194
  point = {x: mp[0], y: mp[1], z: mp[2]};
195
195
  }
196
- var pt = m_proj.forward(point);
196
+ var pt = m_proj.forward(point, true);
197
197
  pt.z = point.z || 0;
198
198
  if (m_target_matrix) {
199
199
  var ip = vec3.transformMat4(util.vec3AsArray(), [pt.x, pt.y, pt.z], m_target_matrix);
@@ -214,7 +214,7 @@ var transform = function (options) {
214
214
  var mp = vec3.transformMat4(util.vec3AsArray(), [point.x, point.y, point.z || 0], m_target_matrix_inv);
215
215
  point = {x: mp[0], y: mp[1], z: mp[2]};
216
216
  }
217
- var pt = m_proj.inverse(point);
217
+ var pt = m_proj.inverse(point, true);
218
218
  pt.z = point.z || 0;
219
219
  if (m_source_matrix) {
220
220
  var ip = vec3.transformMat4(util.vec3AsArray(), [pt.x, pt.y, pt.z], m_source_matrix);
@@ -359,7 +359,7 @@ transform.transformCoordinates = function (srcPrj, tgtPrj, coordinates, numberOf
359
359
  }
360
360
  var trans = transform({source: srcPrj, target: tgtPrj}), output;
361
361
  if (util.isObject(coordinates) && 'x' in coordinates && 'y' in coordinates) {
362
- output = trans.forward({x: +coordinates.x, y: +coordinates.y, z: +coordinates.z || 0});
362
+ output = trans.forward({x: +coordinates.x, y: +coordinates.y, z: +coordinates.z || 0}, true);
363
363
  if ('z' in coordinates) {
364
364
  return output;
365
365
  }
@@ -368,7 +368,7 @@ transform.transformCoordinates = function (srcPrj, tgtPrj, coordinates, numberOf
368
368
  if (Array.isArray(coordinates) && coordinates.length === 1 &&
369
369
  util.isObject(coordinates[0]) && 'x' in coordinates[0] &&
370
370
  'y' in coordinates[0]) {
371
- output = trans.forward({x: +coordinates[0].x, y: +coordinates[0].y, z: +coordinates[0].z || 0});
371
+ output = trans.forward({x: +coordinates[0].x, y: +coordinates[0].y, z: +coordinates[0].z || 0}, true);
372
372
  if ('z' in coordinates[0]) {
373
373
  return [output];
374
374
  }
@@ -549,7 +549,7 @@ transform.transformCoordinatesArray = function (trans, coordinates, numberOfComp
549
549
  initPoint.x = xAcc(i);
550
550
  initPoint.y = yAcc(i);
551
551
  initPoint.z = zAcc(i);
552
- projPoint = trans.forward(initPoint);
552
+ projPoint = trans.forward(initPoint, true);
553
553
  writer(i, projPoint.x, projPoint.y, projPoint.z);
554
554
  }
555
555
  return output;
@@ -582,11 +582,12 @@ transform.transformCoordinatesFlatArray3 = function (srcPrj, tgtPrj, coordinates
582
582
  var src = proj4.Proj(srcPrj),
583
583
  tgt = proj4.Proj(tgtPrj),
584
584
  projPoint, initPoint = {};
585
+ const trans = new proj4(src, tgt);
585
586
  for (i = coordinates.length - 3; i >= 0; i -= 3) {
586
587
  initPoint.x = +coordinates[i];
587
588
  initPoint.y = +coordinates[i + 1];
588
589
  initPoint.z = +(coordinates[i + 2] || 0.0);
589
- projPoint = proj4.transform(src, tgt, initPoint);
590
+ projPoint = trans.forward(initPoint, true);
590
591
  coordinates[i] = projPoint.x;
591
592
  coordinates[i + 1] = projPoint.y;
592
593
  coordinates[i + 2] = projPoint.z === undefined ? initPoint.z : projPoint.z;
@@ -109,10 +109,10 @@ var colorLegendWidget = function (arg) {
109
109
  var legendSvg = legendContainer
110
110
  .append('svg')
111
111
  .attr({
112
- 'class': 'svg',
113
- 'width': width,
114
- 'height': '40px',
115
- 'viewBox': -margin + ' 0 ' + width + ' 40'
112
+ class: 'svg',
113
+ width: width,
114
+ height: '40px',
115
+ viewBox: -margin + ' 0 ' + width + ' 40'
116
116
  });
117
117
 
118
118
  if (category.type === 'discrete') {
@@ -402,9 +402,9 @@ var colorLegendWidget = function (arg) {
402
402
  m_this.popup
403
403
  .style({
404
404
  // If the popup will be longer or almost longer than the container
405
- 'left': offset[0] - (offset[0] +
405
+ left: offset[0] - (offset[0] +
406
406
  popupWidth - containerWidth > -10 ? popupWidth : 0) + 'px',
407
- 'top': (offset[1] - 22) + 'px'
407
+ top: (offset[1] - 22) + 'px'
408
408
  })
409
409
  .transition()
410
410
  .duration(200)
@@ -27,7 +27,7 @@
27
27
  stroke-width 0.7
28
28
  text
29
29
  font-size 12px
30
-
30
+
31
31
  .color-legend-popup
32
32
  position absolute
33
33
  background white
@@ -251,11 +251,11 @@ var legendWidget = function (arg) {
251
251
  .attr('rx', 3)
252
252
  .attr('ry', 3)
253
253
  .style({
254
- 'stroke': 'black',
254
+ stroke: 'black',
255
255
  'stroke-width': '1.5px',
256
- 'fill': 'white',
256
+ fill: 'white',
257
257
  'fill-opacity': 0.75,
258
- 'display': 'none'
258
+ display: 'none'
259
259
  });
260
260
  m_group.on('mousedown', function () {
261
261
  d3.event.stopPropagation();
@@ -131,7 +131,7 @@ var sliderWidget = function (arg) {
131
131
  .attr('cy', m_yscale(0.0) - m_width + 2)
132
132
  .attr('r', (m_width - 2) / 2)
133
133
  .style({
134
- 'cursor': 'pointer'
134
+ cursor: 'pointer'
135
135
  })
136
136
  .on('click', function () {
137
137
  var z = map.zoom();
@@ -171,7 +171,7 @@ var sliderWidget = function (arg) {
171
171
  .attr('cy', m_yscale(1.0) + m_width - 2)
172
172
  .attr('r', (m_width - 2) / 2)
173
173
  .style({
174
- 'cursor': 'pointer'
174
+ cursor: 'pointer'
175
175
  })
176
176
  .on('click', function () {
177
177
  var z = map.zoom();
@@ -237,7 +237,7 @@ var sliderWidget = function (arg) {
237
237
  .attr('width', m_width / 3)
238
238
  .attr('height', m_height - m_width * 3)
239
239
  .style({
240
- 'cursor': 'pointer'
240
+ cursor: 'pointer'
241
241
  })
242
242
  .on('click', function () {
243
243
  respond(d3.event, true);
@@ -257,7 +257,7 @@ var sliderWidget = function (arg) {
257
257
  .attr('width', m_width)
258
258
  .attr('height', m_nubSize)
259
259
  .style({
260
- 'cursor': 'pointer'
260
+ cursor: 'pointer'
261
261
  })
262
262
  .on('mousedown', function () {
263
263
  d3.select(document).on('mousemove.geo.slider', function () {
@@ -686,11 +686,11 @@ var util = {
686
686
  * @memberof geo.util
687
687
  */
688
688
  distanceToPolygon2d: function (pt, poly, onlySign) {
689
- let outer = poly.outer || poly;
689
+ const outer = poly.outer || poly;
690
690
  let inside = false,
691
- minDistSq, distSq, dist;
691
+ minDistSq, distSq;
692
692
  for (let i = 0, len = outer.length, j = len - 1; i < len; j = i, i += 1) {
693
- let p0 = outer[i],
693
+ const p0 = outer[i],
694
694
  p1 = outer[j];
695
695
  if (((p0.y > pt.y) !== (p1.y > pt.y)) && (pt.x < (p1.x - p0.x) * (pt.y - p0.y) / (p1.y - p0.y) + p0.x)) {
696
696
  inside = !inside;
@@ -702,7 +702,7 @@ var util = {
702
702
  }
703
703
  if (poly.inner) {
704
704
  poly.inner.forEach(inner => {
705
- let innerDist = util.distanceToPolygon2d(pt, inner, onlySign);
705
+ const innerDist = util.distanceToPolygon2d(pt, inner, onlySign);
706
706
  if (innerDist * innerDist < minDistSq) {
707
707
  minDistSq = innerDist * innerDist;
708
708
  }
@@ -711,7 +711,7 @@ var util = {
711
711
  }
712
712
  });
713
713
  }
714
- dist = (inside ? 1 : -1) * Math.sqrt(minDistSq);
714
+ const dist = (inside ? 1 : -1) * Math.sqrt(minDistSq);
715
715
  return dist;
716
716
  },
717
717
 
@@ -738,8 +738,8 @@ var util = {
738
738
  * @memberof geo.util
739
739
  */
740
740
  crossedLineSegmentPolygon2d: function (pt1, pt2, poly) {
741
- let outer = poly.outer || poly,
742
- len = outer.length, i, j;
741
+ const outer = poly.outer || poly, len = outer.length;
742
+ let i, j;
743
743
  for (i = 0, j = len - 1; i < len; j = i, i += 1) {
744
744
  if (util.crossedLineSegments2d(pt1, pt2, outer[i], outer[j])) {
745
745
  return true;
@@ -817,6 +817,7 @@ var util = {
817
817
  if (idx) {
818
818
  return util.crossedLineSegments2d(pt1, pt2, line[idx - 1], linePt);
819
819
  }
820
+ return false;
820
821
  });
821
822
  });
822
823
  return result;
@@ -1166,7 +1167,7 @@ var util = {
1166
1167
  /* Create a containing div with the parent's class and id (so css
1167
1168
  * will be used), but override size and background. */
1168
1169
  container = $('<div>').attr({
1169
- 'class': parent.attr('class'),
1170
+ class: parent.attr('class'),
1170
1171
  id: parent.attr('id')
1171
1172
  }).css({
1172
1173
  width: '100%',
@@ -1,8 +1,6 @@
1
1
  /* eslint-disable camelcase */
2
- /* eslint-disable underscore/prefer-constant */
3
2
 
4
3
  var $ = require('jquery');
5
- var vgl = require('vgl');
6
4
  var webglRenderer = require('../webgl/webglRenderer');
7
5
 
8
6
  var _renderWindow, _supported;
@@ -191,6 +189,8 @@ module.exports.mockWebglRenderer = function mockWebglRenderer(supported) {
191
189
  * @alias geo.util.restoreWebglRenderer
192
190
  */
193
191
  module.exports.restoreWebglRenderer = function () {
192
+ var vgl = require('vgl');
193
+
194
194
  if (vgl._mocked) {
195
195
  vgl.renderWindow = _renderWindow;
196
196
  webglRenderer.supported = _supported;
@@ -112,9 +112,9 @@ var throttle = function (delay, no_trailing, callback, accumulator, debounce_mod
112
112
  }
113
113
 
114
114
  // Clear any existing timeout.
115
- void (
116
- timeout_id && clearTimeout(timeout_id)
117
- );
115
+ if (timeout_id) {
116
+ clearTimeout(timeout_id);
117
+ }
118
118
 
119
119
  if (debounce_mode === undefined && elapsed > delay) {
120
120
  // In throttle mode, if `delay` time has been exceeded, execute
package/src/vendor.js CHANGED
@@ -5,8 +5,6 @@
5
5
  * @license BSD-3-Clause
6
6
  */
7
7
 
8
- require('./polyfills');
9
-
10
8
  var globals = {
11
9
  d3: require('d3'),
12
10
  hammerjs: require('hammerjs')
@@ -76,7 +76,7 @@ var vtkjs_pointFeature = function (arg) {
76
76
  */
77
77
  this._init = function () {
78
78
  s_init.call(m_this, arg);
79
- m_this.renderer().contextRenderer().setLayer(1);
79
+ m_this.renderer().contextRenderer().setLayer(0);
80
80
  m_this._createPipeline();
81
81
  };
82
82
 
@@ -184,6 +184,9 @@ vtkjsRenderer.supported = function () {
184
184
  if ((!vtkjsRenderer.vtkjs || !vtkjsRenderer.vtkjs.Rendering) && window.vtk && window.vtk.Rendering) {
185
185
  vtkjsRenderer.vtkjs = window.vtk;
186
186
  }
187
+ if (!vtkjsRenderer.vtkjs || !vtkjsRenderer.vtkjs.Rendering) {
188
+ vtkjsRenderer.vtkjs = undefined;
189
+ }
187
190
  return vtkjsRenderer.vtkjs !== undefined;
188
191
  };
189
192
 
@@ -141,7 +141,7 @@ var webgl_layer = function () {
141
141
  opacity,
142
142
  lowerTileLayers;
143
143
  layers.forEach(function (layer) {
144
- let autoshare = layer.autoshareRenderer(),
144
+ const autoshare = layer.autoshareRenderer(),
145
145
  isTileLayer = layer instanceof tileLayer;
146
146
  if (!autoshare || !layer.renderer() || layer.renderer().api() !== webglRenderer.apiname) {
147
147
  renderer = null;
@@ -129,7 +129,7 @@ var webgl_markerFeature = function (arg) {
129
129
 
130
130
  posFunc = m_this.position();
131
131
 
132
- for (let key in styleKeys) {
132
+ for (const key in styleKeys) {
133
133
  styleFunc[key] = m_this.style.get(key);
134
134
  if (!util.isFunction(m_this.style(key))) {
135
135
  styleUni[key] = styleFunc[key]();
@@ -183,7 +183,7 @@ var webgl_markerFeature = function (arg) {
183
183
  }
184
184
  }
185
185
  // unrolling this would speed it up
186
- for (let key in styleKeys) {
186
+ for (const key in styleKeys) {
187
187
  styleVal[key] = styleUni[key] === undefined ? styleFunc[key](item, i) : styleUni[key];
188
188
  }
189
189
  styleVal.scaleWithZoom = markerFeature.scaleMode[styleVal.scaleWithZoom] || (styleVal.scaleWithZoom >= 1 && styleVal.scaleWithZoom <= 3 ? styleVal.scaleWithZoom : 0);
@@ -219,7 +219,7 @@ var webgl_markerFeature = function (arg) {
219
219
  }
220
220
 
221
221
  if (m_this._primitiveShapeAuto) {
222
- let maxr = m_this._approximateMaxRadius(m_this.renderer().map().zoom());
222
+ const maxr = m_this._approximateMaxRadius(m_this.renderer().map().zoom());
223
223
  if ((m_this._primitiveShape === markerFeature.primitiveShapes.sprite && maxr > webglRenderer._maxPointSize) ||
224
224
  (m_this._primitiveShape !== markerFeature.primitiveShapes.sprite && maxr <= webglRenderer._maxPointSize)) {
225
225
  // Switch primitive
@@ -339,7 +339,7 @@ var webgl_markerFeature = function (arg) {
339
339
  needsRefresh = true;
340
340
  }
341
341
  if (key === sbkey) {
342
- let mod = m_this.modified;
342
+ const mod = m_this.modified;
343
343
  if (!needsRefresh) {
344
344
  // don't allow modified to be adjusted if we don't need to refresh
345
345
  m_this.modified = () => {};
@@ -140,11 +140,11 @@ var webgl_meshColored = function (arg) {
140
140
  posAttr = vgl.vertexAttribute('pos'),
141
141
  valueAttr = vgl.vertexAttribute('value'),
142
142
  opacityAttr = vgl.vertexAttribute('opacity'),
143
- sourcePositions = vgl.sourceDataP3fv({'name': 'pos'}),
143
+ sourcePositions = vgl.sourceDataP3fv({name: 'pos'}),
144
144
  sourceValues = vgl.sourceDataAnyfv(
145
- 1, vgl.vertexAttributeKeysIndexed.One, {'name': 'value'}),
145
+ 1, vgl.vertexAttributeKeysIndexed.One, {name: 'value'}),
146
146
  sourceOpacity = vgl.sourceDataAnyfv(
147
- 1, vgl.vertexAttributeKeysIndexed.Two, {'name': 'opacity'}),
147
+ 1, vgl.vertexAttributeKeysIndexed.Two, {name: 'opacity'}),
148
148
  primitive = new vgl.triangles();
149
149
  m_modelViewUniform = new vgl.modelViewOriginUniform('modelViewMatrix');
150
150
 
@@ -321,7 +321,7 @@ var webgl_pointFeature = function (arg) {
321
321
  } else {
322
322
  needsRefresh = true;
323
323
  }
324
- let mod = m_this.modified;
324
+ const mod = m_this.modified;
325
325
  if (!needsRefresh) {
326
326
  // don't allow modified to be adjusted if we don't need to refresh
327
327
  m_this.modified = () => {};
@@ -362,25 +362,25 @@ var webgl_pointFeature = function (arg) {
362
362
  mat = vgl.material(),
363
363
  blend = vgl.blend(),
364
364
  geom = vgl.geometryData(),
365
- sourcePositions = vgl.sourceDataP3fv({'name': 'pos'}),
365
+ sourcePositions = vgl.sourceDataP3fv({name: 'pos'}),
366
366
  sourceUnits = vgl.sourceDataAnyfv(
367
- 2, vgl.vertexAttributeKeysIndexed.One, {'name': 'unit'}),
367
+ 2, vgl.vertexAttributeKeysIndexed.One, {name: 'unit'}),
368
368
  sourceRadius = vgl.sourceDataAnyfv(
369
- 1, vgl.vertexAttributeKeysIndexed.Two, {'name': 'radius'}),
369
+ 1, vgl.vertexAttributeKeysIndexed.Two, {name: 'radius'}),
370
370
  sourceStrokeWidth = vgl.sourceDataAnyfv(
371
- 1, vgl.vertexAttributeKeysIndexed.Three, {'name': 'strokeWidth'}),
371
+ 1, vgl.vertexAttributeKeysIndexed.Three, {name: 'strokeWidth'}),
372
372
  sourceFillColor = vgl.sourceDataAnyfv(
373
- 3, vgl.vertexAttributeKeysIndexed.Four, {'name': 'fillColor'}),
373
+ 3, vgl.vertexAttributeKeysIndexed.Four, {name: 'fillColor'}),
374
374
  sourceFill = vgl.sourceDataAnyfv(
375
- 1, vgl.vertexAttributeKeysIndexed.Five, {'name': 'fill'}),
375
+ 1, vgl.vertexAttributeKeysIndexed.Five, {name: 'fill'}),
376
376
  sourceStrokeColor = vgl.sourceDataAnyfv(
377
- 3, vgl.vertexAttributeKeysIndexed.Six, {'name': 'strokeColor'}),
377
+ 3, vgl.vertexAttributeKeysIndexed.Six, {name: 'strokeColor'}),
378
378
  sourceStroke = vgl.sourceDataAnyfv(
379
- 1, vgl.vertexAttributeKeysIndexed.Seven, {'name': 'stroke'}),
379
+ 1, vgl.vertexAttributeKeysIndexed.Seven, {name: 'stroke'}),
380
380
  sourceAlpha = vgl.sourceDataAnyfv(
381
- 1, vgl.vertexAttributeKeysIndexed.Eight, {'name': 'fillOpacity'}),
381
+ 1, vgl.vertexAttributeKeysIndexed.Eight, {name: 'fillOpacity'}),
382
382
  sourceStrokeOpacity = vgl.sourceDataAnyfv(
383
- 1, vgl.vertexAttributeKeysIndexed.Nine, {'name': 'strokeOpacity'}),
383
+ 1, vgl.vertexAttributeKeysIndexed.Nine, {name: 'strokeOpacity'}),
384
384
  primitive;
385
385
  m_modelViewUniform = new vgl.modelViewOriginUniform('modelViewMatrix', m_origin);
386
386
 
@@ -267,11 +267,11 @@ var webgl_polygonFeature = function (arg) {
267
267
  fragmentShader = createFragmentShader(),
268
268
  blend = vgl.blend(),
269
269
  geom = vgl.geometryData(),
270
- sourcePositions = vgl.sourceDataP3fv({'name': 'pos'}),
270
+ sourcePositions = vgl.sourceDataP3fv({name: 'pos'}),
271
271
  sourceFillColor = vgl.sourceDataAnyfv(
272
- 3, vgl.vertexAttributeKeysIndexed.Two, {'name': 'fillColor'}),
272
+ 3, vgl.vertexAttributeKeysIndexed.Two, {name: 'fillColor'}),
273
273
  sourceFillOpacity = vgl.sourceDataAnyfv(
274
- 1, vgl.vertexAttributeKeysIndexed.Three, {'name': 'fillOpacity'}),
274
+ 1, vgl.vertexAttributeKeysIndexed.Three, {name: 'fillOpacity'}),
275
275
  trianglePrimitive = vgl.triangles();
276
276
  m_modelViewUniform = new vgl.modelViewOriginUniform('modelViewMatrix');
277
277
 
@@ -12,4 +12,3 @@ void main(void) {
12
12
  gl_Position.z += zOffset;
13
13
  iVertexColor = vertexColor;
14
14
  }
15
-
@@ -271,8 +271,7 @@ var webglRenderer = function (arg) {
271
271
 
272
272
  // Connect to pan event. This is sufficient, as all zooms and rotations also
273
273
  // produce a pan
274
- m_this.layer().geoOn(geo_event.pan, function (evt) {
275
- void (evt);
274
+ m_this.layer().geoOn(geo_event.pan, function (_evt) {
276
275
  m_updateCamera = true;
277
276
  });
278
277
 
package/src/polyfills.js DELETED
@@ -1,4 +0,0 @@
1
- // prevent errors from double inclusion in downstream libraries
2
- if (!global._babelPolyfill) {
3
- require('babel-polyfill');
4
- }