fix flickering when transitioning from satellite view to street view
All checks were successful
pedestrian-simulator / build (push) Successful in 58s
All checks were successful
pedestrian-simulator / build (push) Successful in 58s
This commit is contained in:
@@ -1702,14 +1702,14 @@ function updateViewMode() {
|
|||||||
// Switching TO Street View (from Satellite/Map)
|
// Switching TO Street View (from Satellite/Map)
|
||||||
// Transition: Animate Main Map shrinking into Minimap
|
// Transition: Animate Main Map shrinking into Minimap
|
||||||
|
|
||||||
animateMapToMinimap(() => {
|
// Show SV and Minimap immediately so they are visible behind the shrinking map
|
||||||
// Show SV and Minimap, Hide Main Map
|
|
||||||
panoDiv.classList.remove('hidden-mode');
|
panoDiv.classList.remove('hidden-mode');
|
||||||
minimapContainer.classList.remove('hidden-mode');
|
minimapContainer.classList.remove('hidden-mode');
|
||||||
|
|
||||||
// Fix Black Screen: Trigger resize when pano becomes visible
|
// Trigger resize early to ensure pano is rendered correctly during reveal
|
||||||
google.maps.event.trigger(panorama, 'resize');
|
google.maps.event.trigger(panorama, 'resize');
|
||||||
|
|
||||||
|
animateMapToMinimap(() => {
|
||||||
mainMapDiv.classList.add('hidden-mode');
|
mainMapDiv.classList.add('hidden-mode');
|
||||||
// Ensure styles are cleaned up
|
// Ensure styles are cleaned up
|
||||||
mainMapDiv.style.top = '';
|
mainMapDiv.style.top = '';
|
||||||
@@ -1743,8 +1743,7 @@ function updateViewMode() {
|
|||||||
|
|
||||||
if (mainMapDiv.classList.contains('hidden-mode')) {
|
if (mainMapDiv.classList.contains('hidden-mode')) {
|
||||||
// Switching FROM Street View TO Map
|
// Switching FROM Street View TO Map
|
||||||
// Hide SV immediately for clean transition? Or keep behind?
|
// Keep SV visible behind for clean transition
|
||||||
panoDiv.classList.add('hidden-mode');
|
|
||||||
|
|
||||||
animateMapToFullscreen(() => {
|
animateMapToFullscreen(() => {
|
||||||
minimapContainer.classList.add('hidden-mode');
|
minimapContainer.classList.add('hidden-mode');
|
||||||
@@ -1753,7 +1752,6 @@ function updateViewMode() {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Just switching Map <-> Satellite (No animation needed)
|
// Just switching Map <-> Satellite (No animation needed)
|
||||||
panoDiv.classList.add('hidden-mode');
|
|
||||||
mainMapDiv.classList.remove('hidden-mode');
|
mainMapDiv.classList.remove('hidden-mode');
|
||||||
minimapContainer.classList.add('hidden-mode');
|
minimapContainer.classList.add('hidden-mode');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user