aframe-globe-component
Advanced tools
Comparing version 1.11.0 to 1.12.0
/** | ||
* @license | ||
* Copyright 2010-2021 Three.js Authors | ||
* Copyright 2010-2022 Three.js Authors | ||
* SPDX-License-Identifier: MIT | ||
*/ |
19
index.js
@@ -157,2 +157,7 @@ /* global AFRAME */ | ||
labelsTransitionDuration: { type: 'number', default: 1000 }, | ||
objectsData: { parse: parseJson, default: [] }, | ||
objectLat: { parse: parseAccessor, default: 'lat' }, | ||
objectLng: { parse: parseAccessor, default: 'lng' }, | ||
objectAltitude: { parse: parseAccessor, default: 0.01 }, | ||
objectThreeObject: { parse: parseAccessor, default: null }, | ||
customLayerData: { parse: parseJson, default: [] }, | ||
@@ -178,2 +183,11 @@ customThreeObject: { parse: parseAccessor, default: null }, | ||
getGlobeRadius: function() { | ||
if (!this.globe) { | ||
// Got here before component init -> initialize globe | ||
this.globe = new ThreeGlobe(); | ||
} | ||
const globe = this.globe; | ||
return globe.getGlobeRadius.apply(globe, arguments); | ||
}, | ||
getCoords: function () { | ||
@@ -353,2 +367,7 @@ if (!this.globe) { | ||
'labelsTransitionDuration', | ||
'objectsData', | ||
'objectLat', | ||
'objectLng', | ||
'objectAltitude', | ||
'objectThreeObject', | ||
'customLayerData', | ||
@@ -355,0 +374,0 @@ 'customThreeObject', |
{ | ||
"name": "aframe-globe-component", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "A 3D Globe component for A-Frame.", | ||
@@ -50,28 +50,28 @@ "main": "index.js", | ||
"three": ">=0.88.0", | ||
"three-globe": "^2.21" | ||
"three-globe": "^2.23" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.16.0", | ||
"@babel/core": "^7.16.0", | ||
"@babel/plugin-proposal-class-properties": "^7.16.0", | ||
"@babel/plugin-proposal-decorators": "^7.16.0", | ||
"@babel/plugin-proposal-do-expressions": "^7.16.0", | ||
"@babel/plugin-proposal-export-default-from": "^7.16.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.16.0", | ||
"@babel/plugin-proposal-function-bind": "^7.16.0", | ||
"@babel/plugin-proposal-function-sent": "^7.16.0", | ||
"@babel/plugin-proposal-json-strings": "^7.16.0", | ||
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0", | ||
"@babel/plugin-proposal-numeric-separator": "^7.16.0", | ||
"@babel/plugin-proposal-optional-chaining": "^7.16.0", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.16.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.16.0", | ||
"@babel/cli": "^7.17.6", | ||
"@babel/core": "^7.17.5", | ||
"@babel/plugin-proposal-class-properties": "^7.16.7", | ||
"@babel/plugin-proposal-decorators": "^7.17.2", | ||
"@babel/plugin-proposal-do-expressions": "^7.16.7", | ||
"@babel/plugin-proposal-export-default-from": "^7.16.7", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.16.7", | ||
"@babel/plugin-proposal-function-bind": "^7.16.7", | ||
"@babel/plugin-proposal-function-sent": "^7.16.7", | ||
"@babel/plugin-proposal-json-strings": "^7.16.7", | ||
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", | ||
"@babel/plugin-proposal-numeric-separator": "^7.16.7", | ||
"@babel/plugin-proposal-optional-chaining": "^7.16.7", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.17.6", | ||
"@babel/plugin-proposal-throw-expressions": "^7.16.7", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3", | ||
"@babel/plugin-syntax-import-meta": "^7.10.4", | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/preset-env": "^7.16.11", | ||
"aframe": "*", | ||
"babel-loader": "^8.2.3", | ||
"babel-preset-minify": "^0.5.1", | ||
"chai": "^4.3.4", | ||
"chai": "^4.3.6", | ||
"chai-shallow-deep-equal": "^1.4.6", | ||
@@ -98,6 +98,6 @@ "cross-env": "7.0.3", | ||
"superagent": "^6.1.0", | ||
"webpack": "^5.63.0", | ||
"webpack": "^5.69.1", | ||
"webpack-cli": "^3.3.12", | ||
"webpack-dev-server": "^3.11.3", | ||
"webpack-sources": "3.2.1" | ||
"webpack-sources": "3.2.3" | ||
}, | ||
@@ -104,0 +104,0 @@ "semistandard": { |
@@ -176,2 +176,12 @@ ## aframe-globe-component | ||
### Objects Layer | ||
| Property | Description | Default Value | | ||
| --- | --- | :--: | | ||
| objects-data | Getter/setter for the list of custom 3D objects to represent in the objects layer. Each object is rendered according to the `objectThreeObject` method. | `[]` | | ||
| object-lat | Object accessor function, attribute or a numeric constant for the latitude coordinate of the object's position. | `lat` | | ||
| object-lng | Object accessor function, attribute or a numeric constant for the longitude coordinate of the object's position. | `lng` | | ||
| object-altitude | Object accessor function, attribute or a numeric constant for the altitude coordinate of the object's position, in terms of globe radius units. | 0.01 | | ||
| object-three-object | Object accessor function or attribute for defining a custom 3d object to render as part of the objects map layer. Should return an instance of [ThreeJS Object3d](https://threejs.org/docs/index.html#api/core/Object3D). | A yellow sphere | | ||
#### Custom Layer | ||
@@ -182,4 +192,4 @@ | ||
| custom-layer-data | Getter/setter for the list of items to represent in the custom map layer. Each item is rendered according to the `customThreeObject` method. | `[]` | | ||
| custom-three-object | Object accessor function or attribute for generating a custom 3d object to render as part of the custom map layer. Should return an instance of [ThreeJS Object3d](https://threejs.org/docs/index.html#api/core/Object3D). The callback method's signature includes the object's data as well as the globe radius: `customThreeObject((objData, globeRadius) => { ... })`. | `null` | | ||
| custom-three-object-update | Object accessor function or attribute for updating an existing custom 3d object with new data. This can be used for performance improvement on data updates as the objects don't need to be removed and recreated at each update. The callback method's signature includes the object to be update, its new data and the globe radius: `customThreeObjectUpdate((obj, objData, globeRadius) => { ... })`. | `null` | | ||
| custom-three-object | Object accessor function or attribute for generating a custom 3d object to render as part of the custom map layer. Should return an instance of [ThreeJS Object3d](https://threejs.org/docs/index.html#api/core/Object3D). | `null` | | ||
| custom-three-object-update | Object accessor function or attribute for updating an existing custom 3d object with new data. This can be used for performance improvement on data updates as the objects don't need to be removed and recreated at each update. The callback method's signature includes the object to be update and its new data: `customThreeObjectUpdate((obj, objData) => { ... })`. | `null` | | ||
@@ -191,2 +201,3 @@ There are also internal methods that can be invoked via the [components object](https://aframe.io/docs/0.8.0/core/component.html#accessing-a-component%E2%80%99s-members-and-methods): | ||
| globeMaterial | [material: <i>object</i>] | Getter/setter of the ThreeJS material used to wrap the globe. Can be used for more advanced styling of the globe. | | ||
| getGlobeRadius | - | Returns the cartesian distance of a globe radius in absolute spatial units. | | ||
| getCoords | lat: <i>number</i>, lng: <i>number</i> [, altitude: <i>number</i>] | Utility method to translate spherical coordinates. Given a pair of latitude/longitude coordinates and optionally altitude (in terms of globe radius units), returns the equivalent `{x, y, z}` cartesian spatial coordinates. | | ||
@@ -193,0 +204,0 @@ | toGeoCoords | { x: <i>number</i>, y: <i>number</i>, z: <i>number</i> } | Utility method to translate cartesian coordinates to the geographic domain. Given a set of 3D cartesian coordinates `{x, y, z}`, returns the equivalent `{lat, lng, altitude}` spherical coordinates. Altitude is defined in terms of globe radius units. | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10172150
47
249
12889
Updatedthree-globe@^2.23