@itwin/core-frontend
Version:
iTwin.js frontend components
30 lines • 1.6 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Tiles
*/
import { IModelApp } from "../../../../IModelApp";
import { MapLayerImageryProvider } from "../../../../tile/internal";
export class AzureMapsLayerImageryProvider extends MapLayerImageryProvider {
constructor(settings) { super(settings, true); }
// construct the Url from the desired Tile
async constructUrl(y, x, zoom) {
if (!this._settings.accessKey)
return "";
return `${this._settings.url}&${this._settings.accessKey.key}=${this._settings.accessKey.value}&api-version=2.0&zoom=${zoom}&x=${x}&y=${y}`;
}
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */
addLogoCards(cards) {
if (!cards.dataset.azureMapsLogoCard) {
cards.dataset.azureMapsLogoCard = "true";
cards.appendChild(IModelApp.makeLogoCard({ heading: "Azure Maps", notice: IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.AzureMapsCopyright") }));
}
}
async addAttributions(cards, _vp) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return Promise.resolve(this.addLogoCards(cards));
}
}
//# sourceMappingURL=AzureMapsLayerImageryProvider.js.map