File

map/watermark/watermark.ts

Metadata

moduleId module.id
selector watermark-element
styleUrls watermark.css
templateUrl watermark.html

Inputs

watermarkUrl

Type: string

Constructor

constructor()

Methods

ngOnInit
ngOnInit()
Returns: void
import { Component, Input } from '@angular/core';
import * as L from 'leaflet';

@Component({
    moduleId: module.id,
    selector: 'watermark-element',
    templateUrl: 'watermark.html',
    styleUrls: ['watermark.css']
})

export class WatermarkComponent {
    @Input() watermarkUrl: string;

    constructor() { }

    ngOnInit() {
        var self = this;
        if (this.watermarkUrl) {
            L.Control['Watermark'] = <any>{};

            L.Control['Watermark'] = L.Control.extend({
                onAdd: function (map) {
                    var img: any = L.DomUtil.create('img');

                    img.src = self.watermarkUrl;
                    img.style.width = '200px';

                    return img;
                },

                onRemove: function (map) {
                }
            });

            L.control['watermark'] = function (opts) {
                return new L.Control['Watermark'](opts);
            }
        }
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""