PSV Equirectangular Tiles Demo

by mistic100

HTML

<script src="https://cdn.jsdelivr.net/npm/uevent@2/browser.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/photo-sphere-viewer.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/photo-sphere-viewer.css">
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/adapters/equirectangular-tiles.js"></script>
<div id="photosphere"></div>

CSS

html, body, #photosphere {
  margin: 0;
  width: 100%;
  height: 100%;
}

JavaScript

new PhotoSphereViewer.Viewer({
  container: 'photosphere',
  adapter: PhotoSphereViewer.EquirectangularTilesAdapter,
  panorama: {
    width  : 6656,
    cols   : 16,
    rows   : 8,
    baseUrl: 'https://photo-sphere-viewer-data.netlify.app/assets/sphere-small.jpg',
    tileUrl: (col, row) => {
      const num = row * 16 + col + 1;
      return `https://photo-sphere-viewer-data.netlify.app/assets/sphere-tiles/image_part_${('000' + num).slice(-3)}.jpg`;
    },
  },
  caption    : 'Parc national du Mercantour <b>&copy; Damien Sorel</b>',
  loadingImg: 'https://photo-sphere-viewer.js.org/assets/photosphere-logo.gif',
  touchmoveTwoFingers: true,
  mousewheelCtrlKey: true,
});