The problem is with the icon:
If I change this:
var marker = new google.maps.Marker({
position:latlng,
map: map,
icon: image
});
To:
var marker = new google.maps.Marker({
position:latlng,
map: map
});
It shows markers.
UPDATE:
the problem with the content is this line:
content: document.getElementById("infobox","infobox2")
That can only return one element at a time. One option is to change your createMarker function to take the id of the element of the id to use.
function createMarker(latlng, name, elId) {
var image = 'images/mapIcon.png';
var marker = new google.maps.Marker({
position:latlng,
map: map /*,
icon: image */
});
infobox = new InfoBox({
content: document.getElementById(elId),
disableAutoPan: true,
maxWidth: 280,
pixelOffset: new google.maps.Size(60, -150),
zIndex: null,
boxStyle: {
opacity: 0.89,
width: "280px"
},
closeBoxMargin: "20px",
closeBoxURL: "images/cross.png",
infoBoxClearance: new google.maps.Size(1, 1),
enableEventPropagation: false
});
google.maps.event.addListener(marker, 'click', function() {
infobox.open(map, this);
map.panTo(latlng);
infobox.setContent(document.getElementById(elId));
});
gmarkers.push(marker);
side_bar_html += '<a href="javascript:myclick(' + (gmarkers.length-1) + ')">' + name + '<\/a><br>';
}