Add example: Enter a 360° photosphere (#4428)#7942
Conversation
Prototypes street-view-style navigation for maplibre#4428: click a marker to smoothly enter an immersive 360° photosphere at a fixed real-world point (Pont de Bir-Hakeim, Paris), blended with the live map during the transition, then exit back to normal navigation. The panorama layer is deliberately shaped like a real style-spec layer (https://maplibre.org/maplibre-style-spec/layers/) - a `type` and a `paint` object of hyphenated properties - sketching what a native "panorama" layer type could look like, while being implemented today as a CustomLayerInterface (no core changes needed). Panorama photo: "Paris s'éveille" by Alexandre Duret-Lutz, CC BY-SA 2.0, resized/recompressed from the original for a lighter page load.
4ef7663 to
a12ade4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7942 +/- ##
==========================================
- Coverage 93.39% 93.38% -0.01%
==========================================
Files 290 290
Lines 24579 24579
Branches 6471 6471
==========================================
- Hits 22955 22953 -2
- Misses 1624 1626 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ontraction Adds Duret, Hakeim, s'éveille/éveille (photo credit/place names), equirectangular and Parameteri (real technical terms) to the cspell word list, and rewords "doesn't" to "does not" to sidestep the same contraction-splitting issue already whitelisted elsewhere (didn, hasn).
Rewords comments to avoid the rest; keeps only the WebGL API name fragment (Parameteri) and the photo author's name (Duret, CC BY-SA attribution). Source link now uses the numeric page id.
|
Found two causes for the photosphere never showing and fixed both:
Verified end to end (marker click, panorama shown, drag to look around, exit) and regenerated the thumbnail. |
Switch the basemap from the crash-prone liberty style to plain OpenStreetMap raster tiles, add centerClampedToGround: false so the eye-height elevation in the enter/exit animations really applies, deduplicate the enter/exit transition into one animateTransition(), drop the FOV keyboard controls, and regenerate the thumbnail. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
96fc72a to
361f667
Compare
|
So, I read over #4428 what you said is the problem and what you are now adding is a bit different. I think this should be a plugin and the example should show how to use said plugin. |
Per review, the photosphere implementation moved to a plugin where it can be tested properly; this example only shows plugin usage. 470 to 135 lines. The unpkg import resolves once the package is published. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Agreed, moved the implementation to a plugin: the Photosphere class (shaders, enter/exit transitions, look controls) now lives in a maplibre-gl-photosphere package with its own unit tests, and this example is down to 135 lines of plugin usage. Converting back to draft until the package is published on npm so the unpkg import in the example resolves. |
There was a problem hiding this comment.
This file should be in assets, but not inside the examples folder. this folder is kept for the examples "thumbnail" image.
|
I think this looks fine now. |
CommanderStorm
left a comment
There was a problem hiding this comment.
assuming Harels move is done

Fixes #4428 with a documentation example: click a marker to "enter" a 360° photosphere at that location. A custom layer ray-casts each screen pixel into panorama UV space; entering animates a real fly-in with parallax (ray-sphere intersection until the eye reaches the center). Photo: Alexandre Duret-Lutz, CC BY-SA 2.0.
Launch Checklist
Assisted-By: Claude Sonnet 5 (claude-sonnet-5)