0.0.2 • Published 4 years ago

rc-pannellum v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

rc-pannellum

just a simple code encapsulation, written in typescript and has some types inferable

original library pannellum

usage

yarn add rc-pannellum
import Pannellum, { PannellumRef } from 'rc-pannellum';

const App = () => {
  const viewerRef = useRef<PannellumRef | null>(null);

  useEffect(() => {
    // viewer instance
    const viewer = viewerRef.current?.getViewer();
    if (viewer) {
      viewer.on('mousedown', (e: MouseEvent) => {
        console.log(e);
      });
    }
  }, []);

  const config = {
    autoLoad: true,
    panorama: 'https://pannellum.org/images/alma.jpg',
  };

  return (
    <Pannellum
      ref={viewerRef}
      clickInfo
      className="viewer"
      style={{
        width: "100vw",
        height: "100vh"
      }}
      {...config}
    />
  );
};

props

nametype
styleCSSPropertiescontainer style
classNamestringcontainer classname
clickInfobooleanconsole pitch and yaw when click