Changeset 2256
- Timestamp:
- 02/21/07 17:32:31 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer/GeoRSS.js (modified) (1 diff)
- trunk/openlayers/tests/atom-1.0.xml (added)
- trunk/openlayers/tests/test_Layer_GeoRSS.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/GeoRSS.js
r2029 r2256 131 131 catch (e) { description="No description."; } 132 132 133 try { var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue; } catch (e) { } 133 /* If no link URL is found in the first child node, try the 134 href attribute */ 135 try { 136 var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue; 137 } 138 catch (e) { 139 try { 140 var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].getAttribute("href"); 141 } 142 catch (e) {} 143 } 144 134 145 data.icon = OpenLayers.Marker.defaultIcon(); 135 146 data.popupSize = new OpenLayers.Size(250, 120); trunk/openlayers/tests/test_Layer_GeoRSS.html
r1424 r2256 19 19 } ); 20 20 } 21 22 function test_01_Layer_GeoRSS_AtomParsing (t) { 23 t.plan( 6 ); 24 layer = new OpenLayers.Layer.GeoRSS('Test Layer', "./atom-1.0.xml" ); 25 t.ok( layer instanceof OpenLayers.Layer.GeoRSS, "new OpenLayers.Layer.GeoRSS returns object" ); 26 t.eq( layer.location, "./atom-1.0.xml", "layer.location is correct" ); 27 var markers; 28 t.delay_call( 1, function() { 29 t.eq( layer.markers.length, 2, "marker length is correct" ); 30 var ll = new OpenLayers.LonLat(29.9805, 36.7702); 31 t.ok( layer.markers[0].lonlat.equals(ll), "lonlat on first marker is correct" ); 32 t.like( layer.features[0].data['popupContentHTML'], '<a class="link" href="http://pleiades.stoa.org/places/638896" target="_blank">Unnamed Tumulus</a>', "Link is correct."); 33 t.eq( layer.name, "tumulus", "Layer name is correct." ); 34 } ); 35 } 36 21 37 function test_02_Layer_GeoRSS_draw (t) { 22 38 // t.plan(5);
