I use PhotosphereViewer for displaying panorama image.
I use the following code for initializing the viewer successfully -
var viewer = new PhotoSphereViewer.Viewer({
panorama: '/images/myimage.jpg',
container: 'stage',
loadingImg: 'https://photo-sphere-viewer.js.org/assets/photosphere-logo.gif',
caption: 'Parc national du Mercantour <b>© Damien Sorel</b>',
defaultLat: 0.3,
plugins: [
[PhotoSphereViewer.MarkersPlugin, {
// list of markers
markers: [
]
}]
]
});
After initializing the viewer I use the following command to get a reference to the MarkersPlugin -
var markersPlugin = viewer.getPlugin(PhotoSphereViewer.MarkersPlugin);
Any idea why markersPlugin
is always null ?
You need to add
markers.js
file in your htmlLike