Changeset 2200
- Timestamp:
- 02/04/07 11:13:15 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer.js
r2018 r2200 18 18 /** @type DOMElement */ 19 19 div: null, 20 21 /** supported application event types 22 * 23 * @type Array */ 24 EVENT_TYPES: [ 25 "loadstart", "loadend", "loadcancel"], 26 27 /** @type OpenLayers.Events */ 28 events: null, 20 29 21 30 /** This variable is set when the layer is added to the map, via the … … 122 131 this.div.id = this.id; 123 132 } 133 134 this.events = new OpenLayers.Events(this, this.div, this.EVENT_TYPES); 124 135 }, 125 136 … … 136 147 this.div = null; 137 148 this.options = null; 149 this.events = null; 138 150 }, 139 151 trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js
r2074 r2200 31 31 /** @type OpenLayers.Tile.Image */ 32 32 tile: null, 33 33 34 /** did the image finish loading before a new draw was initiated? 35 * @type Boolean */ 36 doneLoading: false, 34 37 35 38 /** … … 109 112 */ 110 113 moveTo:function(bounds, zoomChanged, dragging) { 114 if (!this.doneLoading) { 115 this.events.triggerEvent("loadcancel"); 116 this.doneLoading = true; 117 } 111 118 OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments); 112 119 … … 156 163 } 157 164 165 this.events.triggerEvent("loadstart"); 166 this.doneLoading = false; 158 167 if (!this.tile) { 159 168 this.tile = new OpenLayers.Tile.Image(this, pos, tileBounds, 160 169 url, tileSize); 161 170 this.tile.draw(); 171 var onload = function() { 172 this.doneLoading = true; 173 this.events.triggerEvent("loadend"); 174 } 175 OpenLayers.Event.observe(this.tile.imgDiv, 'load', 176 onload.bindAsEventListener(this)); 162 177 } else { 163 178 this.tile.moveTo(tileBounds, pos);
