mistic100 / Photo-Sphere-Viewer

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

Support for Leaflet.js (or OpenStreetMap) on Map plugin #845

Closed alexsaleh closed 9 months ago

alexsaleh commented 1 year ago

Describe the feature

It would be amazing to have the Map Plugin support having a dynamic Leaflet map instead of a static image. This would allow the user to also interact with the map in order to change the panorama image using events.

Alternatives you've considered

Currently I'm overlaying a map on top of photo-sphere-viewer.

Additional context

No response

mistic100 commented 1 year ago

I will leave this issue open for reference but will probably never do it my self. The complexity and diversity of GIS is not something I want to dive into (I already have to do some maintenance on Open Layers at work and I don't like it).

Someone else probably can create another plugin

mistic100 commented 9 months ago

Preview of the new plugin "plan" (because "map" is already taken) using Leaflet

Screenshot 2024-01-21 at 20-11-58 PhotoSphereViewer - plan demo

disclaimer : no availability date, it's done when it's done :)

mistic100 commented 9 months ago

The plan is now working with the virtual tour (and if you are being fancy you can use the plan and the map together... but why ?)

plan

mistic100 commented 9 months ago

The plugin is available for testing in version 5.7.0-alpha.1

doc : https://photo-sphere-viewer.js.org/plugins/plan.html
example : https://github.com/mistic100/Photo-Sphere-Viewer/blob/main/examples/plugin-plan.html

haldo98 commented 9 months ago

Thank You Damien !!!!

You said "no availability date" but that was fast... :-)

Tried.... Used a webpage that works with the 5.6 release..... changed the refs to @5.7.0-alpha.1

but a lot of error in the console...

https://www.tadini.it/temp/Panorama_Test_Plan.html

mistic100 commented 9 months ago

That's a problem with the UMD package, I will fix it. But anyway you should switch to ES modules. ThreeJS will remove non ESM builds shortly, as visible in the console

Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+, and will be removed with r160.

The installation guide now uses ESM https://photo-sphere-viewer.js.org/guide/#your-first-viewer

haldo98 commented 9 months ago

switched the same page to ESM

https://www.tadini.it/temp/Panorama_Test_Plan.html

but the rendering of the OpenStreetMap is weird and not complete...

The console says A form field element should have an id or name attribute

mistic100 commented 9 months ago

You are missing leaflet CSS.

https://leafletjs.com/examples/quick-start/

haldo98 commented 9 months ago

Oh my.... Yes.

Sorry...

github-actions[bot] commented 9 months ago

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