使用Javascript在Google Map中围绕标记绘制圆圈

时间:2013-10-16 09:41:10

标签: javascript google-maps google-maps-api-3 google-maps-markers

我有以下javascript使用googlemap在Web应用程序中围绕标记绘制一个圆圈。位置详细信息来自数据库,对于每个位置,我创建一个标记,其周围有一个固定的半径圆圈。出于某种原因,圆圈没有出现。有什么建议可以解决吗?

       var marker, i, center;
        for (i = 0; i < locations.length; i++) {
            center = new google.maps.LatLng(locations[i][1], locations[i][2]);
            marker = new google.maps.Marker({
                position: center,
                map: map

            });

            var circle = new google.maps.Circle({
                center: center,
                map:map,
                radus:160930,
                strokeColor: "red",
                strokeOpacity:0.8,
                strokeWeight: 2,
                fillColor: "red"
            });
            circle.bindTo('center',marker,'position');
            google.maps.event.addListener(marker, 'click', (function(marker, i) {
                return function() {
                    infowindow.setContent(locations[i][0]);
                    infowindow.open(map, marker);
                };
            })(marker, i));


        }

1 个答案:

答案 0 :(得分:7)

我认为你写过“radus”。我认为它应该是“圆圈”功能中的“半径”。

相关问题