mistic100 / Photo-Sphere-Viewer

A JavaScript library to display 360° sphere panoramas.
https://photo-sphere-viewer.js.org
MIT License
1.87k stars 675 forks source link

[VirtualTour] Can I change the link marker to any image? #606

Closed kokeman closed 2 years ago

kokeman commented 2 years ago

I want change the link marker to my png image.

I try

  var viewer = new PhotoSphereViewer.Viewer({
    container: document.querySelector('#viewer'),
    navbar: [
      'zoom',
      'move',
      'fullscreen',
      'caption',
    ],
    defaultLong: 1.5638934539917608,
    plugins    : [
      PhotoSphereViewer.MarkersPlugin,
      [PhotoSphereViewer.VirtualTourPlugin, {
        renderMode : 'markers',
        markerStyle: {
          longitude: 1.614518979150625,
          latitude: -0.45801860285781215,
          image: 'my_png_path',
          width: 30,
          height: 30,
        }
      }]
    ],
  });

But i got this error

multiple marker content, either image, html, polyg… polylineRad, square, rect, circle, ellipse, path

according this document, markerStyle have html as default, so I can't set image ?

Sorry, I have one more thing to ask. Can I change the position of the 3D arrow to the position obtained by clicking? I changed this exmaple 's latitude and longitude (l39), but not working.

mistic100 commented 2 years ago

regarding the marker style this is a bug


for you other question I don't understand, but please create another issue

mistic100 commented 2 years ago

A simple fix I made it possible to use this configuration

markerStyle: {
  html : null,
  image: 'path/to/image.png',
}
github-actions[bot] commented 2 years ago

This feature/bug fix has been released in version 4.4.2.