dynamically add and remove legend with checkbox-toggle
This commit is contained in:
parent
210061442f
commit
8ef1b34c3b
@ -155,10 +155,14 @@ export class MapService {
|
||||
marker.on('mouseout', e => e.target.closePopup());
|
||||
this.drawLineOnMiniMap(marker, point);
|
||||
this.markerLayer.push(marker);
|
||||
this.miniMap.fitBounds(L.featureGroup([...this.markerLayer, this.dashBoardMarker]).getBounds());
|
||||
this.miniMap.fitBounds(L.featureGroup([this.dashBoardMarker, ...this.markerLayer]).getBounds());
|
||||
}
|
||||
if (this.polylineLayer.length === 0) {
|
||||
this.legend.remove();
|
||||
} else {
|
||||
this.drawLegend();
|
||||
}
|
||||
}
|
||||
|
||||
drawLegend(): void {
|
||||
this.legend.onAdd = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user