1.0.9 • Published 10 months ago

@allestaire.acasio/all-around-the-world v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

All Around The World

  • Mazipano Package for React

Demo

Installation

# Using Yarn
yarn add @allestaire.acasio/all-around-the-world

# Using NPM
npm install @allestaire.acasio/all-around-the-world

Usage

import AllAroundTheWorld from '@allestaire.acasio/all-around-the-world'

const SCENE = [
  ...
  {
    label: 'Radiant Church of God',
    facesize: 4096,
    settings: {
      yaw: -0.8742276521196057,
      pitch: 0.13728319936422295,
      roll: 0,
      fov: Math.PI/1.5
    },
    image: '/imgs/cubemap/{f}.jpg',
    levels: [{ tileSize: 1024, size: 1024 }],
    hotspots: [
      {
        ele: 'outside',
        coordinates: {
          yaw: 2.2787784123665737,
          pitch: 0.08445560195570856,
        },
        perspective: {
          radius: 1640, extraTransforms: 'rotateX(0deg) rotateY(0deg) rotateZ(0deg)'
        }
      },
    ]
  }
]

const MyComponent = () => {
  const sceneEl = useRef(null)
  const handleClick = (coordinate, scene) => {
    console.log(coordinate, scene)
    // Change to next scene
    // scene.current.switchScene(sceneIndex, setting)
  }

  return (
    <AllAroundTheWorld ref={sceneEl} scenes={SCENE} onClick={handleClick}/>
  )
}

export default MyComponent

Component Property

AttributeTypeDescription
scenesArrayList of scenes (see Scene Format)
limiterBooleanThis will add limiter to the scene
onClickFunctionClick event when click on the scene, this will have a parameter of coordinate and scene
_coordinateCoordinate of the click position
_sceneCurrent data scene upon clicking

Scene Format

PropertyTypeDescription
labelStringTitle of the scene
facesizeNumberFace size of the screen (I guess) See for documentation
settingsObjectCustom view point
imageStringImage URL
levelsArrayList of leveles [{ tileSize: 1024, size: 1024 }]
hotspotsArrayList of hotspot configuration
_eleElement ID, i.e my-hotspot
_coordinatesCoordinate consist of {yaw: 0, pitch: 0}
_perspectiveChange perspective of the hotspot relative to its view, i.e {radius: 0, extraTransforms: "rotateX(0deg) rotateY(0deg) rotateZ(0deg)"}
1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago