|
|
@@ -5,6 +5,7 @@ var assignMarkers = [];
|
|
|
var selectedLocation;
|
|
|
var selectedTester;
|
|
|
|
|
|
+var locationLatLngBounds;
|
|
|
var assignLatLngBounds;
|
|
|
|
|
|
var map = null;
|
|
|
@@ -41,6 +42,8 @@ function initialiseLocations() {
|
|
|
|
|
|
$("#tests-tbody").empty();
|
|
|
|
|
|
+ locationLatLngBounds = new google.maps.LatLngBounds;
|
|
|
+
|
|
|
for(let i in response.locations) {
|
|
|
let location = response.locations[i];
|
|
|
|
|
|
@@ -49,8 +52,9 @@ function initialiseLocations() {
|
|
|
lng: location.longitude
|
|
|
};
|
|
|
|
|
|
- let cssClass = location.class;
|
|
|
+ locationLatLngBounds.extend(position);
|
|
|
|
|
|
+ let cssClass = location.class;
|
|
|
|
|
|
let icon = "/img/markers/building-grey.png";
|
|
|
if(cssClass == "danger") icon = "/img/markers/building-red.png";
|
|
|
@@ -107,6 +111,8 @@ function initialiseLocations() {
|
|
|
$("#tests-tbody").append(tr);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ map.fitBounds(locationLatLngBounds);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -161,6 +167,11 @@ function clearTesters() {
|
|
|
|
|
|
function initialiseTesters() {
|
|
|
|
|
|
+ let highlightClass = "table-warning";
|
|
|
+
|
|
|
+ $("#tests-tbody tr").removeClass(highlightClass);
|
|
|
+ $("#tests-tbody tr[data-location-id=" + selectedLocation.id + "]").addClass(highlightClass);
|
|
|
+
|
|
|
map = maps["map"];
|
|
|
|
|
|
$("#tester-list-loading-container").text("Loading available testers...");
|