globe.gl 2.38.0 → 2.39.0
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 +24 -5
- package/dist/globe.gl.d.ts +5 -0
- package/dist/globe.gl.js +640 -330
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +4 -4
- package/dist/globe.gl.mjs +38 -12
- package/example/satellites/index.html +6 -14
- package/package.json +3 -3
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
|
|
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. | |
|
package/dist/globe.gl.d.ts
CHANGED
|
@@ -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;
|