Add hidpi option to ol.source.ImageWMS and ol.source.MapGuide

This commit is contained in:
Frederic Junod
2013-12-17 09:43:21 +01:00
parent c84782bfc6
commit 8e6b686f3d
3 changed files with 19 additions and 2 deletions

View File

@@ -38,6 +38,12 @@ ol.source.ImageWMS = function(options) {
imageUrlFunction: imageUrlFunction
});
/**
* @private
* @type {boolean}
*/
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true;
/**
* @private
* @type {ol.Image}
@@ -48,8 +54,7 @@ ol.source.ImageWMS = function(options) {
* @private
* @type {number}
*/
this.ratio_ = goog.isDef(options.ratio) ?
options.ratio : 1.5;
this.ratio_ = goog.isDef(options.ratio) ? options.ratio : 1.5;
};
goog.inherits(ol.source.ImageWMS, ol.source.Image);
@@ -71,6 +76,7 @@ ol.source.ImageWMS.prototype.getParams = function() {
ol.source.ImageWMS.prototype.getImage =
function(extent, resolution, pixelRatio, projection) {
resolution = this.findNearestResolution(resolution);
pixelRatio = this.hidpi_ ? pixelRatio : 1;
var image = this.image_;
if (!goog.isNull(image) &&