diff --git a/htdocs/js/metadata-view.js b/htdocs/js/metadata-view.js index d61ff2f9..7182f6ee 100644 --- a/htdocs/js/metadata-view.js +++ b/htdocs/js/metadata-view.js @@ -260,7 +260,6 @@ function initialize() { function setRectangle(east,west,south,north){ if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){ - RemoveRectangle(); bounds = new google.maps.LatLngBounds( new google.maps.LatLng(south,west), @@ -273,8 +272,8 @@ function setRectangle(east,west,south,north){ }); rectangle.setMap(map); + }else{ - RemoveRectangle(); var position = new google.maps.LatLng(south,east); @@ -285,5 +284,9 @@ function setRectangle(east,west,south,north){ markers.push(marker); } - + + var bounds = new google.maps.LatLngBounds(); + bounds.extend(new google.maps.LatLng(south,west)); + bounds.extend(new google.maps.LatLng(north,east)); + map.fitBounds(bounds); } \ No newline at end of file