mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-03 20:25: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",
|
"copy_link": "Copy Link",
|
||||||
"image": "Image",
|
"image": "Image",
|
||||||
"upload_image": "Upload Image",
|
"upload_image": "Upload Image",
|
||||||
|
"open_in_maps": "Open in Maps",
|
||||||
"url": "URL",
|
"url": "URL",
|
||||||
"fetch_image": "Fetch Image",
|
"fetch_image": "Fetch Image",
|
||||||
"wikipedia": "Wikipedia",
|
"wikipedia": "Wikipedia",
|
||||||
|
|
|
@ -436,6 +436,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/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
|
<MapLibre
|
||||||
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
|
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"
|
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}
|
{/each}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
<button
|
<div class="flex flex-col">
|
||||||
class="btn btn-neutral btn-wide btn-sm mt-4"
|
{#if adventure.longitude && adventure.latitude}
|
||||||
on:click={() => goto(`/adventures/${adventure.id}`)}>{$t('map.view_details')}</button
|
<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>
|
</Popup>
|
||||||
{/if}
|
{/if}
|
||||||
</Marker>
|
</Marker>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue