metadataview中恢复fitBounds
This commit is contained in:
parent
cd4d644c1b
commit
65c07e543e
|
@ -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);
|
||||||
|
|
||||||
|
@ -286,4 +285,8 @@ 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);
|
||||||
}
|
}
|
Loading…
Reference in New Issue