OpenLayers OpenLayers

Changeset 7015

Show
Ignore:
Timestamp:
04/27/08 00:14:50 (4 months ago)
Author:
crschmidt
Message:

Layer.GeoRSS should store the title and description attributes on the
created OpenLayers.Feature object for later access by applications.
Patch, including tests, written by Ian Mayo, r=me. (Closes #1485)

Files:

Legend:

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

    r6833 r7015  
    191191             
    192192            if (title || description) { 
     193                // we have supplemental data, store them. 
     194                data.title = title; 
     195                data.description = description; 
     196             
    193197                var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';  
    194198                contentHTML += '<div class="olLayerGeoRSSTitle">'; 
  • trunk/openlayers/tests/Layer/GeoRSS.html

    r6725 r7015  
    1717 
    1818    function test_Layer_GeoRSS_constructor (t) { 
    19         t.plan( 5 ); 
     19        t.plan( 7 ); 
    2020        layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt ); 
    2121        t.ok( layer instanceof OpenLayers.Layer.GeoRSS, "new OpenLayers.Layer.GeoRSS returns object" ); 
     
    2626            t.eq( layer.markers.length, 40, "marker length is correct" ); 
    2727            var ll = new OpenLayers.LonLat(-71.142197, 42.405696); 
     28            var theTitle = "Knitting Room"; 
     29            var theDescription = 'This little shop is jammed full. Yarn, yarn everywhere. They make the most of every possible nook and cranny. I like this place also because they have a lot of different kinds of knitting needles in all different sizes. Also, the people who work here are younger and hipper than in the other stores I go to. I reccomend buying supplies here and then knitting your way through a good documentary at the Capitol Theater across the street.<br/>Address: 2 lake St, Arlington, MA <br/>Tags: knitting, yarn, pins and needles, handspun, hand dyed, novelty yarn, fancy, simple, young, hip, friendly, needles, addy, cute hats<br /><br /><a href="http://platial.com/place/90306">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/90306">Grab this on Platial</a> '; 
    2830            t.ok( layer.markers[0].lonlat.equals(ll), "lonlat on first marker is correct" ); 
    2931            t.eq( layer.name, "Crschmidt's Places At Platial", "Layer name is correct." ); 
     32            t.eq( layer.features[0].data.title, theTitle); 
     33            t.eq( layer.features[0].data.description, theDescription); 
    3034        } ); 
    3135    }