🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

spherical-image

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spherical-image

Very lightweight 360deg spherical image viewer

0.2.0
latest
Source
npm
Version published
Weekly downloads
148
-45.39%
Maintainers
1
Weekly downloads
 
Created
Source

spherical-image

Very lightweight 360deg spherical image viewer

Latest NPM release MIT License

Demos

  • basic

Usage

$ npm install --save spherical-image

then

<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 is 0
  • options.offsetAltitude: default vertical rotation in radian. default is 0

Methods

  • .reset(): reset view rotation.
  • .setSize( width, height ): set canvas size.
  • .destroy(): destroy the instance. dispose WebGL. detach all events.

Keywords

webgl

FAQs

Package last updated on 03 Jul 2019

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