Hi to everyone: i'm gonna build a map for my graduation thesis.
I have a lot of markers on the map, and i wanna build a menu (on the
left of the map), to skim the markers.
now i take the data from an xml with this function:
downloadUrl("php_to_xml.php", function(data)
{
var xml = parseXml(data);
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++)
{
var code = markers[i].getAttribute("code");
var address = markers[i].getAttribute("address");
var place = markers[i].getAttribute("city");
var nation = markers[i].getAttribute("nation");
var point = new google.maps.LatLng
(
parseFloat(markers[i].getAttribute("Lat")),
parseFloat(markers[i].getAttribute("Lng"))
);
var type = markers[i].getAttribute("type");
var app = markers[i].getAttribute("app");
var sub_app = markers[i].getAttribute("sub_app");
var baloon = <html>code<html/>
var marker = new google.maps.Marker(
{
map: map,
position : point
});
switch (type)
{
case '0':
marker.icon =
"http://www.google.com/mapfiles/marker_white.png";
break;
case '1':
marker.icon
="http://www.google.com/mapfiles/marker_yellow.png";
break;
case '2':
marker.icon
="http://www.google.com/mapfiles/marker.png";
break;
case '-1' :
marker.icon =
"http://www.google.com/mapfiles/marker_green.png";
break;
}
bindInfoWindow(marker, map, infoWindow, baloon);
}
});
is it possible to create a menu that takes the list of the "code" from
the xml?
thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.