Skip to content

Commit

Permalink
- CHG: Trying to fix markers not updating.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-raubach committed May 17, 2024
1 parent addf5ec commit 91acc0e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 39 deletions.
2 changes: 2 additions & 0 deletions src/components/MultiLocationMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ export default {
}
}
this.clusterer.ProcessView()
this.isInitializing = false
},
updateThemeLayer: function () {
Expand Down
78 changes: 39 additions & 39 deletions src/views/ImageMap.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div>
<MultiLocationMap :images="filteredLocations" />
<MultiLocationMap :images="locations" />

<v-toolbar>
<!-- <v-toolbar>
<v-range-slider hide-details="auto"
class="mt-6 me-6"
:label="$t('widgetMapDateRange')"
Expand All @@ -16,7 +16,7 @@
{{ new Date(minDate + (modelValue * 1000 * 60 * 24)).toLocaleDateString() }}
</template>
</v-range-slider>
</v-toolbar>
</v-toolbar> -->
</div>
</template>

Expand All @@ -38,49 +38,49 @@ export default {
}
},
computed: {
filteredLocations: function () {
if (this.dateRange && (this.dateRange[0] !== 0 || this.dateRange[1] !== this.totalDays)) {
const start = new Date(this.minDate)
start.setDate(start.getDate() + this.dateRange[0])
const end = new Date(this.minDate)
end.setDate(end.getDate() + this.dateRange[1])
// filteredLocations: function () {
// if (this.dateRange && (this.dateRange[0] !== 0 || this.dateRange[1] !== this.totalDays)) {
// const start = new Date(this.minDate)
// start.setDate(start.getDate() + this.dateRange[0])
// const end = new Date(this.minDate)
// end.setDate(end.getDate() + this.dateRange[1])
return this.locations.filter(l => l.date >= start.getTime() && l.date <= end.getTime())
} else {
return this.locations
}
}
// return this.locations.filter(l => l.date >= start.getTime() && l.date <= end.getTime())
// } else {
// return this.locations
// }
// }
},
mounted: function () {
apiGetLocations(locations => {
const dates = []
locations.forEach(l => {
let d = null
if (l.exif) {
if (l.exif.dateTimeOriginal) {
d = new Date(l.exif.dateTimeOriginal)
} else if (l.exif.dateTime) {
d = new Date(l.exif.dateTime)
} else {
d = new Date(l.updatedOn)
}
} else {
d = new Date(l.updatedOn)
}
// const dates = []
// locations.forEach(l => {
// let d = null
// if (l.exif) {
// if (l.exif.dateTimeOriginal) {
// d = new Date(l.exif.dateTimeOriginal)
// } else if (l.exif.dateTime) {
// d = new Date(l.exif.dateTime)
// } else {
// d = new Date(l.updatedOn)
// }
// } else {
// d = new Date(l.updatedOn)
// }
l.date = d ? d.getTime() : null
// l.date = d ? d.getTime() : null
if (d) {
dates.push(d)
}
// if (d) {
// dates.push(d)
// }
if (dates.length > 0) {
this.minDate = Math.min(...dates)
this.maxDate = Math.max(...dates)
this.totalDays = Math.ceil((this.maxDate - this.minDate) / (1000 * 60 * 60 * 24))
this.dateRange = [0, this.totalDays]
}
})
// if (dates.length > 0) {
// this.minDate = Math.min(...dates)
// this.maxDate = Math.max(...dates)
// this.totalDays = Math.ceil((this.maxDate - this.minDate) / (1000 * 60 * 60 * 24))
// this.dateRange = [0, this.totalDays]
// }
// })
this.locations = locations
})
Expand Down

0 comments on commit 91acc0e

Please sign in to comment.