Socket
Socket
Sign inDemoInstall

@openglobus/react

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openglobus/react

Openglobus React Components


Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

React port for OpenGlobus

Openglobus React Components

Install:

npm i @openglobus/react

Example of usage:

App.tsx

import '@openglobus/react/dist/style.css'
import Globus, {GlobeContextProvider} from '@openglobus/react'


function App() {
    return <GlobeContextProvider>
        <Globus/>
    </GlobeContextProvider>
}

export default App


Button.tsx

import {useGlobeContext} from '@openglobus/react'
// import './buttons.css'
import {LonLat} from "@openglobus/og";


export default function ButtonContainer() {
    const {globe} = useGlobeContext()
    const clickFlyTo = () => {
        let ell = globe?.planet.ellipsoid;

        let destPos = new LonLat(10.13176, 46.18868, 10779);
        let viewPoi = new LonLat(9.98464, 46.06157, 3039);
        if (ell) {
            let lookCart = ell.lonLatToCartesian(viewPoi);
            let upVec = ell.lonLatToCartesian(destPos).normalize();
            globe?.planet.camera.flyLonLat(destPos, lookCart, upVec, 0);
        }
    }

    return <div className={'button-container'}>
        <button onClick={clickFlyTo}>Fly to</button>
    </div>
}

Keywords

FAQs

Package last updated on 27 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc