1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-02 19:55:18 +02:00

feat: Add "Open in Maps" button for adventures with location coordinates

This commit is contained in:
Sean Morley 2025-02-22 20:36:25 -05:00
parent b61083f7df
commit d5311bb71e
3 changed files with 22 additions and 4 deletions

View file

@ -113,6 +113,7 @@
"copy_link": "Copy Link",
"image": "Image",
"upload_image": "Upload Image",
"open_in_maps": "Open in Maps",
"url": "URL",
"fetch_image": "Fetch Image",
"wikipedia": "Wikipedia",

View file

@ -436,6 +436,12 @@
</div>
</div>
{/if}
<a
class="btn btn-neutral btn-sm max-w-32"
href={`https://maps.apple.com/?q=${adventure.latitude},${adventure.longitude}`}
target="_blank"
rel="noopener noreferrer">{$t('adventures.open_in_maps')}</a
>
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
class="flex items-center self-center justify-center aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-10/12 rounded-lg"

View file

@ -163,10 +163,21 @@
{/each}
</p>
{/if}
<button
class="btn btn-neutral btn-wide btn-sm mt-4"
on:click={() => goto(`/adventures/${adventure.id}`)}>{$t('map.view_details')}</button
>
<div class="flex flex-col">
{#if adventure.longitude && adventure.latitude}
<a
class="btn btn-neutral btn-wide btn-sm mt-4"
href={`https://maps.apple.com/?q=${adventure.latitude},${adventure.longitude}`}
target="_blank"
rel="noopener noreferrer">{$t('adventures.open_in_maps')}</a
>
{/if}
<button
class="btn btn-neutral btn-wide btn-sm mt-2"
on:click={() => goto(`/adventures/${adventure.id}`)}
>{$t('map.view_details')}</button
>
</div>
</Popup>
{/if}
</Marker>