function showPointMarker (point, index, address, changeCenter, changeZoomLevel) {
if (changeCenter)
{
if (changeZoomLevel) {
// marker.setMap(map);
map = new google.maps.Map(
document.getElementById('map'), {
center: point,
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
} else {
map = new google.maps.Map(
document.getElementById('map'), {
center: point,
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var letter = String.fromCharCode("A".charCodeAt(0) + index);
//var letteredIcon = new GIcon(baseIcon);
//letteredIcon.image = "";
var pinImage = new google.maps.MarkerImage("http://www.google.com/mapfiles/marker" + letter + ".png" ,
new google.maps.Size(21, 34),
new google.maps.Point(0,0),
new google.maps.Point(10, 34));
var siteLatLng = new google.maps.LatLng(point.hb,point.ib);
var marker = new google.maps.Marker({
position: siteLatLng,
map: map,
icon:pinImage,
html: address
});
marker.setMap(map);
google.maps.event.addListener(marker, "click", function () {
// alert(this.html);
infowindow.setContent(this.html);
infowindow.open(map, this);
});
} //else ends here
} // if change center ends here
} //function ends here
I m trying to add markers to the map, i can't preserve my previous markers,im only seeing the last, please help me out here.. Appreciate your help. I am missing something here, can any one point my mistake.