My problem is that all of the infowindows made have the same content (the last array object). None of the answers I find seem to work for me.
function addMapMarkers(data) {
removeMarkers();
for(i=0; i<data.length; i++){
var location = {lat: + data[i].koordinatLatLng[0], lng: + data[i].koordinatLatLng[1]};
var marker = new google.maps.Marker({
position: location,
map: map,
clickable: true
});
marker.info = new google.maps.InfoWindow({
content: "Navn: " + data[i].navn
});
google.maps.event.addListener(marker, 'click', function() {
marker.info.open(map, this);
});
map.markers.push(marker);
};
};