修改data/view中单个点显示为一个小黑块的bug
This commit is contained in:
parent
36f914df7e
commit
492e5a25e0
|
@ -259,6 +259,9 @@ 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) ){
|
||||||
|
RemoveRectangle();
|
||||||
|
|
||||||
bounds = new google.maps.LatLngBounds(
|
bounds = new google.maps.LatLngBounds(
|
||||||
new google.maps.LatLng(south,west),
|
new google.maps.LatLng(south,west),
|
||||||
new google.maps.LatLng(north,east)
|
new google.maps.LatLng(north,east)
|
||||||
|
@ -270,9 +273,17 @@ function setRectangle(east,west,south,north){
|
||||||
});
|
});
|
||||||
|
|
||||||
rectangle.setMap(map);
|
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