map/attribution/attribution.ts
moduleId | module.id.toString() |
selector | attribution-control |
styleUrls | attribution.css |
templateUrl | attribution.html |
Options
|
Type: |
Defined in map/attribution/attribution.ts:15
|
constructor(mapService: MapService, LeafletElement: LeafletElement)
|
Defined in map/attribution/attribution.ts:15
|
ngOnInit |
ngOnInit()
|
Defined in map/attribution/attribution.ts:20
|
Returns:
void
|
import { Component, Input, Injector, Optional } from '@angular/core';
import { LeafletElement } from '../map';
import { MapService } from '../services/map.service';
import { attributionModel } from '../models/attributionModel';
import * as L from 'leaflet';
@Component({
moduleId: module.id.toString(),
selector: 'attribution-control',
templateUrl: 'attribution.html',
styleUrls: ['attribution.css']
})
export class AttributionControl {
@Input() Options: any = new attributionModel(null);
constructor(
private mapService: MapService,
@Optional() private LeafletElement?: LeafletElement) { }
ngOnInit() {
if (this.LeafletElement) {
let map = this.mapService.getMap();
L.control.attribution(this.Options).addTo(map);
} else {
console.warn("This attribution-control will not be rendered \n the expected parent node of attribution-control should be either leaf-element or layer-element");
}
}
}