fix: map going off screen in fullscreen
This commit is contained in:
@ -85,7 +85,10 @@
|
||||
const fullHeight = window.innerHeight - 20 - 40 - 10;
|
||||
if (fullscreen[view.current.type]) {
|
||||
if(sidebarHeight != fullHeight) {
|
||||
if(window.__TAURI__) hideSearch = true;
|
||||
if(window.innerWidth < 768) {
|
||||
hideSearch = true;
|
||||
map.ignorePadding = true;
|
||||
}
|
||||
previousHeight = sidebarHeight;
|
||||
sidebarHeight = fullHeight;
|
||||
requestAnimationFrame(() => { map.updateMapPadding(); } );
|
||||
@ -93,6 +96,7 @@
|
||||
} else {
|
||||
hideSearch = false;
|
||||
if(sidebarHeight == fullHeight) {
|
||||
map.ignorePadding = false;
|
||||
sidebarHeight = previousHeight;
|
||||
requestAnimationFrame(() => { map.updateMapPadding(); } );
|
||||
}
|
||||
|
||||
@ -8,8 +8,9 @@ import { view } from "./view.svelte";
|
||||
export const map = $state({
|
||||
value: undefined as maplibregl.Map | undefined,
|
||||
zoom: 0,
|
||||
ignorePadding: false,
|
||||
updateMapPadding: () => {
|
||||
if (document.querySelector<HTMLDivElement>("#sidebar") == null) {
|
||||
if (document.querySelector<HTMLDivElement>("#sidebar") == null || map.ignorePadding) {
|
||||
map._setPadding({
|
||||
top: 0,
|
||||
right: 0,
|
||||
|
||||
Reference in New Issue
Block a user