Changeset 6561
- Timestamp:
- 03/19/08 21:25:42 (10 months ago)
- Files:
-
- sandbox/achipa/openlayers/examples/time-select-control.html (modified) (2 diffs)
- sandbox/achipa/openlayers/lib/OpenLayers.js (modified) (1 diff)
- sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeDisplay.js (moved) (moved from sandbox/achipa/openlayers/lib/OpenLayers/Control/TimePosition.js) (3 diffs)
- sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSlider.js (moved) (moved from sandbox/achipa/openlayers/lib/OpenLayers/Control/PanTime.js) (8 diffs)
- sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSliderBar.js (moved) (moved from sandbox/achipa/openlayers/lib/OpenLayers/Control/PanTimeBar.js) (19 diffs)
- sandbox/achipa/openlayers/lib/OpenLayers/Layer.js (modified) (1 diff)
- sandbox/achipa/openlayers/lib/OpenLayers/Layer/TimedPointTrack.js (modified) (1 diff)
- sandbox/achipa/openlayers/tests/Control/test_TimeSlider.html (moved) (moved from sandbox/achipa/openlayers/tests/Control/test_PanZoom.html)
- sandbox/achipa/openlayers/tests/Control/test_TimeSliderBar.html (moved) (moved from sandbox/achipa/openlayers/tests/Control/test_PanZoomBar.html)
- sandbox/achipa/openlayers/tests/list-tests.html (modified) (1 diff)
- sandbox/achipa/openlayers/theme/default/style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/achipa/openlayers/examples/time-select-control.html
r6426 r6561 21 21 map.setCenter(new OpenLayers.LonLat(20.22, 22.05), 9); 22 22 map.addControl(new OpenLayers.Control.LayerSwitcher()); 23 timeBar = new OpenLayers.Control. PanTimeBar( {continuous: true} );23 timeBar = new OpenLayers.Control.TimeSliderBar( {continuous: true} ); 24 24 map.addControl(timeBar); 25 timepos = new OpenLayers.Control.Time Position();25 timepos = new OpenLayers.Control.TimeDisplay(); 26 26 if (Date.$VERSION){ // to use Date formatting functions from javascripttoolbox just uncomment the <script> statement above 27 27 timepos.formatOutput = function (d) { … … 84 84 <body onload="init()"> 85 85 <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> 87 87 <form onsubmit="return false;"> 88 88 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 147 147 "OpenLayers/Control/PanZoom.js", 148 148 "OpenLayers/Control/PanZoomBar.js", 149 "OpenLayers/Control/ PanTime.js",150 "OpenLayers/Control/ PanTimeBar.js",149 "OpenLayers/Control/TimeSlider.js", 150 "OpenLayers/Control/TimeSliderBar.js", 151 151 "OpenLayers/Control/ArgParser.js", 152 152 "OpenLayers/Control/Permalink.js", 153 153 "OpenLayers/Control/Scale.js", 154 "OpenLayers/Control/Time Position.js",154 "OpenLayers/Control/TimeDisplay.js", 155 155 "OpenLayers/Control/LayerSwitcher.js", 156 156 "OpenLayers/Control/DrawFeature.js", sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeDisplay.js
r6426 r6561 9 9 10 10 /** 11 * Class: OpenLayers.Control.Time Position11 * Class: OpenLayers.Control.TimeDisplay 12 12 */ 13 OpenLayers.Control.Time Position= OpenLayers.Class(OpenLayers.Control, {13 OpenLayers.Control.TimeDisplay = OpenLayers.Class(OpenLayers.Control, { 14 14 15 15 /** … … 20 20 21 21 /** 22 * Constructor: OpenLayers.Control.Time Position22 * Constructor: OpenLayers.Control.TimeDisplay 23 23 * 24 24 * Parameters: … … 89 89 }, 90 90 91 CLASS_NAME: "OpenLayers.Control.Time Position"91 CLASS_NAME: "OpenLayers.Control.TimeDisplay" 92 92 }); sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSlider.js
r6310 r6561 9 9 10 10 /** 11 * Class: OpenLayers. PanZoom11 * Class: OpenLayers.TimeSlider 12 12 * 13 13 * Inherits from: 14 14 * - <OpenLayers.Control> 15 15 */ 16 OpenLayers.Control. PanTime= OpenLayers.Class(OpenLayers.Control, {16 OpenLayers.Control.TimeSlider = OpenLayers.Class(OpenLayers.Control, { 17 17 18 18 /** 19 19 * APIProperty: slideFactor 20 * {Integer} Number of pixels by which we'll pan the mapin any direction20 * {Integer} Number of pixels by which we'll slide the selected time in any direction 21 21 * on clicking the arrow buttons. 22 22 */ … … 36 36 37 37 /** 38 * Constructor: OpenLayers.Control. PanZoom38 * Constructor: OpenLayers.Control.TimeSlider 39 39 * 40 40 * Parameters: … … 42 42 */ 43 43 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); 46 46 OpenLayers.Control.prototype.initialize.apply(this, arguments); 47 47 }, … … 68 68 * 69 69 * Returns: 70 * {DOMElement} A reference to the container div for the PanZoomcontrol.70 * {DOMElement} A reference to the container div for the TimeSlider control. 71 71 */ 72 72 draw: function(px) { … … 81 81 var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y); 82 82 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);*/88 83 this._addButton("timein", "time-plus-mini.png", 89 84 centered.add(0, sz.h*3+5), sz); 90 //this._addButton("timeworld", "time-world-mini.png", centered.add(0, sz.h*4+5), sz);91 85 this._addButton("timeout", "time-minus-mini.png", 92 86 centered.add(0, sz.h*5+5), sz); 93 87 return this.div; 94 88 }, 95 96 /**97 * Method: _addButton98 *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 the107 * image of the button, and has all the proper event handlers set.108 */109 89 110 90 /** … … 165 145 }, 166 146 167 CLASS_NAME: "OpenLayers.Control. PanTime"147 CLASS_NAME: "OpenLayers.Control.TimeSlider" 168 148 }); 169 149 … … 172 152 * {Integer} 173 153 */ 174 OpenLayers.Control. PanTime.X = 4;154 OpenLayers.Control.TimeSlider.X = 4; 175 155 176 156 /** … … 178 158 * {Integer} 179 159 */ 180 OpenLayers.Control. PanTime.Y = 80;160 OpenLayers.Control.TimeSlider.Y = 80; sandbox/achipa/openlayers/lib/OpenLayers/Control/TimeSliderBar.js
r6426 r6561 5 5 6 6 /** 7 * @requires OpenLayers/Control/Pan Zoom.js7 * @requires OpenLayers/Control/PanSlider.js 8 8 */ 9 9 10 10 /** 11 * Class: OpenLayers.Control. PanZoomBar11 * Class: OpenLayers.Control.TimeSliderBar 12 12 * 13 13 * Inherits from: 14 * - <OpenLayers.Control. PanZoom>14 * - <OpenLayers.Control.TimeSlider> 15 15 * - <OpenLayers.Control> 16 16 */ 17 OpenLayers.Control. PanTimeBar = OpenLayers.Class(OpenLayers.Control.PanTime, {18 19 /** 20 * APIProperty: zoomStopWidth17 OpenLayers.Control.TimeSliderBar = OpenLayers.Class(OpenLayers.Control.TimeSlider, { 18 19 /** 20 * APIProperty: timeStopWidth 21 21 */ 22 22 timeStopWidth: 18, 23 23 24 24 /** 25 * APIProperty: zoomStopHeight25 * APIProperty: timeStopHeight 26 26 */ 27 27 timeStopHeight: 1, … … 49 49 */ 50 50 divEvents: null, 51 52 /**53 * Property: zoomWorldIcon54 * {Boolean}55 */56 timeWorldIcon: false,57 51 58 52 /** … … 79 73 */ 80 74 initialize: function() { 81 OpenLayers.Control. PanTime.prototype.initialize.apply(this, arguments);75 OpenLayers.Control.TimeSlider.prototype.initialize.apply(this, arguments); 82 76 }, 83 77 … … 101 95 this.map.events.unregister("datechanged", this, this.updateBar); 102 96 103 OpenLayers.Control. PanTime.prototype.destroy.apply(this, arguments);97 OpenLayers.Control.TimeSlider.prototype.destroy.apply(this, arguments); 104 98 }, 105 99 … … 111 105 */ 112 106 setMap: function(map) { 113 OpenLayers.Control. PanTime.prototype.setMap.apply(this, arguments);107 OpenLayers.Control.TimeSlider.prototype.setMap.apply(this, arguments); 114 108 }, 115 109 … … 132 126 */ 133 127 draw: function(px) { 134 //alert(dumpObj(this.time, 'time', '-', 8));135 128 // initialize our internal div 136 129 OpenLayers.Control.prototype.draw.apply(this, arguments); … … 145 138 var wposition = sz.w; 146 139 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);*/161 140 this._addButton("timein", "time-plus-mini.png", centered.add(0, sz.h*3+5), sz); 162 141 centered = this._addTimeBar(centered.add(0, sz.h*4+5)); … … 168 147 var imgLocation = OpenLayers.Util.getImagesLocation() + img; 169 148 var btn = OpenLayers.Util.createAlphaImageDiv( 170 "OpenLayers_Control_ PanTime_" + id,149 "OpenLayers_Control_TimeSlider_" + id, 171 150 xy, sz, imgLocation, "absolute"); 172 151 … … 190 169 191 170 /** 192 * Method: _add ZoomBar171 * Method: _addTimeBar 193 172 * 194 173 * Parameters: 195 * location - {<OpenLayers.Pixel>} where zoombar drawing is to start.174 * location - {<OpenLayers.Pixel>} where timebar drawing is to start. 196 175 */ 197 176 _addTimeBar:function(centered) { … … 199 178 var imgLocation = OpenLayers.Util.getImagesLocation(); 200 179 201 var id = "OpenLayers_Control_ PanTimeBar_Slider" + this.map.id;180 var id = "OpenLayers_Control_TimeSliderBar_Slider" + this.map.id; 202 181 var timesToEnd = this.time.length; 203 182 var slider = OpenLayers.Util.createAlphaImageDiv(id, … … 222 201 223 202 if (OpenLayers.Util.alphaHack()) { 224 var id = "OpenLayers_Control_ PanTimeBar" + this.map.id;203 var id = "OpenLayers_Control_TimeSliderBar" + this.map.id; 225 204 div = OpenLayers.Util.createAlphaImageDiv(id, centered, 226 205 new OpenLayers.Size(sz.w, … … 231 210 } else { 232 211 div = OpenLayers.Util.createDiv( 233 'OpenLayers_Control_ PanTimeBar_Timebar' + this.map.id,212 'OpenLayers_Control_TimeSliderBar_Timebar' + this.map.id, 234 213 centered, 235 214 sz, … … 270 249 /* 271 250 * Method: divClick 272 * Picks up on clicks directly on the zoombar div251 * Picks up on clicks directly on the timebar div 273 252 * and sets the zoom level appropriately. 274 253 */ … … 308 287 * This is what happens when a click has occurred, and the client is 309 288 * 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 new289 * bottom/top of the timebar div, as well as moving the slider to its new 311 290 * visual location 312 291 * … … 336 315 /* 337 316 * Method: timeBarUp 338 * Perform cleanup when a mouseup event is received -- discover new zoom339 * level andswitch to it.317 * Perform cleanup when a mouseup event is received -- discover new time point 318 * switch to it. 340 319 * 341 320 * Parameters: … … 350 329 this.map.events.unregister("mouseup", this, this.passEventToSlider); 351 330 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); 353 332 if (!this.continuous) 354 333 this.now += Math.round(deltaY/this.timeStopHeight); … … 364 343 365 344 /* 366 * Method: move ZoomBar345 * Method: moveTimeBar 367 346 * Change the location of the slider to match the current zoom level. 368 347 */ … … 408 387 else if (this.now >= this.time.length) this.now = this.time.length-1; 409 388 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 }*/414 389 }, 415 390 … … 427 402 }, 428 403 429 CLASS_NAME: "OpenLayers.Control. PanTimeBar"404 CLASS_NAME: "OpenLayers.Control.TimeSliderBar" 430 405 }); sandbox/achipa/openlayers/lib/OpenLayers/Layer.js
r6369 r6561 1083 1083 1084 1084 /** 1085 * Method: get StopTime1085 * Method: getFinishTime 1086 1086 * {Date} Returns the last date/time the layer is available for, null 1087 1087 * if the layer has no temporal conotation 1088 1088 * 1089 1089 */ 1090 get StopTime: function () {1090 getFinishTime: function () { 1091 1091 if (!this.isTemporalLayer()) 1092 1092 return null; sandbox/achipa/openlayers/lib/OpenLayers/Layer/TimedPointTrack.js
r6560 r6561 88 88 updateHighlight: function(){ 89 89 this.renderer.eraseFeatures([this.highlight]); 90 if (!this.permanentHighlight && (this.getStartTime() > OpenLayers.Date.getEndDate(this.currentDateTime) || this.get StopTime() < this.currentDateTime))90 if (!this.permanentHighlight && (this.getStartTime() > OpenLayers.Date.getEndDate(this.currentDateTime) || this.getFinishTime() < this.currentDateTime)) 91 91 return; 92 92 sandbox/achipa/openlayers/tests/list-tests.html
r6365 r6561 91 91 <li>Control/test_PanZoom.html</li> 92 92 <li>Control/test_PanZoomBar.html</li> 93 <li>Control/test_ PanTimeBar.html</li>93 <li>Control/test_TimeSliderBar.html</li> 94 94 <li>Control/test_Permalink.html</li> 95 95 <li>Control/test_Scale.html</li> sandbox/achipa/openlayers/theme/default/style.css
r6369 r6561 42 42 } 43 43 44 div.olControlTime Position{44 div.olControlTimeDisplay { 45 45 bottom: 0em; 46 46 left: 3px;
