gmap3 如何做 - 它显示圆圈的任何事件

gmap3 How to do it - any event it shows circle

作为主题,如何在例如之后进行。单击标记出现以标记参数为中心的圆圈?

如何获取:latLng(这个标记)。

请帮忙

代码:

函数映射() {

var x1 = [37.772323, -122.214897];
var x2 = [37.752323, -122.214897];

$('#mapFull').gmap3({
    map: {
        options: {
            center: [37.772323, -122.214897],
            zoom: 12,
            mapTypeControlOptions: {
                mapTypeIds: ['custom_style', google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID]
            }
        }
    },
    marker: {
        values: [{
                latLng: [x1[0], x1[1]],
                data: 'x1'
            }, {
                latLng: [x2[0], x2[1]],
                data: 'x2'
            }
        ],
        events: {
            click: function (marker, event, context) {
                var map = $(this).gmap3("get"),
                        infowindow = $(this).gmap3({get: {name: "infowindow"}});
                if (infowindow) {
                    infowindow.open(map, marker);
                    infowindow.setContent(context.data);
                } else {
                    $(this).gmap3({
                        infowindow: {
                            anchor: marker,
                            options: {content: context.data},
                            circle: {
                                center: [37.772323, -122.214897],
                                radius: 250,
                                fillColor: "#008BB2",
                                strokeColor: "#005BB7"
                            }
                        }
                    });
                }
            }
        }
    }
});

}

您可以使用以下代码添加以单击的标记为中心的圆圈:

$('#mapFull').gmap3({
    map: {
        ...
    },
    marker: {
        values: [...],
        events: {
            click: function (marker, event, context) {
                ...
                $(this).gmap3({
                    circle:{
                        options:{
                            center: [ marker.getPosition().lat(), marker.getPosition().lng()],
                            radius : 250,
                            fillColor : "#008BB2",
                            strokeColor : "#005BB7"
                        }
                    }
                });
            }
        }
    }
});