Skip to content

Commit

Permalink
B/fix airport layer bug (#50)
Browse files Browse the repository at this point in the history
* fix a vt layer bug

* 4.0.2

* safer way

* also run lint at CI
  • Loading branch information
haoliangyu authored Feb 12, 2018
1 parent 17cc8d1 commit 1f438a2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_js:
install:
- npm install
script:
- npm run lint
- npm run build
deploy:
provider: pages
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-leaflet-starter",
"version": "4.0.1",
"version": "4.0.2",
"description": "A minimal Angular project with leaflet",
"main": "index.js",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/app/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ export class MapService {

toggleAirPortLayer(on: boolean) {
if (on) {
this.map.removeLayer(this.vtLayer);
delete this.vtLayer;
} else {
this.http.get("assets/airports.min.geojson").subscribe(result => {
this.vtLayer = L.vectorGrid.slicer(result);
this.vtLayer.addTo(this.map);
});
} else if (this.vtLayer) {
this.map.removeLayer(this.vtLayer);
delete this.vtLayer;
}
}

Expand Down

0 comments on commit 1f438a2

Please sign in to comment.