0
클릭 할 때 infowindow와 반경이있는 원을 표시하는 배열 배열을 표시하려고합니다.이 배열의 크기는 배열의 일부이기도합니다.Google Maps API - 마커 주변을 원으로 전환 하시겠습니까?
나는 마커, infoboxes 및 동그라미를 보여 주지만 동그라미를 토글하는 데 어려움을 겪고 있습니다. 나는 모든 원은 초기 설정 또는 해제 할 것인지
나는 확실히 내 마음을하지 않았, 나는
여기내가 지금까지 가지고 무슨 ... 그게 내가 끝낼 얼마나 많은 달려 같아요 -
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>Google Maps API Tests</title>
<style type="text/css">
html {font-family:Tahoma,verdana,sans-serif; font-size:0.75em;}
p {font-weight:bold;}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
<script type="text/javascript">
//<![CDATA[
function initialize() {
var myLatlng = new google.maps.LatLng(36.637484, -121.51057);
var myOptions = {
zoom: 6,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: true
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
setMarkers(map, sites);
infowindow = new google.maps.InfoWindow({
content: "loading..."
});
}
var sites = [
['Google', 37.422117, -122.083856, 'http://www.google.com/', 402336],
['Yahoo', 34.030194, -118.47479, 'http://www.yahoo.com/', 201168]
];
function setMarkers(map, markers) {
for (var i = 0; i < markers.length; i++) {
var sites = markers[i];
var siteLatLng = new google.maps.LatLng(sites[1], sites[2]);
var marker = new google.maps.Marker({
position: siteLatLng,
map: map,
title: sites[0],
html: '<p>'+sites[0]+'</p><a href="'+sites[3]+'">Web Link</a>'
});
var circle = new google.maps.Circle({
map: map,
radius: sites[4],
fillColor: '#12a3eb',
fillOpacity: 0.15,
strokeColor: '#0177b3'
});
circle.bindTo('center', marker, 'position');
google.maps.event.addListener(marker, "click", function() {
infowindow.setContent(this.html);
infowindow.open(map, this);
});
}
}
//]]>
</script>
</head>
<body style="margin:0px; padding:0px;" onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
어떤 도움을 주시면 감사하겠습니다.
다시 원을 다시 렌더링하는지도에서 원을 제거하는'InfoWindow'가있는 ** X ** 오른쪽 상단 모서리에있는 그 그것의 diplay의 직접 통제를 허용한다. 'Circle'을 켜고 끄는 이벤트 (마커에서 또 다른 '클릭')가 있습니까? –