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

Marker with virtual tour #743

Closed
aplonogax opened this issue Sep 1, 2022 · 4 comments
Closed

Marker with virtual tour #743

aplonogax opened this issue Sep 1, 2022 · 4 comments
Labels
Milestone

Comments

@aplonogax
Copy link

Hi,

I'm using PSV version 4.7.0, in a small angular project. I use both Marker and VirtualTour plugin because I'd like to have both the navigation functionality and a list of markers for every node, but I have no clue on how to make it work.
I've tried to define a node with a "markers" property, populated with new object, something like

markers: [{
        id: '11',
        type: 'imageLayer',
        visible: true,
        config: {
          id: '11',
          longitude: 60,
          latitude: 60,
          imageLayer: './assets/images/pin-red.png',
          width: 32,
          height: 32,
        },
        is3d: () => { return false },
        isNormal: () => { return true },
        isPoly: () => { return false },
        isPolyPx: () => { return false },
        isPolyRad: () => { return false },
        isPolygon: () => { return false },
        isPolyline: () => { return false },
        isSvg: () => { return false }
      }],
...

I also tried to first create a Marker with the addMarker function from the Marker plugin, but I always get the same error:

ERROR Error: Uncaught (in promise): PSVError: missing marker content, either image, imageLayer, html, polygonPx, polygonRad, polylinePx, polylineRad, square, rect, circle, ellipse, path
PSVError: missing marker content, either image, imageLayer, html, polygonPx, polygonRad, polylinePx, polylineRad, square, rect, circle, ellipse, path
    at Function.getType (markers.js:1130:1)

I've looked in the official documentation but I found nothing. Is probably something I'm doing wrong but I have no clue on what can be. Also, in the documentation it says: The plugin allows to define nodes which contains a panorama and one or more links to other nodes. The links are represented with a 3D arrow (default) or using the Markers plugin. and also on this I found no clue on how to use marker plugin to represent links.

Any help will be really appreceated
Thank
Tommaso

@aplonogax aplonogax changed the title Marker vith virtual tour Marker with virtual tour Sep 1, 2022
@mistic100
Copy link
Owner

mistic100 commented Sep 1, 2022

Hello

Markers are configured with MarkerProperties objects not with the Marker object which is internal.

Look at the exemple source https://photo-sphere-viewer.js.org/plugins/plugin-markers.html#example

@aplonogax
Copy link
Author

Hi,

Thanks for the replay, the example you provided me works with no problem.

The issue I'm facing is by adding a list of markers to a node of a VirtualPlugin. I'm not entirely sure if this is a matter of angular, typescript or PSV, and so I'm tryng every things that pop in my mind :)

If you could provide me a working example of a viewer with 2 node, and some markers on each nodes I will try to understand what I'm doing wrong.

Thanks
Tommaso

@mistic100
Copy link
Owner

mistic100 commented Sep 1, 2022

The problem is a mistake in the type definition

I will fix it

In the meantime, use a MarkerProperties object (not a Marker) and break the type check with as any or // @ts-ignore

@mistic100 mistic100 added the bug label Sep 1, 2022
@mistic100 mistic100 added this to the 4.7.1 milestone Sep 1, 2022
@github-actions
Copy link

github-actions bot commented Sep 3, 2022

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

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