Fix HiDPI support for ArcGIS REST
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user