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

@@ -31,6 +31,12 @@ ol.source.MapGuide = function(options) {
imageUrlFunction: imageUrlFunction
});
/**
* @private
* @type {boolean}
*/
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true;
/**
* @private
* @type {number}
@@ -74,6 +80,7 @@ goog.inherits(ol.source.MapGuide, ol.source.Image);
ol.source.MapGuide.prototype.getImage =
function(extent, resolution, pixelRatio, projection) {
resolution = this.findNearestResolution(resolution);
pixelRatio = this.hidpi_ ? pixelRatio : 1;
var image = this.image_;
if (!goog.isNull(image) &&