igniteui-react-core
Version:
Ignite UI React Core.
155 lines (154 loc) • 6.49 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { MapTileSource } from "./MapTileSource";
import { DependencyProperty } from "./DependencyProperty";
import { ObservableCollection$1 } from "./ObservableCollection$1";
import { String_$type, typeCast, runOn, delegateRemove, delegateCombine, markType } from "./type";
import { Uri } from "./Uri";
import { StringBuilder } from "./StringBuilder";
import { PropertyMetadata } from "./PropertyMetadata";
import { stringIsNullOrEmpty, stringReplace } from "./string";
/**
* @hidden
*/
var BingMapsTileSource = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(BingMapsTileSource, _super);
function BingMapsTileSource(a) {
var _rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
_rest[_i - 1] = arguments[_i];
}
var _this = this;
a = (a == void 0) ? 0 : a;
switch (a) {
case 0:
{
_this = _super.call(this, 256 << 22, 256 << 22, 256, 256, 0) || this;
_this.ab = null;
}
break;
case 1:
{
var c = _rest[0];
var d = _rest[1];
{
_this = _super.call(this, 256 << 22, 256 << 22, 256, 256, 0) || this;
_this.ab = null;
}
_this.tilePath = c;
_this.subDomains = d;
}
break;
}
return _this;
}
Object.defineProperty(BingMapsTileSource.prototype, "tilePath", {
get: function () {
return this.c(BingMapsTileSource.tilePathProperty);
},
set: function (a) {
this.h(BingMapsTileSource.tilePathProperty, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(BingMapsTileSource.prototype, "subDomains", {
get: function () {
return this.c(BingMapsTileSource.subDomainsProperty);
},
set: function (a) {
this.h(BingMapsTileSource.subDomainsProperty, a);
},
enumerable: false,
configurable: true
});
BingMapsTileSource.prototype.ag = function (a, b) {
this.y(0, 0, 0, 0);
};
Object.defineProperty(BingMapsTileSource.prototype, "cultureName", {
get: function () {
return this.c(BingMapsTileSource.cultureNameProperty);
},
set: function (a) {
this.h(BingMapsTileSource.cultureNameProperty, a);
},
enumerable: false,
configurable: true
});
BingMapsTileSource.prototype.x = function (a, b, c, d) {
if (!this.z()) {
d.clear();
return;
}
if (stringIsNullOrEmpty(this.tilePath)) {
return;
}
a -= 8;
if (a > 0) {
var e = this.ad(a, b, c);
var f = this.tilePath;
f = stringReplace(f, "{culture}", this.ab);
f = stringReplace(f, "{quadkey}", e);
var g = parseInt(e.substr(e.length - 1, 1));
if (this.subDomains == null || g >= this.subDomains.count) {
return;
}
f = stringReplace(f, "{subdomain}", this.subDomains._inner[g]);
f = stringReplace(f, "&token={token}", "");
d.add(new Uri(0, f));
}
};
BingMapsTileSource.prototype.z = function () {
var a = true;
return a;
};
BingMapsTileSource.prototype.ad = function (a, b, c) {
var d = new StringBuilder(0);
var _loop_1 = function (e) {
var f = '0';
var g = 1 << (e - 1);
if ((b & g) != 0) {
((function () { var $value = f; f = String.fromCharCode($value.charCodeAt(0) + 1); return $value; })());
}
if ((c & g) != 0) {
((function () { var $value = f; f = String.fromCharCode($value.charCodeAt(0) + 1); return $value; })());
((function () { var $value = f; f = String.fromCharCode($value.charCodeAt(0) + 1); return $value; })());
}
d.h(f);
};
for (var e = a; e > 0; --e) {
_loop_1(e);
}
return d.toString();
};
BingMapsTileSource.af = function (a, b) {
var c = a;
if ((b.f == BingMapsTileSource.subDomainsProperty) || (b.f == BingMapsTileSource.tilePathProperty) || (b.f == BingMapsTileSource.cultureNameProperty)) {
if (b.f == BingMapsTileSource.subDomainsProperty) {
var d = typeCast(ObservableCollection$1.$.specialize(String_$type), b.oldValue);
var e = typeCast(ObservableCollection$1.$.specialize(String_$type), b.newValue);
if (d != null) {
d.collectionChanged = delegateRemove(d.collectionChanged, runOn(c, c.ag));
}
if (e != null) {
e.collectionChanged = delegateCombine(e.collectionChanged, runOn(c, c.ag));
}
}
if (b.f == BingMapsTileSource.cultureNameProperty) {
c.ab = b.newValue;
}
c.y(0, 0, 0, 0);
}
};
BingMapsTileSource.$t = markType(BingMapsTileSource, 'BingMapsTileSource', MapTileSource.$);
BingMapsTileSource.tilePathProperty = DependencyProperty.i("TilePath", String_$type, BingMapsTileSource.$, new PropertyMetadata(2, null, BingMapsTileSource.af));
BingMapsTileSource.subDomainsProperty = DependencyProperty.i("SubDomains", ObservableCollection$1.$.specialize(String_$type), BingMapsTileSource.$, new PropertyMetadata(2, null, BingMapsTileSource.af));
BingMapsTileSource.cultureNameProperty = DependencyProperty.i("CultureName", String_$type, BingMapsTileSource.$, new PropertyMetadata(2, null, BingMapsTileSource.af));
return BingMapsTileSource;
}(MapTileSource));
export { BingMapsTileSource };