Add serverType option to ol.source.ImageWMS constructor
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user