OpenLayers OpenLayers

Changeset 6561

Show
Ignore:
Timestamp:
03/19/08 21:25:42 (10 months ago)
Author:
achipa
Message:

cleanups, renames

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/achipa/openlayers/examples/time-select-control.html

    r6426 r6561  
    2121            map.setCenter(new OpenLayers.LonLat(20.22, 22.05), 9); 
    2222            map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    23             timeBar = new OpenLayers.Control.PanTimeBar( {continuous: true} ); 
     23            timeBar = new OpenLayers.Control.TimeSliderBar( {continuous: true} ); 
    2424            map.addControl(timeBar); 
    25             timepos = new OpenLayers.Control.TimePosition(); 
     25            timepos = new OpenLayers.Control.TimeDisplay(); 
    2626            if (Date.$VERSION){      // to use Date formatting functions from javascripttoolbox just uncomment the <script> statement above 
    2727                timepos.formatOutput = function (d) { 
     
    8484  <body onload="init()"> 
    8585    <h1>Select time in time-aware layers</h1> 
    86     <p style="font-size:.9em;">This demo uses OpenLayers.Control.PanTimeBar with OpenLayers.Layer.GeoRSS and OpenLayers.Layer.TimedPointTrack. The track is created by connecting the points of the GeoRSS feed, and the points can be tracked based on their temporal attribute.</a></p> 
     86    <p style="font-size:.9em;">This demo uses OpenLayers.Control.TimeSliderBar with OpenLayers.Layer.GeoRSS and OpenLayers.Layer.TimedPointTrack. The track is created by connecting the points of the GeoRSS feed, and the points can be tracked based on their temporal attribute.</a></p> 
    8787    <form onsubmit="return false;"> 
    8888   Load GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" /> 
  • sandbox/achipa/openlayers/lib/OpenLayers.js

    r6369 r6561  
    147147            "OpenLayers/Control/PanZoom.js", 
    148148            "OpenLayers/Control/PanZoomBar.js", 
    149             "OpenLayers/Control/PanTime.js", 
    150             "OpenLayers/Control/PanTimeBar.js", 
     149            "OpenLayers/Control/TimeSlider.js", 
     150            "OpenLayers/Control/TimeSliderBar.js", 
    151151            "OpenLayers/Control/ArgParser.js", 
    152152            "OpenLayers/Control/Permalink.js", 
    153153            "OpenLayers/Control/Scale.js", 
    154             "OpenLayers/Control/TimePosition.js", 
     154            "OpenLayers/Control/TimeDisplay.js", 
    155155            "OpenLayers/Control/LayerSwitcher.js", 
    156156            "OpenLayers/Control/DrawFeature.js", 
  • sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeDisplay.js

    r6426 r6561  
    99 
    1010/** 
    11  * Class: OpenLayers.Control.TimePosition 
     11 * Class: OpenLayers.Control.TimeDisplay 
    1212 */ 
    13 OpenLayers.Control.TimePosition = OpenLayers.Class(OpenLayers.Control, { 
     13OpenLayers.Control.TimeDisplay = OpenLayers.Class(OpenLayers.Control, { 
    1414     
    1515    /**  
     
    2020     
    2121    /** 
    22      * Constructor: OpenLayers.Control.TimePosition 
     22     * Constructor: OpenLayers.Control.TimeDisplay 
    2323     *  
    2424     * Parameters: 
     
    8989    },      
    9090 
    91     CLASS_NAME: "OpenLayers.Control.TimePosition
     91    CLASS_NAME: "OpenLayers.Control.TimeDisplay
    9292}); 
  • sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSlider.js

    r6310 r6561  
    99 
    1010/** 
    11  * Class: OpenLayers.PanZoom 
     11 * Class: OpenLayers.TimeSlider 
    1212 * 
    1313 * Inherits from: 
    1414 *  - <OpenLayers.Control> 
    1515 */ 
    16 OpenLayers.Control.PanTime = OpenLayers.Class(OpenLayers.Control, { 
     16OpenLayers.Control.TimeSlider = OpenLayers.Class(OpenLayers.Control, { 
    1717 
    1818    /** 
    1919     * APIProperty: slideFactor 
    20      * {Integer} Number of pixels by which we'll pan the map in any direction 
     20     * {Integer} Number of pixels by which we'll slide the selected time in any direction 
    2121     *     on clicking the arrow buttons. 
    2222     */ 
     
    3636 
    3737    /** 
    38      * Constructor: OpenLayers.Control.PanZoom 
     38     * Constructor: OpenLayers.Control.TimeSlider 
    3939     * 
    4040     * Parameters: 
     
    4242     */ 
    4343    initialize: function(options) { 
    44         this.position = new OpenLayers.Pixel(OpenLayers.Control.PanTime.X, 
    45                                              OpenLayers.Control.PanTime.Y); 
     44        this.position = new OpenLayers.Pixel(OpenLayers.Control.TimeSlider.X, 
     45                                             OpenLayers.Control.TimeSlider.Y); 
    4646        OpenLayers.Control.prototype.initialize.apply(this, arguments); 
    4747    }, 
     
    6868     * 
    6969     * Returns: 
    70      * {DOMElement} A reference to the container div for the PanZoom control. 
     70     * {DOMElement} A reference to the container div for the TimeSlider control. 
    7171     */ 
    7272    draw: function(px) { 
     
    8181        var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y); 
    8282 
    83         /*this._addButton("panup", "north-mini.png", centered, sz); 
    84         px.y = centered.y+sz.h; 
    85         this._addButton("panleft", "west-mini.png", px, sz); 
    86         this._addButton("panright", "east-mini.png", px.add(sz.w, 0), sz); 
    87         this._addButton("pandown", "south-mini.png", centered.add(0, sz.h*2), sz);*/ 
    8883        this._addButton("timein", "time-plus-mini.png", 
    8984                        centered.add(0, sz.h*3+5), sz); 
    90         //this._addButton("timeworld", "time-world-mini.png", centered.add(0, sz.h*4+5), sz); 
    9185        this._addButton("timeout", "time-minus-mini.png", 
    9286                        centered.add(0, sz.h*5+5), sz); 
    9387        return this.div; 
    9488    }, 
    95  
    96     /** 
    97      * Method: _addButton 
    98      * 
    99      * Parameters: 
    100      * id - {String} 
    101      * img - {String} 
    102      * xy - {<OpenLayers.Pixel>} 
    103      * sz - {<OpenLayers.Size>} 
    104      * 
    105      * Returns: 
    106      * {DOMElement} A Div (an alphaImageDiv, to be precise) that contains the 
    107      *     image of the button, and has all the proper event handlers set. 
    108      */ 
    10989 
    11090    /** 
     
    165145    }, 
    166146 
    167     CLASS_NAME: "OpenLayers.Control.PanTime
     147    CLASS_NAME: "OpenLayers.Control.TimeSlider
    168148}); 
    169149 
     
    172152 * {Integer} 
    173153 */ 
    174 OpenLayers.Control.PanTime.X = 4; 
     154OpenLayers.Control.TimeSlider.X = 4; 
    175155 
    176156/** 
     
    178158 * {Integer} 
    179159 */ 
    180 OpenLayers.Control.PanTime.Y = 80; 
     160OpenLayers.Control.TimeSlider.Y = 80; 
  • sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSliderBar.js

    r6426 r6561  
    55 
    66/** 
    7  * @requires OpenLayers/Control/PanZoom.js 
     7 * @requires OpenLayers/Control/PanSlider.js 
    88 */ 
    99 
    1010/** 
    11  * Class: OpenLayers.Control.PanZoomBar 
     11 * Class: OpenLayers.Control.TimeSliderBar 
    1212 * 
    1313 * Inherits from: 
    14  *  - <OpenLayers.Control.PanZoom
     14 *  - <OpenLayers.Control.TimeSlider
    1515 *  - <OpenLayers.Control> 
    1616 */ 
    17 OpenLayers.Control.PanTimeBar = OpenLayers.Class(OpenLayers.Control.PanTime, { 
    18  
    19     /** 
    20      * APIProperty: zoomStopWidth 
     17OpenLayers.Control.TimeSliderBar = OpenLayers.Class(OpenLayers.Control.TimeSlider, { 
     18 
     19    /** 
     20     * APIProperty: timeStopWidth 
    2121     */ 
    2222    timeStopWidth: 18, 
    2323 
    2424    /** 
    25      * APIProperty: zoomStopHeight 
     25     * APIProperty: timeStopHeight 
    2626     */ 
    2727    timeStopHeight: 1, 
     
    4949     */ 
    5050    divEvents: null, 
    51  
    52     /** 
    53      * Property: zoomWorldIcon 
    54      * {Boolean} 
    55      */ 
    56     timeWorldIcon: false, 
    5751 
    5852    /** 
     
    7973     */ 
    8074    initialize: function() { 
    81         OpenLayers.Control.PanTime.prototype.initialize.apply(this, arguments); 
     75        OpenLayers.Control.TimeSlider.prototype.initialize.apply(this, arguments); 
    8276    }, 
    8377 
     
    10195        this.map.events.unregister("datechanged", this, this.updateBar); 
    10296 
    103         OpenLayers.Control.PanTime.prototype.destroy.apply(this, arguments); 
     97        OpenLayers.Control.TimeSlider.prototype.destroy.apply(this, arguments); 
    10498    }, 
    10599 
     
    111105     */ 
    112106    setMap: function(map) { 
    113         OpenLayers.Control.PanTime.prototype.setMap.apply(this, arguments); 
     107        OpenLayers.Control.TimeSlider.prototype.setMap.apply(this, arguments); 
    114108    }, 
    115109 
     
    132126    */ 
    133127    draw: function(px) { 
    134         //alert(dumpObj(this.time, 'time', '-', 8)); 
    135128        // initialize our internal div 
    136129        OpenLayers.Control.prototype.draw.apply(this, arguments); 
     
    145138        var wposition = sz.w; 
    146139 
    147         /*if (this.timeWorldIcon) { 
    148             centered = new OpenLayers.Pixel(px.x+sz.w, px.y); 
    149         } 
    150  
    151         this._addButton("panup", "north-mini.png", centered, sz); 
    152         px.y = centered.y+sz.h; 
    153         this._addButton("panleft", "west-mini.png", px, sz); 
    154         if (this.timeWorldIcon) { 
    155             this._addButton("timeworld", "time-world-mini.png", px.add(sz.w, 0), sz); 
    156  
    157             wposition *= 2; 
    158         } 
    159         this._addButton("panright", "east-mini.png", px.add(wposition, 0), sz); 
    160         this._addButton("pandown", "south-mini.png", centered.add(0, sz.h*2), sz);*/ 
    161140        this._addButton("timein", "time-plus-mini.png", centered.add(0, sz.h*3+5), sz); 
    162141        centered = this._addTimeBar(centered.add(0, sz.h*4+5)); 
     
    168147        var imgLocation = OpenLayers.Util.getImagesLocation() + img; 
    169148        var btn = OpenLayers.Util.createAlphaImageDiv( 
    170                                     "OpenLayers_Control_PanTime_" + id, 
     149                                    "OpenLayers_Control_TimeSlider_" + id, 
    171150                                    xy, sz, imgLocation, "absolute"); 
    172151 
     
    190169 
    191170    /** 
    192     * Method: _addZoomBar 
     171    * Method: _addTimeBar 
    193172    * 
    194173    * Parameters: 
    195     * location - {<OpenLayers.Pixel>} where zoombar drawing is to start. 
     174    * location - {<OpenLayers.Pixel>} where timebar drawing is to start. 
    196175    */ 
    197176    _addTimeBar:function(centered) { 
     
    199178        var imgLocation = OpenLayers.Util.getImagesLocation(); 
    200179 
    201         var id = "OpenLayers_Control_PanTimeBar_Slider" + this.map.id; 
     180        var id = "OpenLayers_Control_TimeSliderBar_Slider" + this.map.id; 
    202181        var timesToEnd = this.time.length; 
    203182        var slider = OpenLayers.Util.createAlphaImageDiv(id, 
     
    222201 
    223202        if (OpenLayers.Util.alphaHack()) { 
    224             var id = "OpenLayers_Control_PanTimeBar" + this.map.id; 
     203            var id = "OpenLayers_Control_TimeSliderBar" + this.map.id; 
    225204            div = OpenLayers.Util.createAlphaImageDiv(id, centered, 
    226205                                      new OpenLayers.Size(sz.w, 
     
    231210        } else { 
    232211            div = OpenLayers.Util.createDiv( 
    233                         'OpenLayers_Control_PanTimeBar_Timebar' + this.map.id, 
     212                        'OpenLayers_Control_TimeSliderBar_Timebar' + this.map.id, 
    234213                        centered, 
    235214                        sz, 
     
    270249    /* 
    271250     * Method: divClick 
    272      * Picks up on clicks directly on the zoombar div 
     251     * Picks up on clicks directly on the timebar div 
    273252     *           and sets the zoom level appropriately. 
    274253     */ 
     
    308287     * This is what happens when a click has occurred, and the client is 
    309288     * dragging.  Here we must ensure that the slider doesn't go beyond the 
    310      * bottom/top of the zoombar div, as well as moving the slider to its new 
     289     * bottom/top of the timebar div, as well as moving the slider to its new 
    311290     * visual location 
    312291     * 
     
    336315    /* 
    337316     * Method: timeBarUp 
    338      * Perform cleanup when a mouseup event is received -- discover new zoom 
    339      * level and switch to it. 
     317     * Perform cleanup when a mouseup event is received -- discover new time point 
     318     * switch to it. 
    340319     * 
    341320     * Parameters: 
     
    350329            this.map.events.unregister("mouseup", this, this.passEventToSlider); 
    351330            this.map.events.unregister("mousemove", this, this.passEventToSlider); 
    352             var deltaY = (this.timeStart.y+OpenLayers.Control.PanTime.Y-10) - (evt.xy.y+OpenLayers.Control.PanTime.Y-10); 
     331            var deltaY = (this.timeStart.y+OpenLayers.Control.TimeSlider.Y-10) - (evt.xy.y+OpenLayers.Control.TimeSlider.Y-10); 
    353332            if (!this.continuous) 
    354333                this.now += Math.round(deltaY/this.timeStopHeight); 
     
    364343 
    365344    /* 
    366     * Method: moveZoomBar 
     345    * Method: moveTimeBar 
    367346    * Change the location of the slider to match the current zoom level. 
    368347    */ 
     
    408387        else if (this.now >= this.time.length) this.now = this.time.length-1; 
    409388        this.map.setTime(this.time[this.now]); 
    410         //alert(DumpObj(this.time[this.now]), 'valami', '-', 8); 
    411         /*for (var i=0; i < this.map.layers.length; i++) { 
    412             if (this.map.layers[i].isTemporalLayer()) this.map.layers[i].setTime(this.time[this.now]); 
    413         }*/ 
    414389    }, 
    415390 
     
    427402    }, 
    428403 
    429     CLASS_NAME: "OpenLayers.Control.PanTimeBar" 
     404    CLASS_NAME: "OpenLayers.Control.TimeSliderBar" 
    430405}); 
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer.js

    r6369 r6561  
    10831083 
    10841084    /** 
    1085      * Method: getStopTime 
     1085     * Method: getFinishTime 
    10861086     * {Date} Returns the last date/time the layer is available for, null 
    10871087     *     if the layer has no temporal conotation 
    10881088     * 
    10891089     */ 
    1090     getStopTime: function () { 
     1090    getFinishTime: function () { 
    10911091    if (!this.isTemporalLayer()) 
    10921092            return null; 
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer/TimedPointTrack.js

    r6560 r6561  
    8888    updateHighlight: function(){ 
    8989        this.renderer.eraseFeatures([this.highlight]); 
    90         if (!this.permanentHighlight && (this.getStartTime() > OpenLayers.Date.getEndDate(this.currentDateTime) || this.getStopTime() < this.currentDateTime)) 
     90        if (!this.permanentHighlight && (this.getStartTime() > OpenLayers.Date.getEndDate(this.currentDateTime) || this.getFinishTime() < this.currentDateTime)) 
    9191            return; 
    9292       
  • sandbox/achipa/openlayers/tests/list-tests.html

    r6365 r6561  
    9191    <li>Control/test_PanZoom.html</li> 
    9292    <li>Control/test_PanZoomBar.html</li> 
    93     <li>Control/test_PanTimeBar.html</li> 
     93    <li>Control/test_TimeSliderBar.html</li> 
    9494    <li>Control/test_Permalink.html</li> 
    9595    <li>Control/test_Scale.html</li> 
  • sandbox/achipa/openlayers/theme/default/style.css

    r6369 r6561  
    4242} 
    4343 
    44 div.olControlTimePosition
     44div.olControlTimeDisplay
    4545    bottom: 0em; 
    4646    left: 3px;