From 65c07e543e9b8234f361450506258e87d546699c Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Tue, 28 May 2013 07:08:32 +0000 Subject: [PATCH] =?UTF-8?q?metadataview=E4=B8=AD=E6=81=A2=E5=A4=8DfitBound?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/js/metadata-view.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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