# map.svelte — Map

<p class="callout danger">**TODO:** We still don't have the map format, function is subject to change</p>

<span style="white-space: pre-wrap;">Displays a static map that the operator imports. The map is stored in the </span>`<span class="editor-theme-code">maps/</span>`<span style="white-space: pre-wrap;"> app data directory and loaded using Tauri's asset protocol (</span>`<span class="editor-theme-code">convertFileSrc</span>`).

### Map selection flow

<span style="white-space: pre-wrap;">On mount, the component checks the </span>`<span class="editor-theme-code">displayedMap</span>`<span style="white-space: pre-wrap;"> store. If a map is already selected (from a previous navigation within the session) it loads it directly. If not, it lists available map files and presents a selection UI. If exactly one map file exists it is auto-selected and confirmed without operator interaction.</span>

<span style="white-space: pre-wrap;">Once a map is confirmed, the full path is constructed using </span>`<span class="editor-theme-code">appDataDir()</span>`<span style="white-space: pre-wrap;"> and converted to a Tauri asset URL for display. The selected map is written to the </span>`<span class="editor-theme-code">displayedMap</span>`<span style="white-space: pre-wrap;"> store so other components (and other routes) can access it.</span>

A reload button (⟳) resets the selection and re-lists available files. Mouse coordinates over the map are tracked and displayed, laying the groundwork for click-based waypoint placement.