Skip to content

Commit

Permalink
Merge pull request #21 from swoocn/dev
Browse files Browse the repository at this point in the history
Approved.
  • Loading branch information
swoocn authored Mar 27, 2024
2 parents 10264a8 + b449c4c commit fda282e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
}

handleSearchTypeToggled(): void {
this.mapComponent.resetAndShowAllShops();
this.mapComponent.removeAllMarkersFromMap();
}
}
8 changes: 1 addition & 7 deletions frontend/src/app/home/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ export class MapComponent implements OnInit, OnDestroy {
this.track();
}

resetAndShowAllShops(): void {
this.filteredShops = this.allShops;
this.removeAllMarkersFromMap();
this.addAllCoordinatesToMap();
}

// Filter shops based on search query
filterShops(query: string, searchType: SearchType): void {
this.logger.debug(`Filtering shops based on searchType: ${searchType}..`);
Expand Down Expand Up @@ -304,7 +298,7 @@ export class MapComponent implements OnInit, OnDestroy {
}

// remove all map markers except for user position
private removeAllMarkersFromMap(): void {
removeAllMarkersFromMap(): void {
this.map.eachLayer((layer) => {
if (layer instanceof L.Marker && !(layer.options as CustomMarkerOptions)?.isCurrentUser) {
this.map.removeLayer(layer);
Expand Down

0 comments on commit fda282e

Please sign in to comment.