Commit d38943d5 authored by Alish's avatar Alish
Browse files

feat: auto resize map on Track all merchants admin-app #1040

parent 1692f6be
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@ export class WarehouseTrackComponent implements OnInit {
	}

	populateMarkers(merchantArray, markerStorage) {
		const latlngbounds = new google.maps.LatLngBounds();

		merchantArray.forEach((mer) => {
			const coords = new google.maps.LatLng(
				mer.geoLocation.loc.coordinates[1],
@@ -141,7 +143,10 @@ export class WarehouseTrackComponent implements OnInit {
			const storeIcon = environment.MAP_MERCHANT_ICON_LINK;
			const marker = this.addMarker(coords, this.map, storeIcon);
			markerStorage.push({ marker, id: mer.id });
			latlngbounds.extend(coords);
		});

		this.map.fitBounds(latlngbounds);
	}

	updateMarkers(merchantArray: Warehouse[]) {