mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 00:10:14 +01:00
29 lines
881 B
TypeScript
29 lines
881 B
TypeScript
import {Component, ViewEncapsulation, ElementRef} from '@angular/core';
|
|
|
|
import './leafletMaps.loader';
|
|
|
|
@Component({
|
|
selector: 'leaflet-maps',
|
|
encapsulation: ViewEncapsulation.None,
|
|
styles: [require('./leafletMaps.scss')],
|
|
template: require('./leafletMaps.html')
|
|
})
|
|
export class LeafletMaps {
|
|
|
|
constructor(private _elementRef:ElementRef) {
|
|
}
|
|
|
|
ngAfterViewInit() {
|
|
let el = this._elementRef.nativeElement.querySelector('.leaflet-maps');
|
|
|
|
L.Icon.Default.imagePath = 'assets/img/theme/vendor/leaflet';
|
|
var map = L.map(el).setView([51.505, -0.09], 13);
|
|
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
|
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
|
}).addTo(map);
|
|
|
|
L.marker([51.5, -0.09]).addTo(map)
|
|
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
|
|
.openPopup();
|
|
}
|
|
}
|