response.text
You just have to use a createMarker() function.
function createMarker(point,html) {
var marker = new GMarker(point, redIcon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html); });
return marker;
}
var request = GXmlHttp.create();
request.open("GET", "my_file.xml", true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = GXml.parse(request.responseText);
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var point = new
GPoint(parseFloat(markers[i].getAttribute("lng")),
parseFloat(markers[i].getAttribute("lat")));
var html = markers[i].getAttribute("description");
createMarker(point,html);
map.addOverlay(marker);
}
}
}
request.send(null);
======================
I do not understand where the 'response.Text' comes from, and means?
Response looks like an object to me (and may very well be in the api, I
haven't looked hard enough), or perhaps a method ?(response? verb if I
have ever seen one).
I am very sorry, I have a hard time with this. Where does 'Text' come
from? Is this a built in thing, like 'document.write'?
0 Comments:
Yorum Gönder
<< Home