"use strict";
var MaxSize = (function () {
function MaxSize($timeout, $window) {
this.restrict = 'A';
this.require = 'openlayers';
MaxSize.prototype.link = function (scope, iElement, iAttrs, olCtrl) {
var resize = function () {
iElement.css('height', '0px');
iElement.css('height', iElement.parent()[0].getBoundingClientRect().height + 'px');
olCtrl.getOpenlayersScope().getMap().then(function (map) {
map.updateSize();
});
};
$timeout(resize);
$window.addEventListener('resize', resize);
};
}
MaxSize.Factory = function () {
var directive = function ($timeout, $window) {
return new MaxSize($timeout, $window);
};
directive['$inject'] = ['$timeout', '$window'];
return directive;
};
return MaxSize;
}());
exports.MaxSize = MaxSize;
|