globe.gl 2.38.1 → 2.39.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/README.md CHANGED
@@ -86,6 +86,7 @@ const myGlobe = new Globe(myDOMElement)
86
86
  * [Hex Bin Layer](#hex-bin-layer)
87
87
  * [Hexed Polygons Layer](#hexed-polygons-layer)
88
88
  * [Tiles Layer](#tiles-layer)
89
+ * [Particles Layer](#particles-layer)
89
90
  * [Rings Layer](#rings-layer)
90
91
  * [Labels Layer](#labels-layer)
91
92
  * [HTML Elements Layer](#html-elements-layer)
@@ -326,6 +327,28 @@ new Globe(<domElement>, { configOptions })
326
327
  | <b>onTileRightClick</b>(<i>fn</i>) | Callback function for tile right-clicks. The tile object, the event object and the clicked coordinates are included as arguments: `onTileRightClick(tile, event, { lat, lng, altitude })`. | - |
327
328
  | <b>onTileHover</b>(<i>fn</i>) | Callback function for tile mouse over events. The tile object (or `null` if there's no tile under the mouse line of sight) is included as the first argument, and the previous tile object (or `null`) as second argument: `onTileHover(tile, prevTile)`. | - |
328
329
 
330
+ ### Particles Layer
331
+
332
+ <p align="center">
333
+ <a href="//vasturiano.github.io/globe.gl/example/satellites/"><img width="70%" src="https://vasturiano.github.io/globe.gl/example/satellites/preview.png"></a>
334
+ </p>
335
+
336
+ | Method | Description | Default |
337
+ | --- | --- | :--: |
338
+ | <b>particlesData</b>([<i>array</i>]) | Getter/setter for the list of particle sets to represent in the particles map layer. Each particle set is displayed as a group of [Points](https://threejs.org/docs/#api/en/objects/Points). Each point in the group is a geometry vertex and can be individually positioned anywhere relative to the globe. | `[]` |
339
+ | <b>particlesList</b>([<i>str</i> or <i>fn</i>]) | Particle set accessor function or attribute for the list of particles in the set. By default, the data structure is expected to be an array of arrays of individual particle objects. | `d => d` |
340
+ | <b>particleLabel</b>([<i>str</i> or <i>fn</i>]) | Particle object accessor function or attribute for label (shown as tooltip). Supports plain text, HTML string content or an [HTML element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). | `name` |
341
+ | <b>particleLat</b>([<i>num</i>, <i>str</i> or <i>fn</i>]) | Particle object accessor function, attribute or a numeric constant for the latitude coordinate. | `lat` |
342
+ | <b>particleLng</b>([<i>num</i>, <i>str</i> or <i>fn</i>]) | Particle object accessor function, attribute or a numeric constant for the longitude coordinate. | `lng` |
343
+ | <b>particleAltitude</b>([<i>num</i>, <i>str</i> or <i>fn</i>]) | Particle object accessor function, attribute or a numeric constant for the altitude in terms of globe radius units. | 0.01 |
344
+ | <b>particlesSize</b>([<i>num</i>, <i>str</i> or <i>fn</i>]) | Particle set accessor function, attribute or a numeric constant for the size of all the particles in the group. | `0.5` |
345
+ | <b>particlesSizeAttenuation</b>([<i>boolean</i>, <i>str</i> or <i>fn</i>]) | Particle set accessor function, attribute or a boolean constant for whether the size of each particle on the screen should be attenuated according to the distance to the camera. | `true` |
346
+ | <b>particlesColor</b>([<i>str</i> or <i>fn</i>]) | Particle set accessor function or attribute for the color of all the particles in the group. This setting will be ignored if `particlesTexture` is defined. | `white` |
347
+ | <b>particlesTexture</b>([<i>str</i> or <i>fn</i>]) | Particle set accessor function or attribute for the [Texture](https://threejs.org/docs/#api/en/textures/Texture) to be applied to all the particles in the group. | - |
348
+ | <b>onParticleClick</b>(<i>fn</i>) | Callback function for particle (left-button) clicks. The particle object, the event object and the clicked coordinates are included as arguments: `onParticleClick(particle, event, { lat, lng, altitude })`. | - |
349
+ | <b>onParticleRightClick</b>(<i>fn</i>) | Callback function for particle right-clicks. The particle object, the event object and the clicked coordinates are included as arguments: `onParticleRightClick(particle, event, { lat, lng, altitude })`. | - |
350
+ | <b>onParticleHover</b>(<i>fn</i>) | Callback function for particle mouse over events. The particle object (or `null` if there's no particle under the mouse line of sight) is included as the first argument, and the previous particle object (or `null`) as second argument: `onParticleHover(particle, prevParticle)`. | - |
351
+
329
352
  ### Rings Layer
330
353
 
331
354
  <p align="center">
@@ -388,10 +411,6 @@ new Globe(<domElement>, { configOptions })
388
411
 
389
412
  ### 3D Objects Layer
390
413
 
391
- <p align="center">
392
- <a href="//vasturiano.github.io/globe.gl/example/satellites/"><img width="70%" src="https://vasturiano.github.io/globe.gl/example/satellites/preview.png"></a>
393
- </p>
394
-
395
414
  | Method | Description | Default |
396
415
  | --- | --- | :--: |
397
416
  | <b>objectsData</b>([<i>array</i>]) | Getter/setter for the list of custom 3D objects to represent in the objects layer. Each object is rendered according to the `objectThreeObject` method. | `[]` |
@@ -431,7 +450,7 @@ new Globe(<domElement>, { configOptions })
431
450
  | <b>resumeAnimation</b>() | Resumes the rendering cycle of the component, and re-enables the user interaction. This method can be used together with `pauseAnimation` for performance optimization purposes. | |
432
451
  | <b>enablePointerInteraction</b>([<i>boolean</i>]) | Getter/setter for whether to enable the mouse tracking events. This activates an internal tracker of the canvas mouse position and enables the functionality of object hover/click and tooltip labels, at the cost of performance. If you're looking for maximum gain in your globe performance it's recommended to switch off this property. | `true` |
433
452
  | <b>pointerEventsFilter</b>([<i>fn</i>]) | Getter/setter for the filter function which defines whether a particular object can be the target of pointer interactions. In general, objects that are closer to the camera get precedence in capturing pointer events. This function allows having ignored object layers so that pointer events can be passed through to deeper objects in the various globe layers. The ThreeJS object and its associated data (if any) are passed as arguments: `pointerEventsFilter(obj, data)`. The function should return a boolean value. | `() => true` |
434
- | <b>lineHoverPrecision</b>([<i>num</i>]) | Getter/setter for the precision to use when detecting hover events over [Line](https://threejs.org/docs/#api/objects/Line) objects, such as arcs and paths. | 0.2 |
453
+ | <b>lineHoverPrecision</b>([<i>num</i>]) | Getter/setter for the precision to use when detecting hover events over [Line](https://threejs.org/docs/#api/objects/Line) and [Points](https://threejs.org/docs/#api/objects/Points) objects, such as arcs, paths or particles. | 0.2 |
435
454
  | <b>onZoom</b>(<i>fn</i>) | Callback function for point-of-view changes by zooming or rotating the globe using the orbit controls. The current point of view (with the syntax `{ lat, lng, altitude }`) is included as sole argument. | |
436
455
  | <b>lights</b>([<i>array</i>]) | Getter/setter for the list of lights to use in the scene. Each item should be an instance of [Light](https://threejs.org/docs/#api/en/lights/Light). | [AmbientLight](https://threejs.org/docs/?q=ambient#api/en/lights/AmbientLight) + [DirectionalLight](https://threejs.org/docs/#api/en/lights/DirectionalLight) (from above) |
437
456
  | <b>scene</b>() | Access the internal ThreeJS [Scene](https://threejs.org/docs/#api/scenes/Scene). Can be used to extend the current scene with additional objects not related to globe.gl. | |
@@ -58,6 +58,8 @@ interface GlobeGenericInstance<ChainableInstance>
58
58
  hexLabel(textAccessor: Accessor<HexBin, Label>): ChainableInstance;
59
59
  tileLabel(): ObjAccessor<Label>;
60
60
  tileLabel(textAccessor: ObjAccessor<Label>): ChainableInstance;
61
+ particleLabel(): ObjAccessor<Label>;
62
+ particleLabel(textAccessor: ObjAccessor<Label>): ChainableInstance;
61
63
  labelLabel(): ObjAccessor<Label>;
62
64
  labelLabel(textAccessor: ObjAccessor<Label>): ChainableInstance;
63
65
  objectLabel(): ObjAccessor<Label>;
@@ -91,6 +93,9 @@ interface GlobeGenericInstance<ChainableInstance>
91
93
  onHexPolygonHover(callback: (polygon: object | null, prevPolygon: object | null) => void): ChainableInstance;
92
94
  onTileClick(callback: (tile: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
93
95
  onTileRightClick(callback: (tile: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
96
+ onParticleHover(callback: (particle: object | null, prevParticle: object | null) => void): ChainableInstance;
97
+ onParticleClick(callback: (particle: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
98
+ onParticleRightClick(callback: (particle: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
94
99
  onTileHover(callback: (tile: object | null, prevTile: object | null) => void): ChainableInstance;
95
100
  onLabelClick(callback: (label: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
96
101
  onLabelRightClick(callback: (label: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void): ChainableInstance;
package/dist/globe.gl.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 2.38.1 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.39.1 globe.gl - https://github.com/vasturiano/globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -134267,6 +134267,10 @@ var<${access}> ${name} : ${structName};`;
134267
134267
  "default": 1,
134268
134268
  triggerUpdate: false
134269
134269
  },
134270
+ pointsHoverPrecision: {
134271
+ "default": 1,
134272
+ triggerUpdate: false
134273
+ },
134270
134274
  hoverOrderComparator: {
134271
134275
  "default": function _default() {
134272
134276
  return -1;
@@ -134325,11 +134329,11 @@ var<${access}> ${name} : ${structName};`;
134325
134329
  });
134326
134330
  var topIntersect = intersects.length ? intersects[0] : null;
134327
134331
  topObject = topIntersect ? topIntersect.object : null;
134328
- state.intersectionPoint = topIntersect ? topIntersect.point : null;
134332
+ state.intersection = topIntersect || null;
134329
134333
  }
134330
134334
  if (topObject !== state.hoverObj) {
134331
- state.onHover(topObject, state.hoverObj);
134332
- state.tooltip.content(topObject ? index$2(state.tooltipContent)(topObject) || null : null);
134335
+ state.onHover(topObject, state.hoverObj, state.intersection);
134336
+ state.tooltip.content(topObject ? index$2(state.tooltipContent)(topObject, state.intersection) || null : null);
134333
134337
  state.hoverObj = topObject;
134334
134338
  }
134335
134339
  }
@@ -134472,6 +134476,7 @@ var<${access}> ${name} : ${structName};`;
134472
134476
  var relCoords = new three.Vector2(x / state.width * 2 - 1, -(y / state.height) * 2 + 1);
134473
134477
  var raycaster = new three.Raycaster();
134474
134478
  raycaster.params.Line.threshold = state.lineHoverPrecision; // set linePrecision
134479
+ raycaster.params.Points.threshold = state.pointsHoverPrecision; // set pointsPrecision
134475
134480
  raycaster.setFromCamera(relCoords, state.camera);
134476
134481
  return raycaster.intersectObjects(state.objects, true);
134477
134482
  },
@@ -134581,11 +134586,11 @@ var<${access}> ${name} : ${structName};`;
134581
134586
  // trigger click events asynchronously, to allow hoverObj to be set (on frame)
134582
134587
  if (ev.button === 0) {
134583
134588
  // left-click
134584
- state.onClick(state.hoverObj || null, ev, state.intersectionPoint); // trigger background clicks with null
134589
+ state.onClick(state.hoverObj || null, ev, state.intersection); // trigger background clicks with null
134585
134590
  }
134586
134591
  if (ev.button === 2 && state.onRightClick) {
134587
134592
  // right-click
134588
- state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint);
134593
+ state.onRightClick(state.hoverObj || null, ev, state.intersection);
134589
134594
  }
134590
134595
  });
134591
134596
  }, {
@@ -134771,7 +134776,7 @@ var<${access}> ${name} : ${structName};`;
134771
134776
 
134772
134777
  // Expose config from ThreeGlobe
134773
134778
  var bindGlobe = linkKapsule('globe', threeGlobe);
134774
- var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$7(['globeImageUrl', 'bumpImageUrl', 'globeTileEngineUrl', 'globeTileEngineMaxLevel', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', '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', 'heatmapsData', 'heatmapPoints', 'heatmapPointLat', 'heatmapPointLng', 'heatmapPointWeight', 'heatmapBandwidth', 'heatmapColorFn', 'heatmapColorSaturation', 'heatmapBaseAltitude', 'heatmapTopAltitude', 'heatmapsTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', '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', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
134779
+ var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$7(['globeImageUrl', 'bumpImageUrl', 'globeTileEngineUrl', 'globeTileEngineMaxLevel', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', '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', 'heatmapsData', 'heatmapPoints', 'heatmapPointLat', 'heatmapPointLng', 'heatmapPointWeight', 'heatmapBandwidth', 'heatmapColorFn', 'heatmapColorSaturation', 'heatmapBaseAltitude', 'heatmapTopAltitude', 'heatmapsTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'particlesData', 'particlesList', 'particleLat', 'particleLng', 'particleAltitude', 'particlesSize', 'particlesSizeAttenuation', 'particlesColor', 'particlesTexture', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
134775
134780
  return _defineProperty$4({}, p, bindGlobe.linkProp(p));
134776
134781
  })));
134777
134782
  var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray$7(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
@@ -134898,6 +134903,19 @@ var<${access}> ${name} : ${structName};`;
134898
134903
  onTileHover: {
134899
134904
  triggerUpdate: false
134900
134905
  },
134906
+ particleLabel: {
134907
+ "default": 'name',
134908
+ triggerUpdate: false
134909
+ },
134910
+ onParticleClick: {
134911
+ triggerUpdate: false
134912
+ },
134913
+ onParticleRightClick: {
134914
+ triggerUpdate: false
134915
+ },
134916
+ onParticleHover: {
134917
+ triggerUpdate: false
134918
+ },
134901
134919
  labelLabel: {
134902
134920
  triggerUpdate: false
134903
134921
  },
@@ -134951,7 +134969,8 @@ var<${access}> ${name} : ${structName};`;
134951
134969
  "default": 0.2,
134952
134970
  triggerUpdate: false,
134953
134971
  onChange: function onChange(val, state) {
134954
- return state.renderObjs.lineHoverPrecision(val);
134972
+ state.renderObjs.lineHoverPrecision(val);
134973
+ state.renderObjs.pointsHoverPrecision(val);
134955
134974
  }
134956
134975
  }
134957
134976
  }, linkedGlobeProps), linkedRenderObjsProps),
@@ -135068,6 +135087,7 @@ var<${access}> ${name} : ${structName};`;
135068
135087
  this.hexBinPointsData([]);
135069
135088
  this.hexPolygonsData([]);
135070
135089
  this.tilesData([]);
135090
+ this.particlesData([]);
135071
135091
  this.labelsData([]);
135072
135092
  this.htmlElementsData([]);
135073
135093
  this.objectsData([]);
@@ -135175,6 +135195,9 @@ var<${access}> ${name} : ${structName};`;
135175
135195
  tile: function tile(d) {
135176
135196
  return d;
135177
135197
  },
135198
+ particles: function particles(d, intersection) {
135199
+ return !intersection || !intersection.hasOwnProperty('index') || d.length <= intersection.index ? d : d[intersection.index];
135200
+ },
135178
135201
  label: function label(d) {
135179
135202
  return d;
135180
135203
  },
@@ -135194,8 +135217,15 @@ var<${access}> ${name} : ${structName};`;
135194
135217
  var isBackground = function isBackground(o) {
135195
135218
  return !o;
135196
135219
  }; // || o.__globeObjType === 'globe' || o.__globeObjType === 'atmosphere';
135197
- return isBackground(aObj) - isBackground(bObj);
135198
- }).tooltipContent(function (obj) {
135220
+
135221
+ // Ignore merged geometry objects that don't have interaction per point
135222
+ var isMergedGeometries = function isMergedGeometries(o) {
135223
+ return o && ['points', 'hexBinPoints'].some(function (t) {
135224
+ return t === o.__globeObjType;
135225
+ }) && Array.isArray(o.__data);
135226
+ };
135227
+ return isBackground(aObj) - isBackground(bObj) || isMergedGeometries(aObj) - isMergedGeometries(bObj);
135228
+ }).tooltipContent(function (obj, intersection) {
135199
135229
  var objAccessors = {
135200
135230
  point: state.pointLabel,
135201
135231
  arc: state.arcLabel,
@@ -135204,14 +135234,15 @@ var<${access}> ${name} : ${structName};`;
135204
135234
  hexbin: state.hexLabel,
135205
135235
  hexPolygon: state.hexPolygonLabel,
135206
135236
  tile: state.tileLabel,
135237
+ particles: state.particleLabel,
135207
135238
  label: state.labelLabel,
135208
135239
  object: state.objectLabel,
135209
135240
  custom: state.customLayerLabel
135210
135241
  };
135211
135242
  var globeObj = getGlobeObj(obj);
135212
135243
  var objType = globeObj && globeObj.__globeObjType;
135213
- return globeObj && objType && objAccessors.hasOwnProperty(objType) && dataAccessors.hasOwnProperty(objType) ? index$2(objAccessors[objType])(dataAccessors[objType](globeObj.__data)) || '' : '';
135214
- }).onHover(function (obj) {
135244
+ return globeObj && objType && objAccessors.hasOwnProperty(objType) && dataAccessors.hasOwnProperty(objType) ? index$2(objAccessors[objType])(dataAccessors[objType](globeObj.__data, intersection)) || '' : '';
135245
+ }).onHover(function (obj, _, intersection) {
135215
135246
  // Update tooltip and trigger onHover events
135216
135247
  var hoverObjFns = {
135217
135248
  point: state.onPointHover,
@@ -135222,6 +135253,7 @@ var<${access}> ${name} : ${structName};`;
135222
135253
  hexbin: state.onHexHover,
135223
135254
  hexPolygon: state.onHexPolygonHover,
135224
135255
  tile: state.onTileHover,
135256
+ particles: state.onParticleHover,
135225
135257
  label: state.onLabelHover,
135226
135258
  object: state.onObjectHover,
135227
135259
  custom: state.onCustomLayerHover
@@ -135236,6 +135268,7 @@ var<${access}> ${name} : ${structName};`;
135236
135268
  hexbin: state.onHexClick,
135237
135269
  hexPolygon: state.onHexPolygonClick,
135238
135270
  tile: state.onTileClick,
135271
+ particles: state.onParticleClick,
135239
135272
  label: state.onLabelClick,
135240
135273
  object: state.onObjectClick,
135241
135274
  custom: state.onCustomLayerClick
@@ -135246,12 +135279,12 @@ var<${access}> ${name} : ${structName};`;
135246
135279
  hoverObj && !hoverObjFns.hasOwnProperty(hoverObj.__globeObjType) && (hoverObj = null);
135247
135280
  if (hoverObj !== state.hoverObj) {
135248
135281
  var prevObjType = state.hoverObj ? state.hoverObj.__globeObjType : null;
135249
- var prevObjData = state.hoverObj ? dataAccessors[prevObjType](state.hoverObj.__data) : null;
135282
+ var prevObjData = state.hoverData;
135250
135283
  var objType = hoverObj ? hoverObj.__globeObjType : null;
135251
- var objData = hoverObj ? dataAccessors[objType](hoverObj.__data) : null;
135284
+ var objData = hoverObj ? dataAccessors[objType](hoverObj.__data, intersection) : null;
135252
135285
  if (prevObjType && prevObjType !== objType) {
135253
135286
  // Hover out
135254
- hoverObjFns[prevObjType] && hoverObjFns[prevObjType](null, prevObjData);
135287
+ hoverObjFns[prevObjType] && hoverObjFns[prevObjType](null, prevObjData || null);
135255
135288
  }
135256
135289
  if (objType) {
135257
135290
  // Hover in
@@ -135261,6 +135294,7 @@ var<${access}> ${name} : ${structName};`;
135261
135294
  // set pointer if hovered object is clickable
135262
135295
  state.renderObjs.renderer().domElement.classList[objType && clickObjFns[objType] ? 'add' : 'remove']('clickable');
135263
135296
  state.hoverObj = hoverObj;
135297
+ state.hoverData = objData;
135264
135298
  }
135265
135299
  }).onClick(function (obj, ev, intersection) {
135266
135300
  if (!obj) return; // ignore background clicks
@@ -135276,6 +135310,7 @@ var<${access}> ${name} : ${structName};`;
135276
135310
  hexbin: state.onHexClick,
135277
135311
  hexPolygon: state.onHexPolygonClick,
135278
135312
  tile: state.onTileClick,
135313
+ particles: state.onParticleClick,
135279
135314
  label: state.onLabelClick,
135280
135315
  object: state.onObjectClick,
135281
135316
  custom: state.onCustomLayerClick
@@ -135298,7 +135333,7 @@ var<${access}> ${name} : ${structName};`;
135298
135333
  } else {
135299
135334
  args.push(_this.toGeoCoords(point));
135300
135335
  }
135301
- dataAccessors.hasOwnProperty(objType) && args.unshift(dataAccessors[objType](globeObj.__data));
135336
+ dataAccessors.hasOwnProperty(objType) && args.unshift(dataAccessors[objType](globeObj.__data, intersection));
135302
135337
  objFns[objType].apply(objFns, args);
135303
135338
  }
135304
135339
  }).onRightClick(function (obj, ev, intersection) {
@@ -135315,6 +135350,7 @@ var<${access}> ${name} : ${structName};`;
135315
135350
  hexbin: state.onHexRightClick,
135316
135351
  hexPolygon: state.onHexPolygonRightClick,
135317
135352
  tile: state.onTileRightClick,
135353
+ particles: state.onParticleRightClick,
135318
135354
  label: state.onLabelRightClick,
135319
135355
  object: state.onObjectRightClick,
135320
135356
  custom: state.onCustomLayerRightClick
@@ -135337,7 +135373,7 @@ var<${access}> ${name} : ${structName};`;
135337
135373
  } else {
135338
135374
  args.push(_this.toGeoCoords(point));
135339
135375
  }
135340
- dataAccessors.hasOwnProperty(objType) && args.unshift(dataAccessors[objType](globeObj.__data));
135376
+ dataAccessors.hasOwnProperty(objType) && args.unshift(dataAccessors[objType](globeObj.__data, intersection));
135341
135377
  objFns[objType].apply(objFns, args);
135342
135378
  }
135343
135379
  });