Fix HiDPI support for ArcGIS REST

This commit is contained in:
Andreas Hocevar
2015-03-04 22:11:16 +01:00
parent 3867c0e45a
commit 8f1726ae39

View File

@@ -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.<string>} URLs.