ajax feed api on georss from google maps

28 views
Skip to first unread message

Tim__m

unread,
Nov 3, 2010, 4:48:33 PM11/3/10
to Google AJAX APIs
I'm trying to get a georss feed from google maps with the ajax feed
api. The problem is the georss:point element is missing from the
results of the ajax call. This is what I'm doing...

<script type="text/javascript">
google.load("feeds", "1");

// Our callback function, for when a feed is loaded.
function feedLoaded(result) {
var georssNS = "http://www.georss.org/georss";
var gmlNS = "http://www.opengis.net/gml";
var items =
result.xmlDocument.getElementsByTagName("item");

for (var i = 0; i < items.length; i++) {
// get <georss:point>
var georss =
google.feeds.getElementsByTagNameNS(items[i], georssNS, "point")[0];
if (georss) {
console.log(georss)
}
// get <gml:LineString>
var lineString =
google.feeds.getElementsByTagNameNS(items[i], gmlNS, "LineString")[0];
if (lineString) {
console.log(lineString);
}
}

}

function OnLoad() {
// Create a feed instance that will grab Digg's feed.
var feed = new google.feeds.Feed("http://maps.google.com/
maps/ms?
ie=UTF8&hl=en&msa=0&output=georss&msid=100987914570652894877.00049428eb8029c8e410c");
feed.setResultFormat(google.feeds.Feed.XML_FORMAT);

// Calling load sends the request off. It requires a
callback function.
feed.load(feedLoaded);
}

google.setOnLoadCallback(OnLoad);
</script>
Reply all
Reply to author
Forward
0 new messages