mistic100 / Photo-Sphere-Viewer

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

Map in VirtualTour doesn't work #1357

Closed Rusachok closed 1 week ago

Rusachok commented 1 week ago

Describe the bug

I want to use floor map for my virtual tour. So my plugins

          plugins: [
              [MapPlugin],
              [GalleryPlugin, {
                  thumbnailSize: { width: 100, height: 100 },
                  visibleOnLoad: true,
              }],
              [VirtualTourPlugin, {
                  positionMode: 'manual',
                  renderMode: '2d',
                  map: {
                      imageUrl: '{% static 'img/empty_plan.jpg' %}',
                  },
              }],
          ],

And in virtualTour.setNodes I use

map: { x: 500, y: 815 },

I got in Console error in "MapComponent.ts:554"

Uncaught DOMException: Failed to execute 'addColorStop' on 'CanvasGradient': The value provided ('rgba(8E,0)') could not be parsed as a color.
    at MapComponent.render (http://127.0.0.1:8000/static/vendor/photo-sphere-viewer/map-plugin/index.module.js:754:14)
    at renderLoop (http://127.0.0.1:8000/static/vendor/photo-sphere-viewer/map-plugin/index.module.js:390:14)

Can you give examples of how to set a room plan and points on it?

Online demo URL

No response

Photo Sphere Viewer version

5.8.2

Plugins loaded

No response

OS & browser

Win, chrome

Additional context

No response

mistic100 commented 1 week ago

Please create an online demo showing the error.

Rusachok commented 1 week ago

https://vi-tour.ru/s/memdjyzy/?addmap=1

mistic100 commented 1 week ago

I understood the problem, it will be fixed.

In the meantime you can define the plugin like this instead

[MapPlugin, {}] // notice the empty config object