#616: untiled layers set layer.tileSize on setMap and every moveTo
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2974 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -102,6 +102,10 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
//determine new tile size
|
||||
this.tileSize = map.getSize();
|
||||
this.tileSize.w = this.tileSize.w * this.ratio;
|
||||
this.tileSize.h = this.tileSize.h * this.ratio;
|
||||
OpenLayers.Layer.HTTPRequest.prototype.setMap.apply(this, arguments);
|
||||
},
|
||||
|
||||
@@ -148,9 +152,9 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
center.lat + (tileHeight / 2));
|
||||
|
||||
//determine new tile size
|
||||
var tileSize = this.map.getSize();
|
||||
tileSize.w = tileSize.w * this.ratio;
|
||||
tileSize.h = tileSize.h * this.ratio;
|
||||
this.tileSize = this.map.getSize();
|
||||
this.tileSize.w = this.tileSize.w * this.ratio;
|
||||
this.tileSize.h = this.tileSize.h * this.ratio;
|
||||
|
||||
//formulate request url string
|
||||
var url = this.getURL(tileBounds);
|
||||
@@ -159,7 +163,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
var ul = new OpenLayers.LonLat(tileBounds.left, tileBounds.top);
|
||||
var pos = this.map.getLayerPxFromLonLat(ul);
|
||||
|
||||
if ( this.tile && !this.tile.size.equals(tileSize)) {
|
||||
if ( this.tile && !this.tile.size.equals(this.tileSize)) {
|
||||
this.tile.destroy();
|
||||
this.tile = null;
|
||||
}
|
||||
@@ -168,7 +172,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
this.doneLoading = false;
|
||||
if (!this.tile) {
|
||||
this.tile = new OpenLayers.Tile.Image(this, pos, tileBounds,
|
||||
url, tileSize);
|
||||
url, this.tileSize);
|
||||
this.tile.draw();
|
||||
var onload = function() {
|
||||
this.doneLoading = true;
|
||||
@@ -184,12 +188,9 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
},
|
||||
|
||||
getURL: function(bounds) {
|
||||
var tileSize = this.map.getSize();
|
||||
tileSize.w = tileSize.w * this.ratio;
|
||||
tileSize.h = tileSize.h * this.ratio;
|
||||
return this.getFullRequestString( {'BBOX': bounds.toBBOX(),
|
||||
'WIDTH': tileSize.w,
|
||||
'HEIGHT': tileSize.h} );
|
||||
'WIDTH': this.tileSize.w,
|
||||
'HEIGHT': this.tileSize.h} );
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user