@progress/kendo-angular-map
Version:
Kendo UI Map for Angular
92 lines (91 loc) • 4.18 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { CollectionService } from '../common/collection.service';
import { ConfigurationService } from '../common/configuration.service';
import { LayerComponent } from './layer.component';
import * as i0 from "@angular/core";
import * as i1 from "../common/configuration.service";
import * as i2 from "../common/collection.service";
import * as i3 from "@angular/platform-browser";
/**
* Represents the Kendo UI TileLayer component for Angular. Displays raster map tiles from various sources.
*
* @example
* ```typescript
* @Component({
* selector: 'my-app',
* template: `
* <kendo-map>
* <kendo-map-tile-layer
* [urlTemplate]="tileUrlTemplate"
* [subdomains]="['a', 'b', 'c']"
* [tileSize]="256">
* </kendo-map-tile-layer>
* </kendo-map>
* `
* })
* export class AppComponent {
* public tileUrlTemplate = (args: any) => `https://${args.subdomain}.tile.openstreetmap.org/${args.z}/${args.x}/${args.y}.png`;
* }
* ```
*/
export class TileLayerComponent extends LayerComponent {
configurationService;
collectionService;
sanitizer;
/**
* Sets the size of the image tile in pixels.
*
* @default 256
*/
tileSize;
/**
* Sets a list of subdomains to use for loading tiles.
* Alternating between different subdomains allows more requests to execute in parallel.
*/
subdomains;
/**
* Sets a function that returns an image URL for each tile position.
*/
urlTemplate;
constructor(configurationService, collectionService, sanitizer) {
super('tile', configurationService, collectionService, sanitizer);
this.configurationService = configurationService;
this.collectionService = collectionService;
this.sanitizer = sanitizer;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.CollectionService }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TileLayerComponent, isStandalone: true, selector: "kendo-map-tile-layer", inputs: { tileSize: "tileSize", subdomains: "subdomains", urlTemplate: "urlTemplate" }, providers: [
ConfigurationService,
{
provide: LayerComponent,
useExisting: forwardRef(() => TileLayerComponent)
}
], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TileLayerComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
ConfigurationService,
{
provide: LayerComponent,
useExisting: forwardRef(() => TileLayerComponent)
}
],
selector: 'kendo-map-tile-layer',
template: '',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.CollectionService }, { type: i3.DomSanitizer }]; }, propDecorators: { tileSize: [{
type: Input
}], subdomains: [{
type: Input
}], urlTemplate: [{
type: Input
}] } });