@ Dr.Molleリンクを使用して、私はそれを機能させました。誰かがこの機能の後にいる場合に備えて、これは私の新しいコードです
var markerContents={};
var infoWindow = new google.maps.InfoWindow;
downloadUrl("map/map_data_source.php", function(data) {
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var date = markers[i].getAttribute("date");
var artist = markers[i].getAttribute("artist");
var venue = markers[i].getAttribute("venue");
var address = markers[i].getAttribute("address");
var city = markers[i].getAttribute("city");
var idgigs = markers[i].getAttribute("id");
var country = markers[i].getAttribute("country");
var count = markers[i].getAttribute("count");
var swith = markers[i].getAttribute("swith");
var stage = markers[i].getAttribute("stage");
var type = markers[i].getAttribute("type");
var point = new google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var customIcons = {
FFFFFF: {
icon: 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + count + '|' + type + '|000000'
},
upcoming: {
icon: '../map/marker/orange.png'
}
};
var markerId = point.toString();
if(!markerContents[markerId]){
markerContents[markerId] = [];
}
var html =
'<div id="infoWindow" width="600px"><img src="projects/components/' + artist + '">' +
'<br><br>' + date +
'<br><b>' + venue + '</b> / ' + city + '<br>' + swith + stage +
'<br><b><a class="second_sub_menu" href="../projects/bands.php?sub=Setlist&info=' + artist + '&id=' + idgigs + '">SHOW INFORMATION</a></b>';
var icon = customIcons[type] || {};
markerContents[markerId].push(html);
var marker = new google.maps.Marker({
map: map,
position: point,
zIndex: i,
icon: icon.icon
});
bindInfoWindow(marker, map, infoWindow, markerContents[markerId]);
}
});
}
function bindInfoWindow(marker, map, infoWindow, html) {
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(html.join('<hr/>'));
infoWindow.open(map, marker);
if (map.getZoom() < 4) map.setCenter(marker.getPosition());
if (map.getZoom() < 4) map.setZoom(4);
});
google.maps.event.addListener(map, "click", function() {infoWindow.close();});
}
カスタムアイコンが必要で、マーカーの選択グループを常に一番上に配置したいので、アイコンコードも変更する必要がありましたが、機能します。助けてくれた人たちに感謝します