OpenLayers OpenLayers

Changeset 5310

Show
Ignore:
Timestamp:
12/01/07 04:53:51 (1 year ago)
Author:
ahocevar
Message:

extended example to also show the usage of rules

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/ahocevar/styles/examples/georss-flickr.html

    r5307 r5310  
    2121            externalGraphic: "${thumbnail}", 
    2222            pointRadius: 20}); 
     23         
     24        // create a rule with a point symbolizer that will make the thumbnail 
     25        // larger if the title of the rss item conatins "powder" 
     26        var rule = new OpenLayers.Rule.Comparison({ 
     27                type: OpenLayers.Rule.Comparison.LIKE, 
     28                property: "title", 
     29                value: "*powder*", 
     30                symbolizer: {"Point": {pointRadius: 30}}}); 
     31        rule.value2regex("*"); 
     32         
     33        style.addRules([rule]); 
    2334 
    2435        function init(){ 
     
    97108  <body onload="init()"> 
    98109    <h1>GeoRSS from Flickr in OpenLayers</h1> 
    99     <p>The displayed GeoRSS feed has a <tt>&lt;media:thumbnail/&gt;</tt> property for each item. An extended <tt>createFeatureFromItem()</tt> function is used to add this attribute to the attributes hash of each feature read in by <tt>OpenLayers.Format.GeoRSS</tt>. The example is configured with a style to render each item with its thumbnail image.</p> 
     110    <p>The displayed GeoRSS feed has a <tt>&lt;media:thumbnail/&gt;</tt> property for each item. An extended <tt>createFeatureFromItem()</tt> function is used to add this attribute to the attributes hash of each feature read in by <tt>OpenLayers.Format.GeoRSS</tt>. The example is configured with a style to render each item with its thumbnail image. Also, to show how rules work, we defined a rule that if the title of an rss item contains "powder", it will be rendered larger than the others.</p> 
    100111    <div id="map"></div> 
    101112  </body>