Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"use strict";
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Created by gavorhes on 12/4/2015.
*/
var RealEarthAnimate_1 = require("./RealEarthAnimate");
var provide_1 = require("../util/provide");
var nm = provide_1.default('mixin');
/**
* Animate real earth tile
* @augments RealEarthAnimate
*/
var RealEarthAnimateTile = (function (_super) {
__extends(RealEarthAnimateTile, _super);
function RealEarthAnimateTile(layer, loadCallback) {
var _this = _super.call(this, layer, loadCallback) || this;
_this._source = layer.source;
_this._olLayer = layer.olLayer;
return _this;
}
RealEarthAnimateTile.prototype.timeInit = function () {
_super.prototype.timeInit.call(this);
this._sourceUrls = [];
};
RealEarthAnimateTile.prototype._loadDates = function (inString) {
var rawDte = _super.prototype._loadDates.call(this, inString);
var dteProductUrl = "http://realearth.ssec.wisc.edu/api/image?products=" + this._products + "_" + rawDte + "&x={x}&y={y}&z={z}";
this._sourceUrls.push(dteProductUrl);
return '';
};
/**
* @protected
*/
RealEarthAnimateTile.prototype._loadLatest = function () {
if (_super.prototype._loadLatest.call(this)) {
this._source.setUrl(this._sourceUrls[this._sourceUrls.length - 1]);
}
return true;
};
RealEarthAnimateTile.prototype.setLayerTime = function (theTime) {
if (_super.prototype.setLayerTime.call(this, theTime)) {
if (this._olLayer.getZIndex() < 0) {
this._olLayer.setZIndex(0);
}
this._source.setUrl(this._sourceUrls[this._currentIndex]);
}
else {
this._olLayer.setZIndex(-1);
}
return true;
};
return RealEarthAnimateTile;
}(RealEarthAnimate_1.default));
nm.RealEarthAnimateTile = RealEarthAnimateTile;
exports.default = RealEarthAnimateTile;
//# sourceMappingURL=RealEarthAnimateTile.js.map