나는 원격으로 좌표를 잡고지도에 놓고 폴리선과 연결하는 클릭 이벤트를 가지고있다. 같은 작업을하는 다른 클릭 이벤트가 있지만 별도의 레이어로 유지하여 사용자가 수행 한 클릭 각각을 전환 할 수 있습니다. 누구든지이 방법이나 다른 방법을 사용하기 위해 개별적으로 그룹화하는 좋은 방법을 알고 있습니까? - 좋은 시작이다Google지도에서 여러 개의 오버레이를 전환하는 방법은 무엇입니까?
drawPoints: function (points, color) {
$.each(points, function (key, val) {
var location = new google.maps.LatLng(val.Latitude, val.Longitude);
MyTest.addMarker(location, val.Name, val.Description);
MyTest.coordinates.push(location);
});
this.path = new google.maps.Polyline({
path: MyATest.coordinates,
strokeColor: color,
strokeOpacity: 1.0,
strokeWeight: 2
});
this.path.setMap(this.googlemap);
},
addMarker: function (location, title, html) {
var marker = new google.maps.Marker({
position: location,
map: this.googlemap,
title: title,
html: html
});
this.markers.push(marker);
},
// Removes the overlays from the map, but keeps them in the array
clearOverlays: function() {
if (this.markers) {
for (i in this.markers) {
this.markers[i].setMap(null);
}
}
},
// Shows any overlays currently in the array
showOverlays: function() {
if (this.markers) {
for (i in this.markers) {
this.markers[i].setMap(map);
}
}
},
안녕하세요 bruv가 시작으로이 피들을 가져 와서 여기에 그것을 복제하십시오 : http://jsfiddle.net/fHsAY/ :)) 좋은 것을 가지고! 치어 리더! –