js+photo-sphere-viewer

本文介绍了如何在Vue应用中,利用Photo-Sphere-Viewer库以不同的JavaScript调用方式加载和展示本地的360度全景图片,包括模块化导入Three.js和库文件的引用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

js调用方式和vue不同,切记
webar.html

<head>
    <!-- for optimal display on high DPI devices -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core/index.min.css" />
</head>

<!-- the viewer container must have a defined size -->
<div id="viewer" style="width: 100%; height: 100%;"></div>
<script type="importmap">
    {
        "imports": {
            "three": "https://cdn.jsdelivr.net/npm/three/build/three.module.js",
            "@photo-sphere-viewer/core": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core/index.module.js"
        }
    }
</script>

<script type="module">
    import { Viewer } from '@photo-sphere-viewer/core';

const viewer = new Viewer({
    container: 'viewer',
    panorama: 'static/sphere.jpg',本地图片路径,主页直接写图片.jpg
    caption: '全景测试</b>',
    
    touchmoveTwoFingers: true,
    mousewheelCtrlKey: true,
});

</script>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值