Fix for #198, from Sean Gillies. Thanks, Sean!

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1392 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-08-29 11:19:00 +00:00
parent a2ded73387
commit d1ac37984e

View File

@@ -70,8 +70,22 @@ OpenLayers.Layer.GeoRSS.prototype =
continue;
}
location = new OpenLayers.LonLat(parseFloat(location[1]), parseFloat(location[0]));
var title = OpenLayers.Util.getNodes(itemlist[i], "title")[0].firstChild.nodeValue;
var description = OpenLayers.Util.getNodes(itemlist[i], "description")[0].firstChild.nodeValue;
/* Provide defaults for title and description */
var title = "No title";
try {
title = OpenLayers.Util.getNodes(itemlist[i],
"title")[0].firstChild.nodeValue;
}
catch (e) { alert(e); }
var description = "No description";
try {
description = OpenLayers.Util.getNodes(itemlist[i],
"description")[0].firstChild.nodeValue;
}
catch (e) { alert(e); }
try { var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue; } catch (e) { }
data.icon = OpenLayers.Marker.defaultIcon();
data.popupSize = new OpenLayers.Size(250, 100);