OpenLayers OpenLayers

Changeset 5837

Show
Ignore:
Timestamp:
01/21/08 19:17:29 (1 year ago)
Author:
crschmidt
Message:

Ensure that GeoRSS format does not fail when reprojection null geometries.
patch=Edgemaster, ar=me (Closes #1258)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Format/GeoRSS.js

    r5614 r5837  
    156156        } 
    157157         
    158         if (this.internalProjection && this.externalProjection) { 
     158        if (geometry && this.internalProjection && this.externalProjection) { 
    159159            geometry.transform(this.externalProjection,  
    160160                               this.internalProjection); 
  • trunk/openlayers/tests/Format/test_GeoRSS.html

    r5478 r5837  
    3535        t.eq(data[0].geometry.x, -1, "w3c geo x read correctly");  
    3636        t.eq(data[0].geometry.y, 1, "w3c geo y read correctly");  
     37    } 
     38    function test_Format_GeoRSS_reproject_null(t) {  
     39        t.plan(1); 
     40 
     41        var parser = new OpenLayers.Format.GeoRSS({'internalProjection':new OpenLayers.Projection("EPSG:4326"), 'externalProjection': new OpenLayers.Projection("EPSG:4326")}); 
     42        var data = parser.read('<rss xmlns="http://backend.userland.com/rss2" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"><item></item></rss>'); 
     43        t.eq(data.length, 1, "Parsing items with null geometry and reprojection doesn't fail"); 
    3744    } 
    3845    function test_Format_GeoRSS_roundtrip(t) {