Add support for Atom 1.0 to Layer.GeoRSS. Patch from Sean Gillies provided

in #506: tests are included to test that the links are properly created
for Atom 1.0 content (with a data sample provided in the patch).
Thanks, Sean!


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2256 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-02-21 22:32:31 +00:00
parent 7d6b3fa0b9
commit 90b4ff2da5
3 changed files with 62 additions and 1 deletions

View File

@@ -130,7 +130,18 @@ OpenLayers.Layer.GeoRSS.prototype =
}
catch (e) { description="No description."; }
try { var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue; } catch (e) { }
/* If no link URL is found in the first child node, try the
href attribute */
try {
var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue;
}
catch (e) {
try {
var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].getAttribute("href");
}
catch (e) {}
}
data.icon = OpenLayers.Marker.defaultIcon();
data.popupSize = new OpenLayers.Size(250, 120);
if ((title != null) && (description != null)) {