@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 CHANGED
@@ -1,52 +1,35 @@
1
- # React port for OpenGlobus
2
- Openglobus React Components
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
- Example of usage:
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
- ```