mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 16:52:31 +00:00
toggle 3d button
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
newMap.addControl(scaleControl);
|
||||
|
||||
newMap.on('style.load', toggleTerrain);
|
||||
newMap.on('pitchstart', toggleTerrain);
|
||||
newMap.on('pitch', toggleTerrain);
|
||||
});
|
||||
|
||||
$: if ($map) {
|
||||
|
@@ -3,9 +3,23 @@
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import Logo from './Logo.svelte';
|
||||
import Shortcut from './Shortcut.svelte';
|
||||
import { Plus, Copy, Download, Undo2, Redo2, Trash2, Upload, Cloud, Heart } from 'lucide-svelte';
|
||||
import {
|
||||
Plus,
|
||||
Copy,
|
||||
Download,
|
||||
Undo2,
|
||||
Redo2,
|
||||
Trash2,
|
||||
Upload,
|
||||
Cloud,
|
||||
Heart,
|
||||
Map,
|
||||
Layers2,
|
||||
Box
|
||||
} from 'lucide-svelte';
|
||||
|
||||
import {
|
||||
map,
|
||||
selectedFiles,
|
||||
exportAllFiles,
|
||||
exportSelectedFiles,
|
||||
@@ -55,6 +69,16 @@
|
||||
[$currentOverlays, $previousOverlays] = [$previousOverlays, defaultOverlays];
|
||||
}
|
||||
}
|
||||
|
||||
function toggle3D() {
|
||||
if ($map) {
|
||||
if ($map.getPitch() === 0) {
|
||||
$map.easeTo({ pitch: 70 });
|
||||
} else {
|
||||
$map.easeTo({ pitch: 0 });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="absolute top-2 left-0 right-0 z-20 flex flex-row justify-center pointer-events-none">
|
||||
@@ -143,10 +167,20 @@
|
||||
<Menubar.Trigger>{$_('menu.view')}</Menubar.Trigger>
|
||||
<Menubar.Content class="border-none">
|
||||
<Menubar.Item on:click={switchBasemaps}
|
||||
>{$_('menu.switch_basemap')}<Shortcut key="F1" /></Menubar.Item
|
||||
><Map size="16" class="mr-1" />{$_('menu.switch_basemap')}<Shortcut
|
||||
key="F1"
|
||||
/></Menubar.Item
|
||||
>
|
||||
<Menubar.Item on:click={toggleOverlays}
|
||||
>{$_('menu.toggle_overlays')}<Shortcut key="F2" /></Menubar.Item
|
||||
><Layers2 size="16" class="mr-1" />{$_('menu.toggle_overlays')}<Shortcut
|
||||
key="F2"
|
||||
/></Menubar.Item
|
||||
>
|
||||
<Menubar.Separator />
|
||||
<Menubar.Item on:click={toggle3D}
|
||||
><Box size="16" class="mr-1" />{$_('menu.toggle_3d')}<Shortcut
|
||||
key="{$_('menu.ctrl')}+{$_('menu.drag')}"
|
||||
/></Menubar.Item
|
||||
>
|
||||
</Menubar.Content>
|
||||
</Menubar.Menu>
|
||||
|
Reference in New Issue
Block a user