UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

113 lines (112 loc) 5.69 kB
/* 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 { MapTileSource } from "./MapTileSource"; import { DependencyProperty } from "./DependencyProperty"; import { String_$type, Date_$type, markType } from "./type"; import { Uri } from "./Uri"; import { PropertyMetadata } from "./PropertyMetadata"; import { dateMinValue } from "./date"; import { stringReplace, stringIsNullOrEmpty } from "./string"; /** * @hidden */ export let AzureMapsTileSource = /*@__PURE__*/ (() => { class AzureMapsTileSource extends MapTileSource { constructor() { super(256 << 22, 256 << 22, 256, 256, 0); this.ac = "https://atlas.microsoft.com/map/tile?subscription-key={subscriptionKey}&api-version={apiVersion}&tilesetId={tilesetId}&zoom={zoom}&x={x}&y={y}"; this.ab = null; } get apiKey() { return this.c(AzureMapsTileSource.apiKeyProperty); } set apiKey(a) { this.h(AzureMapsTileSource.apiKeyProperty, a); } get cultureName() { return this.c(AzureMapsTileSource.cultureNameProperty); } set cultureName(a) { this.h(AzureMapsTileSource.cultureNameProperty, a); } get apiVersion() { return this.c(AzureMapsTileSource.apiVersionProperty); } set apiVersion(a) { this.h(AzureMapsTileSource.apiVersionProperty, a); } get tilesetId() { return this.c(AzureMapsTileSource.tilesetIdProperty); } set tilesetId(a) { this.h(AzureMapsTileSource.tilesetIdProperty, a); } get localizedView() { return this.c(AzureMapsTileSource.localizedViewProperty); } set localizedView(a) { this.h(AzureMapsTileSource.localizedViewProperty, a); } get timestamp() { return this.c(AzureMapsTileSource.timestampProperty); } set timestamp(a) { this.h(AzureMapsTileSource.timestampProperty, a); } x(a, b, c, d) { if (!this.z()) { d.clear(); return; } a -= 8; if (a > 0) { let e = this.ac; let f = this.tilesetId == null ? "microsoft.base.road" : this.tilesetId.toString(); e = stringReplace(e, "{subscriptionKey}", this.apiKey); e = stringReplace(e, "{apiVersion}", this.apiVersion); e = stringReplace(e, "{tilesetId}", f); e = stringReplace(e, "{zoom}", a.toString()); e = stringReplace(e, "{x}", b.toString()); e = stringReplace(e, "{y}", c.toString()); if (this.tilesetId != "microsoft.terra.main") { e = e + "&tileSize=256"; } if (!stringIsNullOrEmpty(this.ab)) { e = e + "&language=" + this.ab; } if (+(this.timestamp) != +(dateMinValue())) { e = e + "&timeStamp=" + (this.timestamp.toJSON()); } if (!stringIsNullOrEmpty(this.localizedView)) { e = e + "&view=" + this.localizedView; } d.add(new Uri(0, e)); } } z() { let a = true; return a; } static ai(a, b) { let c = a; if ((b.f == AzureMapsTileSource.tilesetIdProperty) || (b.f == AzureMapsTileSource.apiKeyProperty) || (b.f == AzureMapsTileSource.cultureNameProperty) || (b.f == AzureMapsTileSource.localizedViewProperty) || (b.f == AzureMapsTileSource.timestampProperty) || (b.f == AzureMapsTileSource.apiVersionProperty)) { if (b.f == AzureMapsTileSource.cultureNameProperty) { c.ab = b.newValue; } c.y(0, 0, 0, 0); } } } AzureMapsTileSource.$t = markType(AzureMapsTileSource, 'AzureMapsTileSource', MapTileSource.$); AzureMapsTileSource.apiKeyProperty = DependencyProperty.i("ApiKey", String_$type, AzureMapsTileSource.$, new PropertyMetadata(2, null, AzureMapsTileSource.ai)); AzureMapsTileSource.cultureNameProperty = DependencyProperty.i("CultureName", String_$type, AzureMapsTileSource.$, new PropertyMetadata(2, null, AzureMapsTileSource.ai)); AzureMapsTileSource.apiVersionProperty = DependencyProperty.i("ApiVersion", String_$type, AzureMapsTileSource.$, new PropertyMetadata(2, "2024-04-01", AzureMapsTileSource.ai)); AzureMapsTileSource.tilesetIdProperty = DependencyProperty.i("TilesetId", String_$type, AzureMapsTileSource.$, new PropertyMetadata(2, null, AzureMapsTileSource.ai)); AzureMapsTileSource.localizedViewProperty = DependencyProperty.i("LocalizedView", String_$type, AzureMapsTileSource.$, new PropertyMetadata(2, null, AzureMapsTileSource.ai)); AzureMapsTileSource.timestampProperty = DependencyProperty.i("Timestamp", Date_$type, AzureMapsTileSource.$, new PropertyMetadata(2, dateMinValue(), AzureMapsTileSource.ai)); return AzureMapsTileSource; })();