Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to setup polygonPixels for marker #1529

Open
Re-n-Im opened this issue Jan 10, 2025 · 1 comment
Open

Unable to setup polygonPixels for marker #1529

Re-n-Im opened this issue Jan 10, 2025 · 1 comment
Labels

Comments

@Re-n-Im
Copy link

Re-n-Im commented Jan 10, 2025

Describe the bug

When I try to create marker with polygonPixels for Cubemap pano in virtual tour, I constantly get the same error:

Uncaught (in promise) PSVError: invalid marker polygon position: Texture position is missing 'textureX', 'textureY' or 'textureFace'

Tried to put position object everywhere without success. See the source code of demo or applied code here (same in both places).
In demo I used one of your pano images and it will be immediately deleted from the server once the problem is solved!

Online demo URL

https://renimbindery.art/mm/photo-sphere.html

Photo Sphere Viewer version

5.11.4

Plugins loaded

CubemapAdapter VirtualTourPlugin GalleryPlugin MarkersPlugin

OS & browser

Ubuntu 22.04 (any major browser)

Additional context

new Viewer({
    container: 'viewer',
    adapter: CubemapAdapter,
    plugins: [
        MarkersPlugin,
        [VirtualTourPlugin, {
            positionMode: 'manual',
            renderMode: '3d',
            nodes: [{
                id: 1,
                panorama: {
                    left: './sample-pano/_r.jpg',
                    front: './sample-pano/_b.jpg',
                    right: './sample-pano/_l.jpg',
                    back: './sample-pano/_f.jpg',
                    top: './sample-pano/_u.jpg',
                    bottom: './sample-pano/_d.jpg'
                },
                markers: [{
                    id: 'polygon',
                    position: {
                        textureFace: 'front',
                        textureX: 200,
                        textureY: 800
                    },
                    polygonPixels: [
                        [[100, 200], [150, 300], [300, 200]],
                    ],
                }]
            }]
        }],
    ]
});
@Re-n-Im Re-n-Im added the bug label Jan 10, 2025
@mistic100
Copy link
Owner

You cannot use position and polygonPixels together.
See the bottom line in the doc https://photo-sphere-viewer.js.org/plugins/markers.html#position-required-for-all-but-polygons-polylines.

Unfortunately polygonPixels does not support cubemaps at all for now. I suggest you use polygon instead with spherical coordinates. Or wait.

@mistic100 mistic100 added feature and removed bug labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants