globe.gl 2.24.4 → 2.25.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.
@@ -188,10 +188,10 @@ var three = window.THREE ? window.THREE // Prefer consumption from global THREE,
188
188
  // Expose config from ThreeGlobe
189
189
 
190
190
  var bindGlobe = linkKapsule('globe', ThreeGlobe);
191
- var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'globeMaterial', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
191
+ var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'globeMaterial', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
192
192
  return _defineProperty({}, p, bindGlobe.linkProp(p));
193
193
  })));
194
- var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['getCoords', 'toGeoCoords'].map(function (p) {
194
+ var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
195
195
  return _defineProperty({}, p, bindGlobe.linkMethod(p));
196
196
  }))); // Expose config from renderObjs
197
197
 
@@ -316,6 +316,19 @@ var globe = Kapsule({
316
316
  onLabelHover: {
317
317
  triggerUpdate: false
318
318
  },
319
+ objectLabel: {
320
+ "default": 'name',
321
+ triggerUpdate: false
322
+ },
323
+ onObjectClick: {
324
+ triggerUpdate: false
325
+ },
326
+ onObjectRightClick: {
327
+ triggerUpdate: false
328
+ },
329
+ onObjectHover: {
330
+ triggerUpdate: false
331
+ },
319
332
  customLayerLabel: {
320
333
  "default": 'name',
321
334
  triggerUpdate: false
@@ -466,6 +479,7 @@ var globe = Kapsule({
466
479
  this.hexPolygonsData([]);
467
480
  this.tilesData([]);
468
481
  this.labelsData([]);
482
+ this.objectsData([]);
469
483
  this.customLayerData([]);
470
484
  }
471
485
  }, linkedGlobeMethods), linkedRenderObjsMethods),
@@ -563,6 +577,9 @@ var globe = Kapsule({
563
577
  label: function label(d) {
564
578
  return d;
565
579
  },
580
+ object: function object(d) {
581
+ return d;
582
+ },
566
583
  custom: function custom(d) {
567
584
  return d;
568
585
  }
@@ -588,6 +605,7 @@ var globe = Kapsule({
588
605
  hexPolygon: state.hexPolygonLabel,
589
606
  tile: state.tileLabel,
590
607
  label: state.labelLabel,
608
+ object: state.objectLabel,
591
609
  custom: state.customLayerLabel
592
610
  };
593
611
  var globeObj = getGlobeObj(obj);
@@ -604,6 +622,7 @@ var globe = Kapsule({
604
622
  hexPolygon: state.onHexPolygonHover,
605
623
  tile: state.onTileHover,
606
624
  label: state.onLabelHover,
625
+ object: state.onObjectHover,
607
626
  custom: state.onCustomLayerHover
608
627
  };
609
628
  var clickObjFns = {
@@ -616,6 +635,7 @@ var globe = Kapsule({
616
635
  hexPolygon: state.onHexPolygonClick,
617
636
  tile: state.onTileClick,
618
637
  label: state.onLabelClick,
638
+ object: state.onObjectClick,
619
639
  custom: state.onCustomLayerClick
620
640
  };
621
641
  var hoverObj = getGlobeObj(obj); // ignore non-recognised obj types
@@ -656,6 +676,7 @@ var globe = Kapsule({
656
676
  hexPolygon: state.onHexPolygonClick,
657
677
  tile: state.onTileClick,
658
678
  label: state.onLabelClick,
679
+ object: state.onObjectClick,
659
680
  custom: state.onCustomLayerClick
660
681
  };
661
682
  var globeObj = getGlobeObj(obj);
@@ -694,6 +715,7 @@ var globe = Kapsule({
694
715
  hexPolygon: state.onHexPolygonRightClick,
695
716
  tile: state.onTileRightClick,
696
717
  label: state.onLabelRightClick,
718
+ object: state.onObjectRightClick,
697
719
  custom: state.onCustomLayerRightClick
698
720
  };
699
721
  var globeObj = getGlobeObj(obj);
package/example/.DS_Store CHANGED
Binary file
@@ -21,14 +21,13 @@
21
21
  world.controls().autoRotateSpeed = 0.35;
22
22
 
23
23
  // Add clouds sphere
24
- const GLOBE_RADIUS = 100;
25
24
  const CLOUDS_IMG_URL = './clouds.png'; // from https://github.com/turban/webgl-earth
26
25
  const CLOUDS_ALT = 0.004;
27
26
  const CLOUDS_ROTATION_SPEED = -0.006; // deg/frame
28
27
 
29
28
  new THREE.TextureLoader().load(CLOUDS_IMG_URL, cloudsTexture => {
30
29
  const clouds = new THREE.Mesh(
31
- new THREE.SphereBufferGeometry(GLOBE_RADIUS * (1 + CLOUDS_ALT), 75, 75),
30
+ new THREE.SphereBufferGeometry(world.getGlobeRadius() * (1 + CLOUDS_ALT), 75, 75),
32
31
  new THREE.MeshPhongMaterial({ map: cloudsTexture, transparent: true })
33
32
  );
34
33
  world.scene().add(clouds);