Skip to content

Commit

Permalink
removed event throwing leaflet error
Browse files Browse the repository at this point in the history
  • Loading branch information
popenc committed Sep 6, 2024
1 parent 80a1d2b commit cf42919
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions cyan_angular/src/app/marker-map/marker-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,24 @@ export class MarkerMapComponent implements OnInit {
// console.log("mouseup event")
});

this.mapService.getMap().on('zoomend', event => {
// this.mapService.getMap().on('zoomend', event => {

this.zoomLevel = event.target._zoom;
// this.zoomLevel = event.target._zoom;

// let wbCheckbox = document.getElementById('leaflet-wb-layer-control') as HTMLInputElement;
// // let wbCheckbox = document.getElementById('leaflet-wb-layer-control') as HTMLInputElement;

let path = this.ngLocation.path();
// let path = this.ngLocation.path();

// if (this.zoomLevel >= this.wbLayerZoomThreshold && wbCheckbox.checked === true) {
if (this.zoomLevel >= this.wbLayerZoomThreshold && !path.includes("wbstats")) {
// NOTE: does not add duplicates, which is nice
this.mapService.waterbodyDataLayer.addTo(this.mapService.getMap());
}
else {
this.mapService.waterbodyDataLayer.removeFrom(this.mapService.getMap());
}
// // if (this.zoomLevel >= this.wbLayerZoomThreshold && wbCheckbox.checked === true) {
// if (this.zoomLevel >= this.wbLayerZoomThreshold && !path.includes("wbstats")) {
// // NOTE: does not add duplicates, which is nice
// this.mapService.waterbodyDataLayer.addTo(this.mapService.getMap());
// }
// else {
// this.mapService.waterbodyDataLayer.removeFrom(this.mapService.getMap());
// }

});
// });

}

Expand Down Expand Up @@ -326,7 +326,12 @@ export class MarkerMapComponent implements OnInit {
let dataDate = '01/01/2018';
let source = 'OLCI';

console.log("Creating location.");

let location = this.locationService.createLocation(name, lat, lng, cellCon, maxCellCon, cellChange, dataDate, source);

console.log("Location: ", location)

map.setView(e.latlng, 12);
let m = this.mapService.addMarker(location);
m.fireEvent('click');
Expand Down

0 comments on commit cf42919

Please sign in to comment.