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