修改data/view中单个点显示为一个小黑块的bug

This commit is contained in:
Li Jianxuan 2013-05-27 09:03:11 +00:00
parent 36f914df7e
commit 492e5a25e0
1 changed files with 26 additions and 15 deletions

View File

@ -259,20 +259,31 @@ function initialize() {
function setRectangle(east,west,south,north){ function setRectangle(east,west,south,north){
bounds = new google.maps.LatLngBounds( if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){
new google.maps.LatLng(south,west), RemoveRectangle();
new google.maps.LatLng(north,east)
);
rectangle = new google.maps.Rectangle({ bounds = new google.maps.LatLngBounds(
bounds: bounds, new google.maps.LatLng(south,west),
editable: false new google.maps.LatLng(north,east)
}); );
rectangle.setMap(map); rectangle = new google.maps.Rectangle({
bounds: bounds,
editable: false
});
rectangle.setMap(map);
}else{
RemoveRectangle();
var position = new google.maps.LatLng(south,east);
var marker = new google.maps.Marker({
position: position,
map: map,
});
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);
} }