bubble up the setPosition into the main Tile class. then let subclasses override it if they need to do special things (as in the case of Image).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@173 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -50,6 +50,15 @@ OpenLayers.Tile.prototype = {
|
||||
remove:function() {
|
||||
},
|
||||
|
||||
/** This should be overridden by subclasses if they have special needs
|
||||
*
|
||||
* @param OpenLayers.Pixel
|
||||
*/
|
||||
setPosition:function(pixel) {
|
||||
this.position = pixel;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
|
||||
@@ -33,10 +33,12 @@ OpenLayers.Tile.Image.prototype =
|
||||
* @param OpenLayers.Pixel
|
||||
*/
|
||||
setPosition:function(pixel) {
|
||||
OpenLayers.Tile.prototype.setPosition.apply(this, arguments);
|
||||
|
||||
//update the image's location
|
||||
if (this.img) {
|
||||
this.img.style.top = pixel.y + "px";
|
||||
this.img.style.left = pixel.x + "px";
|
||||
this.position = pixel;
|
||||
this.img.style.top = this.position.y + "px";
|
||||
this.img.style.left = this.position.x + "px";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user