mistic100 / Photo-Sphere-Viewer

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

Update marker failed when marker is not in view #1326

Closed zsjbsn closed 3 months ago

zsjbsn commented 3 months ago

Describe the bug

First add one marker

markersPlugin.addMarker({
  id: '1',
  position: { yaw: '10deg', pitch: '10deg' },
  path: 'M0,0 L60,60 L60,0 L0,60 L0,0',
  svgStyle: {
      fill: 'red'
  },
  anchor: 'bottom center'
})

And then rotate panorama to make this marker not in view, and update its position

markersPlugin.updateMarker({
  id: '1',
  position: { yaw: '5deg', pitch: '5deg' },
  path: 'M0,0 L60,60 L60,0 L0,60 L0,0',
  svgStyle: {
      fill: 'red'
  },
  anchor: 'bottom center'
})

It will disappear in view, but exist in HTML. I found that the width & height attribute in css is zero, maybe the bug is that can not get size of svg when marker is not in view. image

Online demo URL

No response

Photo Sphere Viewer version

5.7.4

Plugins loaded

No response

OS & browser

Win11 & Chrome 123

Additional context

No response

github-actions[bot] commented 3 months ago

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