我有几个经纬度坐标,它指定一个区域周围的框,例如:
LATITUDE 26.664503840000002 29.145674380000003,LONGITUDE -96.27139215 -90.40762858
我正在查看绘制Rectangle的 Google Maps 叠加层。
如果我想为不同的纬度/经度覆盖多个矩形,我应该创建新的绑定对象并将其分配给覆盖对象吗?
function initialize() {
var
lat = 29.145674380000003, // Should I calcuate the center or
// can I use of the min/max co-ordinates
lng = -90.40762858;
zoom = 4;
// Basic
var MapOptions = {
zoom: zoom,
center: new google.maps.LatLng( lat, lng ),
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.TERRAIN
}
var map = new google.maps.Map(document.getElementById("map_canvas"),MapOptions);
var bounds = new google.maps.LatLngBounds(
new google.maps.LatLng( 26.664503840000002, -96.27139215 ),
new google.maps.LatLng( 29.145674380000003, -90.40762858 )
);
var overlay = new google.maps.Rectangle({
map: map,
bounds: bounds,
strokeColor: "red",
strokeWeight: 1,
});
}