mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-07-30 15:28:30 -04:00
Refactor image pin geoJSON handling in location page. Moved image pin geoJSON computation back to reactive statements for better clarity and maintainability.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -73,15 +73,6 @@
|
||||
let showTrailTracks = true;
|
||||
let showImagePins = true;
|
||||
|
||||
$: imagePinGeoJson = adventure
|
||||
? contentImagesToGeoJson(adventure.images, {
|
||||
parentType: 'location',
|
||||
parentId: adventure.id,
|
||||
parentName: adventure.name
|
||||
})
|
||||
: EMPTY_IMAGE_PIN_GEOJSON;
|
||||
$: hasImagePins = imagePinGeoJson.features.length > 0;
|
||||
|
||||
async function loadSunriseSunsetForDate(date: string) {
|
||||
if (!adventure?.id || sunriseSunsetLoading[date] || visitSunriseSunset[date]) {
|
||||
return;
|
||||
@@ -142,6 +133,15 @@
|
||||
|
||||
$: applyLocationPageData(data.props.adventure);
|
||||
|
||||
$: imagePinGeoJson = adventure
|
||||
? contentImagesToGeoJson(adventure.images, {
|
||||
parentType: 'location',
|
||||
parentId: adventure.id,
|
||||
parentName: adventure.name
|
||||
})
|
||||
: EMPTY_IMAGE_PIN_GEOJSON;
|
||||
$: hasImagePins = imagePinGeoJson.features.length > 0;
|
||||
|
||||
function hasActivityGeojson(adventure: Location) {
|
||||
return adventure.visits.some((visit) => visit.activities.some((activity) => activity.geojson));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user