Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
reverted to @tyypes definition
  • Loading branch information
runette committed Dec 14, 2019
1 parent 0a07a19 commit 752aadc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
25 changes: 23 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
{
"name": "@runette/ngx-leaflet-loading",
"version": "0.0.1",
"version": "1.0.1",
"author": "Paul Harwood",
"description": "Angular wrapper for the Leaflet.loading control",
"keywords": [
"angular",
"leaflet",
"control",
"loading"
],
"homepage": "https://github.com/runette/ngx-leaflet-loading",
"bugs": "https://github.com/runette/ngx-leaflet-loading",
"licence": "MIT",
"peerDependencies": {
"@angular/common": "^8.2.14",
"@angular/core": "^8.2.14"
},
"dependencies": {
"@types/leaflet-loading": "^0.1.0",
"leaflet-loading": "^0.1.24"
}
}
14 changes: 6 additions & 8 deletions src/lib/ngx-loading-control.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/// <reference path="../../../../node_modules/@types/leaflet-loading/index.d.ts" />
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
import {Map, Control} from 'leaflet';
import * as L from 'leaflet';
import '../../../../node_modules/leaflet-loading/src/Control.Loading.js'

declare module 'leaflet' {
namespace Control{
class Loading extends Control {
}
}
}

@Component({
selector: 'leaflet-loading-control',
template: '',
Expand All @@ -28,15 +22,19 @@ export class NgxLoadingControlComponent implements OnInit, OnDestroy {
this._map.removeControl(this.loading);
}

@Input() options: {[name:string]:any} = {};

@Input() set map(map: Map){
if (map) {
this._map = map;
this.loading = new Control.Loading();
this.loading = new Control.Loading(this.options);
this.loading.addTo(map);
}
}
get map(): Map {
return this._map
}



}

0 comments on commit 752aadc

Please sign in to comment.