@openglobus/openglobus-react 0.1.0 → 0.1.2
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 -41
- package/dist/index.js +1343 -1241
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +114 -108
- package/dist/index.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/camera/PlanetCamera/PlanetCamera.d.ts +14 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layer/Layer/Layer.d.ts +36 -5
- package/dist/types/layer/Vector/Vector.d.ts +3 -1
- package/dist/types/layer/XYZ/XYZ.d.ts +1 -1
- package/package.json +2 -2
- package/dist/types/Globe/Globe.stories.d.ts +0 -10
- package/dist/types/entity/Billboard/Billboard.stories.d.ts +0 -15
- package/dist/types/entity/Entity/Entity.stories.d.ts +0 -11
- package/dist/types/entity/GeoObject/GeoObject.stories.d.ts +0 -13
- package/dist/types/entity/Geometry/Geometry.stories.d.ts +0 -12
- package/dist/types/entity/Label/Label.stories.d.ts +0 -20
- package/dist/types/entity/Polyline/Polyline.stories.d.ts +0 -11
- package/dist/types/entity/Strip/Strip.stories.d.ts +0 -11
- package/dist/types/layer/GeoImage/GeoImage.stories.d.ts +0 -12
- package/dist/types/layer/GeoVideo/GeoVideo.stories.d.ts +0 -12
- package/dist/types/layer/Vector/Vector.stories.d.ts +0 -11
- package/dist/types/layer/XYZ/XYZ.stories.d.ts +0 -12
package/README.md
CHANGED
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
# React
|
|
2
|
-
|
|
1
|
+
# 🌍 React Components for [OpenGlobus](https://github.com/openglobus/openglobus)
|
|
2
|
+
|
|
3
|
+
## Features:
|
|
4
|
+
- **Core Entities**: A complete set of core entities to work with geospatial data, including billboards, 3d-objects, polylines, labels and more.
|
|
5
|
+
- **Reactive Integration**: Seamlessly integrate with React applications, leveraging the reactive style.
|
|
6
|
+
- **Performance**: Enhanced performance through efficient data handling and rendering optimizations.
|
|
7
|
+
- **Storybook**: Explore and interact with all components and features in our [Storybook](https://openglobus.github.io/storybook), providing a comprehensive showcase and testing environment.
|
|
8
|
+
- **Minimal Dependencies**: Designed with minimal dependencies to ensure lightweight and efficient performance.
|
|
9
|
+
|
|
10
|
+
## Install:
|
|
3
11
|
|
|
4
|
-
Install:
|
|
5
12
|
```bash
|
|
6
13
|
npm i @openglobus/openglobus-react
|
|
7
14
|
```
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
## Usage:
|
|
17
|
+
|
|
18
|
+
Super easy to try out – just run:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx create openglobus
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Documentation:
|
|
25
|
+
For detailed documentation and examples, please refer to our [Storybook](https://openglobus.github.io/storybook).
|
|
26
|
+
|
|
27
|
+
## License:
|
|
28
|
+
This project is licensed under the MIT License - see the LICENSE.md file for details.
|
|
29
|
+
|
|
10
30
|
|
|
11
|
-
`App.tsx`
|
|
12
|
-
```tsx
|
|
13
|
-
import '@openglobus/openglobus-react/dist/style.css'
|
|
14
|
-
import Globus, {GlobeContextProvider} from '@openglobus/openglobus-react'
|
|
15
31
|
|
|
16
32
|
|
|
17
|
-
function App() {
|
|
18
|
-
return <GlobeContextProvider>
|
|
19
|
-
<Globus/>
|
|
20
|
-
</GlobeContextProvider>
|
|
21
|
-
}
|
|
22
33
|
|
|
23
|
-
export default App
|
|
24
34
|
|
|
25
35
|
|
|
26
|
-
```
|
|
27
|
-
`Button.tsx`
|
|
28
|
-
```tsx
|
|
29
|
-
import {useGlobusContext} from '@openglobus/openglobus-react'
|
|
30
|
-
// import './buttons.css'
|
|
31
|
-
import {LonLat} from "@openglobus/og";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export default function ButtonContainer() {
|
|
35
|
-
const {globus} = useGlobusContext()
|
|
36
|
-
const clickFlyTo = () => {
|
|
37
|
-
let ell = globus?.planet.ellipsoid;
|
|
38
|
-
|
|
39
|
-
let destPos = new LonLat(10.13176, 46.18868, 10779);
|
|
40
|
-
let viewPoi = new LonLat(9.98464, 46.06157, 3039);
|
|
41
|
-
if (ell) {
|
|
42
|
-
let lookCart = ell.lonLatToCartesian(viewPoi);
|
|
43
|
-
let upVec = ell.lonLatToCartesian(destPos).normalize();
|
|
44
|
-
globus?.planet.camera.flyLonLat(destPos, lookCart, upVec, 0);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return <div className={'button-container'}>
|
|
49
|
-
<button onClick={clickFlyTo}>Fly to</button>
|
|
50
|
-
</div>
|
|
51
|
-
}
|
|
52
|
-
```
|