Met de @Dr.Molle-link heb ik het werkend gekregen, voor het geval iemand op zoek is naar deze functie, dit is mijn nieuwe code
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();});
}
Omdat ik aangepaste pictogrammen wilde en ik wilde dat een selecte groep markeringen altijd bovenaan stond, moest ik ook de pictogrammencode wijzigen, maar het werkt. Dus bedankt aan degenen die hebben geholpen