OpenLayers OpenLayers

Changeset 6827

Show
Ignore:
Timestamp:
04/09/08 05:12:09 (9 months ago)
Author:
ahocevar
Message:

Changed StyleMap constructor so that all render intents will be set if only one Style object or symbolizer hash is passed. This is the first patch attached to #1498, which got slightly more votes thaan the second one. r=crschmidt,tschaub (pullup #1498)

Files:

Legend:

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

    r6396 r6827  
    2323     * Property: extendDefault 
    2424     * {Boolean} if true, every render intent will extend the symbolizers 
    25      * specified for the "default" intent. Otherwise, every rendering intent 
    26      * is treated as a completely independent symbolizer
     25     * specified for the "default" intent at rendering time. Otherwise, every 
     26     * rendering intent will be treated as a completely independent style
    2727     */ 
    2828    extendDefault: true, 
     
    3434     * style   - {Object} Optional. Either a style hash, or a style object, or 
    3535     *           a hash of style objects (style hashes) keyed by rendering 
    36      *           intent 
     36     *           intent. If just one style hash or style object is passed, 
     37     *           this will be used for all known render intents (default, 
     38     *           select, temporary) 
    3739     * options - {Object} optional hash of additional options for this 
    3840     *           instance 
     
    5355            // user passed a style object 
    5456            this.styles["default"] = style; 
     57            this.styles["select"] = style; 
     58            this.styles["temporary"] = style; 
    5559        } else if(typeof style == "object") { 
    5660            for(var key in style) { 
     
    6468                    // user passed a style hash (i.e. symbolizer) 
    6569                    this.styles["default"] = new OpenLayers.Style(style); 
     70                    this.styles["select"] = new OpenLayers.Style(style); 
     71                    this.styles["temporary"] = new OpenLayers.Style(style); 
    6672                    break; 
    6773                }