How to use photo-sphere-viewer plugins in vue project
See original GitHub issueHello Dear
Thank you! I have found answer in issue #368. Thank you all the same.
I used the photo-sphere-viewer 4.0.5 version in vue project. Now I have met a strange problem. I used like this completely copying from guide . html is as below:
<div id="viewer"></div>
js part is as:
import * as PSV from 'photo-sphere-viewer';
import 'photo-sphere-viewer/dist/photo-sphere-viewer.css';
export default {
mounted() {
this.initPhotoSphere();
},
methods: {
initPhotoSphere() {
const viewer = new PSV.Viewer({
container: document.getElementById('viewer'),
// panorama: this.factoryLink,
panorama: 'https://photo-sphere-viewer.js.org/assets/sphere.jpg',
size: {
width: '100%',
height: screen.availHeight,
},
loadingImg: 'https://photo-sphere-viewer.js.org/assets/photosphere-logo.gif',
caption: '街景图',
defaultLat: 0.3,
plugins: [
[PSV.MarkersPlugin, {
markers: [
{
id: 'new-marker',
longitude: '45deg',
latitude: '0deg',
image: 'https://photo-sphere-viewer.js.org/assets/pin-red.png',
},
],
}]
],
});
console.log(viewer);
}
}
}
But in my last console.log, I can not find the plugins in viewer.
I trace in the photo-sphere-view source code. I print ‘plugins’ in ‘photo-sphere-viewer.js’ line 3200, I got a result of
[undefined, {markers: Array(1)}]
I think maybe the undefined in the 0 index cause the problem. But I don’t know why it will add the undefined in the first. Then I changed to other plugins, the problem is the same. Hoping for your professional explanations. Thank you for your help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Introduction to plugins - Photo Sphere Viewer
Plugins are used to add new functionalities to Photo Sphere Viewer. They can access all internal APIs of the viewer as well as...
Read more >photo-sphere-viewer-embed - npm package - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix ...
Read more >【VUEJS】photo sphere viewer 360°×180° panoramic plug in ...
https://politicnewsbusterinsiderpostreview.blogspot.com/2021/04/vuejsphoto-sphere-viewer-360180.html with ❤ by Edward Lance Lorilla Apache ...
Read more >Vue使用photo-sphere-viewer360°×180°全景插件模拟VR看房
2. 按参考的文章导入发现获取不到 MarkersPlugin. 在 node_modules\photo-sphere-viewer\dist\plugins\ ...
Read more >cordova-plugin-panoramaviewer: Documentation | Openbase
I created this plugin for the purposes of my project and decided to make it public. Photosphere plugin uses the Panorama API and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In two years things changed. The documentation is correct.
agreed, the Plugins intro page for ES includes still shows mustaches in the import line, which is not what @mistic100 comment above defines