Closed Rusachok closed 2 months ago
markers.addEventListener('select-marker', ({ marker }) => {
markers.showMarkerTooltip(marker.id);
});
written from memory, please check the API documentation for details
Thanks! It would be great to have toggleMarkerTooltip(id)
.
So, now it is work:
virtualTour.markers.addEventListener('select-marker', ({ marker }) => {
if (marker.state.staticTooltip){
virtualTour.markers.hideMarkerTooltip(marker.id);
}
else {
virtualTour.markers.showMarkerTooltip(marker.id);
}
});
I just realised my answer is wrong
You can change the trigger of the tooltip, check the doc.
tooltip?: string | { content: string; position?: string; className?: string; trigger?: 'hover' | 'click' };
I'm ashamed, but I can't figure out how to use it in my case - with a plugin VirtualTourPlugin. And I couldn't find info in doc.
change tooltip: 'Дизайнерская ваза. Hand Made',
to tooltip: { content: 'Дизайнерская ваза. Hand Made', trigger: 'click' }
No, it is not work with VirtualTourPlugin: https://vi-tour.ru/s/qyjtbuht/?addmap=1
Of course, you have extra double quote arround your object, so it interpret the whole object as a string.
I didn't put double quotes in my example above
Oh, shame on me! Thanks.
Describe your problem
I'm using a MarkersPlugin and markers with tooltips. I like the markers with hints, they are perfectly displayed and pop up on the computer. And they don't work on the phone. I would like the hints to pop up when you click on i. Is it possible?
Online demo URL
https://vi-tour.ru/s/qyjtbuht/
Photo Sphere Viewer version
5.8.2
Plugins loaded
No response
Additional context
No response