Commit 1b473bee authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

test

parent 616feaa8
......@@ -126,10 +126,10 @@ var L;
var validtimes = L.TimeDimension.Util.explodeTimeRange(new Date(allAvailableTimes[0]), new Date(allAvailableTimes[allAvailableTimes.length - 1]), 'PT15M');
if (filterAvailableTimes.length > 0)
validtimes = L.TimeDimension.Util.explodeTimeRange(new Date(filterAvailableTimes[0]), new Date(filterAvailableTimes[filterAvailableTimes.length - 1]), 'PT15M');
var timeIndex = self.timeDimension.getCurrentTimeIndex();
console.log(self.timeDimension.getCurrentTimeIndex());
self.timeIndex = (self.timeIndex == 0) && self.timeDimension.getCurrentTimeIndex();
console.log(self.timeIndex);
self.timeDimension.setAvailableTimes(validtimes, 'replace');
self.timeDimension.setCurrentTimeIndex(keepTimeIndex && timeIndex > 0 && timeIndex || 0);
self.timeDimension.setCurrentTimeIndex(keepTimeIndex && self.timeIndex > 0 && self.timeIndex || 0);
console.log(self.timeDimension.getCurrentTimeIndex());
if (this.timeDimension._syncedLayers.length > 0) {
self.update({
......
This diff is collapsed.
......@@ -25,6 +25,7 @@ export class Player extends L.Control {
private display : string;
private player : any;
private timeDimension : any;
private timeIndex : number;
constructor(options) {
......@@ -145,10 +146,10 @@ export class Player extends L.Control {
if (filterAvailableTimes.length > 0)
validtimes = L.TimeDimension.Util.explodeTimeRange(new Date(filterAvailableTimes[0]),new Date(filterAvailableTimes[filterAvailableTimes.length-1]), 'PT15M');
var timeIndex = self.timeDimension.getCurrentTimeIndex();
console.log(self.timeDimension.getCurrentTimeIndex());
self.timeIndex = (self.timeIndex == 0) && self.timeDimension.getCurrentTimeIndex();
console.log(self.timeIndex);
self.timeDimension.setAvailableTimes(validtimes, 'replace');
self.timeDimension.setCurrentTimeIndex(keepTimeIndex && timeIndex > 0 && timeIndex|| 0);
self.timeDimension.setCurrentTimeIndex(keepTimeIndex && self.timeIndex > 0 && self.timeIndex|| 0);
console.log(self.timeDimension.getCurrentTimeIndex());
if (this.timeDimension._syncedLayers.length > 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment