OpenLayers OpenLayers

Changeset 7023

Show
Ignore:
Timestamp:
04/28/08 15:01:10 (4 months ago)
Author:
ahocevar
Message:

added an additional test to show that the example given by tschaub for #1526 works without modifications (references #1526)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/Style.html

    r6818 r7023  
    128128     
    129129    function test_Style_context(t) { 
    130         t.plan(1); 
     130        t.plan(2); 
    131131        var rule = new OpenLayers.Rule({ 
    132132            symbolizer: {"Point": {externalGraphic: "${img1}"}}, 
     
    146146        var styleHash = style.createSymbolizer(feature); 
    147147        t.eq(styleHash.externalGraphic, "myImage.png", "correctly evaluated rule and calculated property styles from a custom context"); 
    148     } 
    149      
     148         
     149        // same as above, but without rule (#1526) 
     150        style = new OpenLayers.Style( 
     151            {externalGraphic: "${getExternalGraphic}"}, 
     152            {context: { 
     153                getExternalGraphic: function(feature) { 
     154                    return "foo" + feature.attributes.size + ".png"; 
     155                } 
     156            }}); 
     157        t.eq(style.createSymbolizer(feature).externalGraphic, "foo10.png", "correctly evaluated symbolizer without rule"); 
     158    }; 
     159         
    150160    function test_Style_findPropertyStyles(t) { 
    151161        t.plan(4);