1

我想在 Google Maps API v3 中画几个圆圈。我找到了一个似乎可以做我想做的事情的脚本。但到目前为止,它只适用于一个圆圈。这段代码应该如何绘制“birrfeld”和“zuerich”?

<script>
var birrfeld=new google.maps.LatLng(47.443411,8.234478);
var aelggialp=new google.maps.LatLng(46.80121,8.226692);
var zuerich=new google.maps.LatLng(47.463031,8.549252);

function initialize()
{
var mapProp = {
center:aelggialp,
zoom:8,
mapTypeId:google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);

var myCity = new google.maps.Circle({
center:birrfeld,
radius:6000,
strokeColor:"#0000FF",
strokeOpacity:0.8,
strokeWeight:2,
fillColor:"#0000FF",
fillOpacity:0.4
});
var zuerich = new google.maps.Circle({
center:zuerich,
radius:8000,
strokeColor:"#0000FF",
strokeOpacity:0.8,
strokeWeight:2,
fillColor:"#0000FF",
fillOpacity:0.4
});

myCity.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
4

1 回答 1

1

你没有打电话:

zuerich.setMap(map);

示例:http: //jsfiddle.net/jKuck/

于 2013-09-23T19:28:04.623 回答