Commit 787e0485 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

keepPosition in refresh

parent d05ddf67
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="def/uikit.d.ts" />
/// <reference path="def/leaflet.d.ts" />
/// <reference path="def/moment.d.ts" />
/// <reference path="def/leaflet-timedimension.d.ts" />
/// <reference path="def/reqwest.d.ts" />
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var L;
(function (L) {
var Control;
......@@ -11,31 +20,32 @@ var L;
var Player = (function (_super) {
__extends(Player, _super);
function Player(options) {
_super.call(this, options);
var _this = _super.call(this, options) || this;
if (options.domain) {
this.domain = options.domain;
_this.domain = options.domain;
}
this.lang = "en";
_this.lang = "en";
if (options.lang) {
this.lang = options.lang;
_this.lang = options.lang;
}
if (options.langdata) {
this.langData = options.langdata;
_this.langData = options.langdata;
}
this.display = 'vertical';
_this.display = 'vertical';
if (options.display) {
this.display = options.display;
_this.display = options.display;
}
this.transitionTime = 500;
_this.transitionTime = 500;
if (options.transitionTime) {
this.transitionTime = options.transitionTime;
_this.transitionTime = options.transitionTime;
}
this.interval = 900;
_this.interval = 900;
if (options.interval) {
this.interval = options.interval;
_this.interval = options.interval;
}
this.datetimeformat = 'YYYY-MM-DD HH:mm';
this.datetimeformatZ = 'YYYY-MM-DDTHH:mm:ss[Z]';
_this.datetimeformat = 'YYYY-MM-DD HH:mm';
_this.datetimeformatZ = 'YYYY-MM-DDTHH:mm:ss[Z]';
return _this;
}
Player.prototype.onAdd = function (map) {
var self = this;
......@@ -95,7 +105,7 @@ var L;
Player.prototype.getTimeDimension = function () {
return this.timeDimension;
};
Player.prototype.refresh = function () {
Player.prototype.refresh = function (keepPosition) {
var self = this;
if (self.timeDimension) {
var allAvailableTimes = [];
......@@ -111,7 +121,7 @@ var L;
if (filterAvailableTimes.length > 0)
validtimes = L.TimeDimension.Util.explodeTimeRange(new Date(filterAvailableTimes[0]), new Date(filterAvailableTimes[filterAvailableTimes.length - 1]), 'PT15M');
self.timeDimension.setAvailableTimes(validtimes, 'replace');
self.timeDimension.setCurrentTimeIndex(0);
(keepPosition) ? self.timeDimension.setCurrentTimeIndex(self.timeDimension.getCurrentTimeIndex() || 0) : self.timeDimension.setCurrentTimeIndex(0);
if (this.timeDimension._syncedLayers.length > 0) {
self.update({
date: +moment(self.timeDimension.getCurrentTime()).utc().format("X"),
......@@ -368,3 +378,4 @@ var L;
Control.Player = Player;
})(Control = L.Control || (L.Control = {}));
})(L || (L = {}));
//# sourceMappingURL=leaflet-player-control.js.map
\ No newline at end of file
{"version":3,"file":"leaflet-player-control.js","sourceRoot":"","sources":["leaflet-player-control.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,yCAAyC;AACzC,wCAAwC;AACxC,uDAAuD;AACvD,yCAAyC;;;;;;;;;;;AAEzC,IAAO,CAAC,CA6YP;AA7YD,WAAO,CAAC;IAAC,IAAA,OAAO,CA6Yf;IA7YQ,WAAA,OAAO;QAChB;YAA4B,0BAAS;YAsBjC,gBAAY,OAAO;gBAAnB,YACE,kBAAM,OAAO,CAAC,SA0Bf;gBAzBC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;oBACjB,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;gBACjC,CAAC;gBACD,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;gBACjB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;oBACf,KAAI,CAAC,IA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AAAD,CAAC,EA7YM,CAAC,KAAD,CAAC,QA6YP"}
\ No newline at end of file
/// <reference path="def/uikit.d.ts" />
/// <reference path="def/leaflet.d.ts" />
/// <reference path="def/moment.d.ts" />
/// <reference path="def/leaflet-timedimension.d.ts" />
/// <reference path="def/reqwest.d.ts" />
module L.Control {
export class Player extends L.Control {
......@@ -118,7 +122,7 @@ export class Player extends L.Control {
}
public refresh() {
public refresh(keepPosition:boolean) {
var self = this;
if (self.timeDimension) {
var allAvailableTimes = [];
......@@ -134,7 +138,7 @@ export class Player extends L.Control {
validtimes = L.TimeDimension.Util.explodeTimeRange(new Date(filterAvailableTimes[0]),new Date(filterAvailableTimes[filterAvailableTimes.length-1]), 'PT15M');
self.timeDimension.setAvailableTimes(validtimes, 'replace');
self.timeDimension.setCurrentTimeIndex(0);
(keepPosition)?self.timeDimension.setCurrentTimeIndex(self.timeDimension.getCurrentTimeIndex() || 0):self.timeDimension.setCurrentTimeIndex(0);
if (this.timeDimension._syncedLayers.length > 0) {
self.update({
date: +moment(self.timeDimension.getCurrentTime()).utc().format("X"),
......
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap" : true
},
"files": [
"src/leaflet-player-control.ts"
],
"exclude": [
"node_modules",
"bower_components",
"dist",
"demo",
".git"
]
}
\ No newline at end of file
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