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:
parent
b61083f7df
commit
d5311bb71e
3 changed files with 22 additions and 4 deletions
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue