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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user