File

map/attribution/attribution.ts

Metadata

moduleId module.id.toString()
selector attribution-control
styleUrls attribution.css
templateUrl attribution.html

Inputs

Options

Type: any

Constructor

constructor(mapService: MapService, LeafletElement: LeafletElement)

Methods

ngOnInit
ngOnInit()
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");
        }
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""