修改data/view中单个点显示为一个小黑块的bug
This commit is contained in:
parent
36f914df7e
commit
492e5a25e0
|
@ -259,20 +259,31 @@ function initialize() {
|
|||
|
||||
function setRectangle(east,west,south,north){
|
||||
|
||||
bounds = new google.maps.LatLngBounds(
|
||||
new google.maps.LatLng(south,west),
|
||||
new google.maps.LatLng(north,east)
|
||||
);
|
||||
if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){
|
||||
RemoveRectangle();
|
||||
|
||||
rectangle = new google.maps.Rectangle({
|
||||
bounds: bounds,
|
||||
editable: false
|
||||
});
|
||||
bounds = new google.maps.LatLngBounds(
|
||||
new google.maps.LatLng(south,west),
|
||||
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);
|
||||
}
|
Loading…
Reference in New Issue