SimplePanoramaViewer/js/photo-sphere-viewer.min.js

7 lines
95 KiB
JavaScript
Raw Normal View History

/*!
* Photo Sphere Viewer 3.4.0
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2018 Damien "Mistic" Sorel
* Licensed under MIT (https://opensource.org/licenses/MIT)
*/
!function(t,e){"function"==typeof define&&define.amd?define(["three","d.js","uevent","dot/doT"],e):"object"==typeof module&&module.exports?module.exports=e(require("three"),require("d.js"),require("uevent"),require("dot/doT")):t.PhotoSphereViewer=e(t.THREE,t.D,t.uEvent,t.doT)}(this,function(t,e,i,o){"use strict";function n(e){if(!(this instanceof n))return new n(e);if(n.SYSTEM.loaded||n._loadSystem(),this.config=x.clone(n.DEFAULTS),x.deepmerge(this.config,e),!e.container)throw new E("No value given for container.");if(!n.SYSTEM.isCanvasSupported)throw new E("Canvas is not supported.");if(!(n.SYSTEM.isWebGLSupported&&this.config.webgl||x.checkTHREE("CanvasRenderer","Projector")))throw new E("Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package.");if(this.config.longitude_range&&2!==this.config.longitude_range.length&&(this.config.longitude_range=null,console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")),this.config.latitude_range?2!==this.config.latitude_range.length?(this.config.latitude_range=null,console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")):this.config.latitude_range[0]>this.config.latitude_range[1]&&(this.config.latitude_range=[this.config.latitude_range[1],this.config.latitude_range[0]],console.warn("PhotoSphereViewer: latitude_range values must be ordered.")):void 0===this.config.tilt_up_max&&void 0===this.config.tilt_down_max||(this.config.latitude_range=[void 0!==this.config.tilt_down_max?this.config.tilt_down_max-Math.PI/4:-x.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:x.HalfPI],console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")),this.config.max_fov<this.config.min_fov){var i=this.config.max_fov;this.config.max_fov=this.config.min_fov,this.config.min_fov=i,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")}this.config.cache_texture&&(!x.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=n.DEFAULTS.cache_texture,console.warn("PhotoSphereViewer: invalid value for cache_texture")),"panorama_roll"in this.config&&(this.config.sphere_correction.roll=this.config.panorama_roll,console.warn("PhotoSphereViewer: panorama_roll is deprecated, use sphere_correction.roll instead")),"gyroscope"in this.config&&console.warn("PhotoSphereViewer: gyroscope is deprecated, the control is automatically created if DeviceOrientationControls.js is loaded"),this.config.min_fov=x.bound(this.config.min_fov,1,179),this.config.max_fov=x.bound(this.config.max_fov,1,179),null===this.config.default_fov?this.config.default_fov=this.config.max_fov/2+this.config.min_fov/2:this.config.default_fov=x.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),this.config.default_long=x.parseAngle(this.config.default_long),this.config.default_lat=x.parseAngle(this.config.default_lat,!0),this.config.sphere_correction.pan=x.parseAngle(this.config.sphere_correction.pan,!0),this.config.sphere_correction.tilt=x.parseAngle(this.config.sphere_correction.tilt,!0),this.config.sphere_correction.roll=x.parseAngle(this.config.sphere_correction.roll,!0),null===this.config.anim_lat?this.config.anim_lat=this.config.default_lat:this.config.anim_lat=x.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(t){return x.parseAngle(t)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(t){return x.parseAngle(t,!0)})),this.config.anim_speed=x.parseSpeed(this.config.anim_speed),this.config.caption&&!this.config.navbar&&(this.config.navbar=["caption"]),!0===this.config.fisheye?this.config.fisheye=1:!1===this.config.fisheye&&(this.config.fisheye=0),this.parent="string"==typeof e.container?document.getElementById(e.container):e.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.notification=null,this.pleaseRotate=null,