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
我正在尝试在地图上添加标记,我无法保留我以前的标记,我只看到最后一个,请在这里帮助我。感谢您的帮助。我在这里遗漏了一些东西,任何人都可以指出我的错误。