2021-04-03 18:47:20 +02:00
|
|
|
<div style="position:relative;">
|
|
|
|
<?php
|
|
|
|
$this->headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css', 'PanoramaViewer'));
|
|
|
|
$this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js', 'PanoramaViewer'));
|
|
|
|
|
|
|
|
if ($title !== false && $title !== "") {
|
|
|
|
$title = sprintf('<p id="panorama-viewer-title">%s</p>', $title);
|
|
|
|
} else {
|
|
|
|
$title = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<style>
|
2021-04-03 22:13:41 +02:00
|
|
|
#<?= $id ?> {
|
|
|
|
height: <?= $height ?>px;
|
|
|
|
width: <?= $width ?>px;
|
|
|
|
}
|
2021-04-03 18:47:20 +02:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="pannellum">
|
2021-04-03 18:56:54 +02:00
|
|
|
<div id="<?= $id ?>" class="panorama-viewer"></div>
|
2021-04-03 18:47:20 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2021-04-03 22:13:41 +02:00
|
|
|
<?php if ($panorama_type == "equirectangular") { ?>
|
|
|
|
pannellum.viewer("<?= $id ?>", {
|
|
|
|
type: "equirectangular",
|
|
|
|
autoLoad: <?= json_encode($autoLoad == false ? false : true) ?>,
|
|
|
|
panorama: "<?= $urls[0]; ?>",
|
|
|
|
});
|
|
|
|
<?php } ?>
|
|
|
|
<?php if ($panorama_type == "cubemap") { ?>
|
|
|
|
pannellum.viewer("<?= $id ?>", {
|
|
|
|
type: "cubemap",
|
|
|
|
autoLoad: <?= json_encode($autoLoad == false ? false : true) ?>,
|
|
|
|
cubeMap: <?= json_encode($urls, JSON_UNESCAPED_SLASHES) ?>,
|
|
|
|
});
|
|
|
|
<?php } ?>
|
2021-04-03 18:47:20 +02:00
|
|
|
|
|
|
|
<?php if ($title !== false): ?>
|
|
|
|
$('#pannellum-ui').append('<?= $title ?>');
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</div>
|