@progress/kendo-angular-map
Version:
Kendo UI Map for Angular
69 lines (68 loc) • 3.55 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 { Component, ContentChild } from '@angular/core';
import { ConfigurationService } from '../common/configuration.service';
import { SettingsComponent } from '../common/settings.component';
import { LayerComponent } from '../map/layer.component';
import { ShapeTooltipTemplateDirective } from './shape-tooltip-template.directive';
import { TooltipTemplateService } from './tooltip-template.service';
import * as i0 from "@angular/core";
import * as i1 from "../common/configuration.service";
import * as i2 from "./tooltip-template.service";
import * as i3 from "../map/layer.component";
/**
* Represents the Kendo UI ShapeTooltip component for Angular.
*
* Configures the [Shape Layer Tooltip](slug:shape_layers_map#toc-tooltips).
*
* @example
* ```typescript
* @Component({
* selector: 'my-app',
* template: `
* <kendo-map>
* <kendo-map-layer type="shape" [data]="shapeData">
* <kendo-map-shape-layer-tooltip>
* <ng-template kendoMapShapeTooltipTemplate let-dataItem="dataItem">
* <div>{{ dataItem.properties.name }}</div>
* </ng-template>
* </kendo-map-shape-layer-tooltip>
* </kendo-map-layer>
* </kendo-map>
* `
* })
* export class AppComponent {
* public shapeData = [ ... ]; // GeoJSON data for shapes
* }
* ```
*/
export class ShapeTooltipComponent extends SettingsComponent {
configurationService;
templateService;
layer;
shapeTooltipTemplate;
constructor(configurationService, templateService, layer) {
super('tooltip', configurationService);
this.configurationService = configurationService;
this.templateService = templateService;
this.layer = layer;
}
ngAfterContentChecked() {
this.templateService.registerTemplate(this.layer.index, this.shapeTooltipTemplate?.templateRef);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ShapeTooltipComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.TooltipTemplateService }, { token: i3.LayerComponent }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ShapeTooltipComponent, isStandalone: true, selector: "kendo-map-shape-layer-tooltip", queries: [{ propertyName: "shapeTooltipTemplate", first: true, predicate: ShapeTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ShapeTooltipComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-map-shape-layer-tooltip',
template: '',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.TooltipTemplateService }, { type: i3.LayerComponent }]; }, propDecorators: { shapeTooltipTemplate: [{
type: ContentChild,
args: [ShapeTooltipTemplateDirective, { static: false }]
}] } });