Add serverType option to ol.source.ImageWMS constructor

This commit is contained in:
Frederic Junod
2013-12-17 17:51:37 +01:00
parent 8e6b686f3d
commit 3e83809880
6 changed files with 50 additions and 2 deletions

View File

@@ -38,6 +38,12 @@ ol.source.ImageWMS = function(options) {
imageUrlFunction: imageUrlFunction
});
/**
* @private
* @type {ol.source.wms.ServerType|undefined}
*/
this.serverType_ = options.serverType;
/**
* @private
* @type {boolean}
@@ -92,6 +98,11 @@ ol.source.ImageWMS.prototype.getImage =
var height = (extent[3] - extent[1]) / resolution;
var size = [width * pixelRatio, height * pixelRatio];
if (goog.isDef(this.serverType_) && pixelRatio > 1) {
var param = ol.source.wms.getDpiParam(this.serverType_, pixelRatio);
goog.object.extend(this.params_, param);
}
this.image_ = this.createImage(
extent, resolution, pixelRatio, size, projection);
return this.image_;