diff --git a/src/ol/source/tilearcgisrestsource.js b/src/ol/source/tilearcgisrestsource.js index 56f0b2cfd5..a0c387ad8a 100644 --- a/src/ol/source/tilearcgisrestsource.js +++ b/src/ol/source/tilearcgisrestsource.js @@ -109,6 +109,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = params['BBOX'] = tileExtent.join(','); params['BBOXSR'] = srid; params['IMAGESR'] = srid; + params['DPI'] = 90 * pixelRatio; var url; if (urls.length == 1) { @@ -137,6 +138,23 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = }; +/** + * @param {number} z Z. + * @param {number} pixelRatio Pixel ratio. + * @param {ol.proj.Projection} projection Projection. + * @return {number} Size. + */ +ol.source.TileArcGISRest.prototype.getTilePixelSize = + function(z, pixelRatio, projection) { + var tileSize = goog.base(this, 'getTilePixelSize', z, pixelRatio, projection); + if (pixelRatio == 1) { + return tileSize; + } else { + return (tileSize * pixelRatio + 0.5) | 0; + } +}; + + /** * Return the URLs used for this ArcGIS source. * @return {!Array.} URLs.