Package Exports
- spherical-image
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spherical-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
spherical-image
Very lightweight 360deg spherical image viewer
Demos
Usage
$ npm install --save spherical-imagethen
<canvas id="myCanvas" width="800" height="600"></canvas>import SphericalImage from 'spherical-image';
new SphericalImage(
document.getElementById( 'myCanvas' ),
'./img.jpg'
);or
<script src="./js/spherical-image.js"></script>const sphericalImage = new SphericalImage(
document.getElementById( 'myCanvas' ),
'./img.jpg'
);Options
The third argument is options.
const sphericalImage = new SphericalImage(
document.getElementById( 'myCanvas' ),
'./img.jpg',
options
);options.offsetAzimuth: default horizontal rotation in radian. default is0options.offsetAltitude: default vertical rotation in radian. default is0
Methods
.reset(): reset view rotation..setSize( width, height ): set canvas size..destroy(): destroy the instance. dispose WebGL. detach all events.