1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

Add clear map function

This commit is contained in:
Sean Morley 2024-08-23 14:24:30 -04:00
parent b11c3de461
commit f75c650a20
2 changed files with 15 additions and 2 deletions

View file

@ -101,6 +101,13 @@
}
}
function clearMap() {
console.log('CLEAR');
markers = [];
region_id = null;
region_name = null;
}
let imageSearch: string = adventure.name || '';
async function removeImage(id: string) {
@ -298,6 +305,9 @@
if (data.in_region) {
region_name = data.region_name;
region_id = data.region_id;
} else {
region_id = null;
region_name = null;
}
}
@ -637,6 +647,9 @@
bind:value={query}
/>
<button class="btn btn-neutral -mt-1" type="submit">Search</button>
<button class="btn btn-neutral -mt-1" type="button" on:click={clearMap}
>Clear Map</button
>
</form>
</div>
{#if places.length > 0}