metadataview中恢复fitBounds

This commit is contained in:
Li Jianxuan 2013-05-28 07:08:32 +00:00
parent cd4d644c1b
commit 65c07e543e
1 changed files with 6 additions and 3 deletions

View File

@ -260,7 +260,6 @@ function initialize() {
function setRectangle(east,west,south,north){ function setRectangle(east,west,south,north){
if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){ if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){
RemoveRectangle();
bounds = new google.maps.LatLngBounds( bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(south,west), new google.maps.LatLng(south,west),
@ -273,8 +272,8 @@ function setRectangle(east,west,south,north){
}); });
rectangle.setMap(map); rectangle.setMap(map);
}else{ }else{
RemoveRectangle();
var position = new google.maps.LatLng(south,east); var position = new google.maps.LatLng(south,east);
@ -285,5 +284,9 @@ function setRectangle(east,west,south,north){
markers.push(marker); 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);
} }