igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
115 lines (114 loc) • 5.3 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 { String_$type, Boolean_$type, Number_$type, typeGetValue, typeCast, markType } from "./type";
import { Uri } from "./Uri";
import { PropertyMetadata } from "./PropertyMetadata";
import { truncate } from "./number";
import { stringIsNullOrEmpty } from "./string";
import { stringFormat1 } from "./stringExtended";
/**
* @hidden
*/
var ArcGISOnlineTileSource = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ArcGISOnlineTileSource, _super);
function ArcGISOnlineTileSource() {
return _super.call(this, 2097152, 2097152, 256, 256, 0) || this;
}
Object.defineProperty(ArcGISOnlineTileSource.prototype, "mapServerUri", {
get: function () {
return this.c(ArcGISOnlineTileSource.mapServerUriProperty);
},
set: function (a) {
this.h(ArcGISOnlineTileSource.mapServerUriProperty, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(ArcGISOnlineTileSource.prototype, "isMapPublic", {
get: function () {
return this.c(ArcGISOnlineTileSource.isMapPublicProperty);
},
set: function (a) {
this.h(ArcGISOnlineTileSource.isMapPublicProperty, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(ArcGISOnlineTileSource.prototype, "levelOfDetail", {
get: function () {
return typeGetValue(this.c(ArcGISOnlineTileSource.levelOfDetailProperty));
},
set: function (a) {
this.h(ArcGISOnlineTileSource.levelOfDetailProperty, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(ArcGISOnlineTileSource.prototype, "userToken", {
get: function () {
return this.c(ArcGISOnlineTileSource.userTokenProperty);
},
set: function (a) {
this.h(ArcGISOnlineTileSource.userTokenProperty, a);
},
enumerable: false,
configurable: true
});
ArcGISOnlineTileSource.prototype.x = function (a, b, c, d) {
var e = this.mapServerUri + "/tile/{0}/{1}/{2}";
var f = "";
if (stringIsNullOrEmpty(this.mapServerUri) || this.levelOfDetail < 1 || !Uri.isWellFormedUriString(this.mapServerUri, 1)) {
return;
}
if (!this.isMapPublic) {
if (!stringIsNullOrEmpty(this.userToken)) {
e += "?token={3}";
f = this.userToken.trim();
}
else {
return;
}
}
var g = a - 8;
if (g > 0) {
var h = stringFormat1(e, g, c, b, f);
d.add(new Uri(0, h));
}
};
ArcGISOnlineTileSource.ad = function (a, b) {
var c = a;
if (b.f == ArcGISOnlineTileSource.mapServerUriProperty) {
if (c.mapServerUri != typeCast(String_$type, b.newValue)) {
c.mapServerUri = typeCast(String_$type, b.newValue);
}
c.y(0, 0, 0, 0);
}
if (b.f == ArcGISOnlineTileSource.userTokenProperty) {
if (c.userToken != typeCast(String_$type, b.newValue)) {
c.userToken = typeCast(String_$type, b.newValue);
}
c.y(0, 0, 0, 0);
}
if (b.f == ArcGISOnlineTileSource.levelOfDetailProperty) {
c.v = truncate((Math.pow(2, c.levelOfDetail - 1) * 256));
c.u = truncate((Math.pow(2, c.levelOfDetail - 1) * 256));
}
if (b.f == ArcGISOnlineTileSource.isMapPublicProperty) {
c.y(0, 0, 0, 0);
}
};
ArcGISOnlineTileSource.$t = markType(ArcGISOnlineTileSource, 'ArcGISOnlineTileSource', MapTileSource.$);
ArcGISOnlineTileSource.mapServerUriProperty = DependencyProperty.i("MapServerUri", String_$type, ArcGISOnlineTileSource.$, new PropertyMetadata(2, null, ArcGISOnlineTileSource.ad));
ArcGISOnlineTileSource.isMapPublicProperty = DependencyProperty.i("IsMapPublic", Boolean_$type, ArcGISOnlineTileSource.$, new PropertyMetadata(2, true, ArcGISOnlineTileSource.ad));
ArcGISOnlineTileSource.levelOfDetailProperty = DependencyProperty.i("LevelOfDetail", Number_$type, ArcGISOnlineTileSource.$, new PropertyMetadata(2, -1, ArcGISOnlineTileSource.ad));
ArcGISOnlineTileSource.userTokenProperty = DependencyProperty.i("UserToken", String_$type, ArcGISOnlineTileSource.$, new PropertyMetadata(2, null, ArcGISOnlineTileSource.ad));
return ArcGISOnlineTileSource;
}(MapTileSource));
export { ArcGISOnlineTileSource };