From c260e927a0f2f4b7a370275cbb9dad9889584e7b Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 8 Feb 2017 13:32:57 +0100 Subject: [PATCH] Round the DPI value in ol.source.ImageArcGISRest --- src/ol/source/imagearcgisrest.js | 2 +- test/spec/ol/source/imagearcgisrest.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/source/imagearcgisrest.js b/src/ol/source/imagearcgisrest.js index bfa75adfa3..b46ef2381e 100644 --- a/src/ol/source/imagearcgisrest.js +++ b/src/ol/source/imagearcgisrest.js @@ -208,7 +208,7 @@ ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixe params['BBOX'] = extent.join(','); params['BBOXSR'] = srid; params['IMAGESR'] = srid; - params['DPI'] = 90 * pixelRatio; + params['DPI'] = Math.round(90 * pixelRatio); var url = this.url_; diff --git a/test/spec/ol/source/imagearcgisrest.test.js b/test/spec/ol/source/imagearcgisrest.test.js index 450f673e91..f1fe7672c0 100644 --- a/test/spec/ol/source/imagearcgisrest.test.js +++ b/test/spec/ol/source/imagearcgisrest.test.js @@ -38,10 +38,10 @@ describe('ol.source.ImageArcGISRest', function() { it('returns a non floating point DPI value', function() { var source = new ol.source.ImageArcGISRest(options); - var image = source.getImage([3, 2, -7, 1.12], resolution, pixelRatio, proj3857); + var image = source.getImage([3, 2, -7, 1.12], resolution, 1.01, proj3857); var uri = new URL(image.src_); var queryData = uri.searchParams; - expect(queryData.get('DPI')).to.be('90'); + expect(queryData.get('DPI')).to.be('91'); }); it('returns a image with the expected URL for ImageServer', function() {