rc-pannellum
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

name type
style CSSProperties container style
className string container classname
clickInfo boolean console pitch and yaw when click

Readme

Keywords

none

Package Sidebar

Install

npm i rc-pannellum

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

17.5 kB

Total Files

11

Last publish

Collaborators

  • zhangyu1995