Hello,
i want to update my markers every minute.
But if i update it the old marker will not removed.
I´ve tested a few opportunities but it doesn´t work...
setInterval("getStandort()", 60000);
function getStandort()
{
GDownloadUrl("standort.php", function(data)
{
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName
("marker");
for (var i = 0; i < markers.length; i++)
{
var name = markers[i].getAttribute("linie");
var richtung = markers[i].getAttribute("richtung");
var type = markers[i].getAttribute("type");
var point = new GLatLng(parseFloat(markers[i].getAttribute
("lat")), parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, name, richtung, type);
??>> map.removeOverlay(marker);
map.addOverlay(marker);
}
});
function createMarker(point, name, richtung, type)
{
var marker = new GMarker(point, customIcons[type]);
marker.tooltip = "<div class='tooltip'> " + name + " <
\/div>";
var html = "<b>" + name + "</b><br>" + richtung;
GEvent.addListener(marker, "click", function()
{
marker.openInfoWindowHtml(html, {maxWidth:"450",
maxHeight:"400", autoScroll:true});
});
GEvent.addListener(marker, "mouseover", function()
{
showTooltip(marker);
});
GEvent.addListener(marker, "mouseout", function()
{
tooltip.style.visibility = "hidden"
});
return marker;
}
}
Thanks a lot...
AK
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.