added 'drawn' property to all tiles. removed redraw() and adapted all draw()s to auto handle redraw. remove getPosition() accessor that noone was using. set generic Tile's moveTo() to auto trigger the clear() and the redraw() (if desired). Update Image and WFS tile classes correspondingly. also update tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1198 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+17
-17
@@ -32,6 +32,9 @@ OpenLayers.Tile.prototype = {
|
||||
* @type OpenLayers.Pixel */
|
||||
position:null,
|
||||
|
||||
/** @type Boolean */
|
||||
drawn: false,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -66,38 +69,35 @@ OpenLayers.Tile.prototype = {
|
||||
/**
|
||||
*/
|
||||
draw:function() {
|
||||
this.drawn = true;
|
||||
},
|
||||
|
||||
redraw: function () {
|
||||
this.draw();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds}
|
||||
* @param {OpenLayers.pixel} position
|
||||
* @param {Boolean} redraw Redraw tile after moving?
|
||||
* Default is true
|
||||
*/
|
||||
moveTo: function (bounds, position) {
|
||||
moveTo: function (bounds, position, redraw) {
|
||||
if (redraw == null) {
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
this.clear();
|
||||
this.bounds = bounds.clone();
|
||||
this.position = position.clone();
|
||||
this.redraw();
|
||||
if (redraw) {
|
||||
this.draw();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** Clear the tile of any bounds/position-related data so that it can
|
||||
* be reused in a new location.
|
||||
*/
|
||||
clear: function() {
|
||||
this.bounds = null;
|
||||
this.position = null;
|
||||
this.drawn = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getPosition: function() {
|
||||
return this.position;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Tile"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user