Skip to content

Commit

Permalink
Fix timeDimension interval to ISO String
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-ha authored Jun 30, 2022
1 parent a3fc439 commit b0f5b8b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,17 @@ module.exports = {
},
addTimeDimension() {
// console.log(`timeDimension: timeInterval=${this.timeInterval} period=${this.period} loop=${this.loop} autoPlay=${this.autoPlay} transitionTime=${1000/this.fps}`)
let mapTimeInterval = this.timeInterval
if (this.timeInterval !== '/P1Y'){
const startTime = new Date(this.timeInterval.split('/')[0], 0)
const endTime = new Date(this.timeInterval.split('/')[1], 1)
//console.log('start and end string', startTime.toString(), endTime.toString());
mapTimeInterval = startTime.toISOString() + '/' + endTime.toISOString();
}
let timeDimension = new L.TimeDimension({
// times: [],
timeInterval: this.timeInterval,
timeInterval: mapTimeInterval,
timeDimensionControl: true,
period: this.period,
// validTimeRange: undefined,
Expand Down

0 comments on commit b0f5b8b

Please sign in to comment.