Permalink
Browse files

Merge pull request #6300 from fredj/hidpi_ImageArcGISRest

Add missing hidpi option for ol.source.ImageArcGISRest
  • Loading branch information...
2 parents dcf8f0e + 3642f02 commit 1692a19c3b64e67891725486fd03f2e0966e700d @fredj fredj committed on GitHub Jan 9, 2017
Showing with 17 additions and 0 deletions.
  1. +10 −0 externs/olx.js
  2. +7 −0 src/ol/source/imagearcgisrest.js
View
@@ -5064,6 +5064,7 @@ olx.source.OSMOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* crossOrigin: (null|string|undefined),
+ * hidpi: (boolean|undefined),
* logo: (string|olx.LogoOptions|undefined),
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
* params: Object.<string,*>,
@@ -5096,6 +5097,15 @@ olx.source.ImageArcGISRestOptions.prototype.crossOrigin;
/**
+ * Use the `ol.Map#pixelRatio` value when requesting the image from the remote
+ * server. Default is `true`.
+ * @type {boolean|undefined}
+ * @api
+ */
+olx.source.ImageArcGISRestOptions.prototype.hidpi;
+
+
+/**
* Logo.
* @type {string|olx.LogoOptions|undefined}
* @api
@@ -46,6 +46,12 @@ ol.source.ImageArcGISRest = function(opt_options) {
/**
* @private
+ * @type {boolean}
+ */
+ this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
+
+ /**
+ * @private
* @type {string|undefined}
*/
this.url_ = options.url;
@@ -114,6 +120,7 @@ ol.source.ImageArcGISRest.prototype.getImageInternal = function(extent, resoluti
}
resolution = this.findNearestResolution(resolution);
+ pixelRatio = this.hidpi_ ? pixelRatio : 1;
var image = this.image_;
if (image &&

0 comments on commit 1692a19

Please sign in to comment.