OpenLayers OpenLayers

Changeset 6311

Show
Ignore:
Timestamp:
02/15/08 15:34:25 (1 year ago)
Author:
achipa
Message:

highlight style handling cleaned up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer/TimedPointTrack.js

    r6277 r6311  
    4747    /** 
    4848     * APIProperty: 
    49      * defaultStyle - {OpenLayers.Style} optional. The style for the higlight, by 
    50      *             default this is  
    51      * 
    52      *           fillColor: "#223322", 
    53      *           fillOpacity: 0.5, 
    54      *           strokeColor: "#999999", 
    55      *           strokeOpacity: 1, 
    56      *           strokeWidth: 1, 
    57      *           strokeLinecap: "round", 
    58      *           pointRadius: 6, 
    59      *           pointStyle: "square" 
     49     * highlightStyle - {OpenLayers.Style} optional. The style for the higlight, by 
     50     *             default this is that of the layer default PLUS 
     51     * 
     52     *           {pointRadius: 10, pointStyle: "square"} 
    6053     * 
    6154     *    note the extra pointStyle attribute, which define the appearance of the 
    62      *    highlight, available values are 'square' and 'circle' 
    63      * 
    64      */ 
    65     defaultStyle: { 
    66                 fillColor: "#223322", 
    67                 fillOpacity: 0.5, 
    68                 strokeColor: "#999999", 
    69                 strokeOpacity: 1, 
    70                 strokeWidth: 1, 
    71                 strokeLinecap: "round", 
    72                 pointRadius: 6, 
    73                 pointStyle: "square" 
    74             }, 
     55     *    highlight, available values are 'square' and 'circle' for now.  
     56     * 
     57     */ 
     58    highlightStyle: {}, 
     59 
    7560    /** 
    7661     * Constructor: OpenLayers.TimedPointTrack 
     
    8469    initialize: function(name, options) { 
    8570        OpenLayers.Layer.Vector.prototype.initialize.apply(this, arguments); 
     71        OpenLayers.Util.applyDefaults(this.highlightStyle , this.style); 
     72        OpenLayers.Util.extend(this.highlightStyle , {pointRadius: 10, pointStyle: "square"} ); 
    8673        this.highlight = new OpenLayers.Feature.Vector( 
    8774            new OpenLayers.Geometry.Point(0,0), 
    8875            {}, 
    89             new OpenLayers.Style(this.defaultStyle) 
     76            this.highlightStyle 
    9077        ); 
     78        defaultStyle = this.sty 
    9179        this.events.register("datetimechanged", this, this.updateHighlight); 
    9280//        this.map.events.register("zoomend", this, this.updateHighlight);