Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
runette committed Jan 28, 2020
1 parent 8a37135 commit 385d8ee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
36 changes: 36 additions & 0 deletions ngx-loading-control.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/// <reference path="../../node_modules/@types/leaflet-loading/index.d.ts" />
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
import {Map, Control, LoadingOptions} from 'leaflet';
import '../../../../node_modules/leaflet-loading/src/Control.Loading.js'

@Component({
selector: 'leaflet-loading-control',
template: '',
})
export class NgxLoadingControlComponent implements OnInit, OnDestroy {

private _map: Map;
public loading: Control.Loading;

constructor() { }

ngOnInit() {
}

ngOnDestroy() {
this._map.removeControl(this.loading);
}

@Input() options: LoadingOptions= {};

@Input() set map(map: Map){
if (map) {
this._map = map;
this.loading = new Control.Loading(this.options);
this.loading.addTo(map);
}
}
get map(): Map {
return this._map
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@runette/ngx-leaflet-loading",
"version": "1.0.1",
"version": "1.0.3",
"author": "Paul Harwood",
"description": "Angular wrapper for the Leaflet.loading control",
"keywords": [
"angular",
"leaflet",
"control",
"loading"
"loading",
"leaflet-loading"
],
"homepage": "https://github.com/runette/ngx-leaflet-loading",
"bugs": "https://github.com/runette/ngx-leaflet-loading",
Expand Down

0 comments on commit 385d8ee

Please sign in to comment.