Merge pull request #3834 from bartvde/arcgisrest-dpi

ArcGIS tiled example broken in Chrome
This commit is contained in:
Bart van den Eijnden
2015-06-22 12:43:35 +02:00
2 changed files with 9 additions and 1 deletions

View File

@@ -111,7 +111,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ =
params['BBOX'] = tileExtent.join(',');
params['BBOXSR'] = srid;
params['IMAGESR'] = srid;
params['DPI'] = 90 * pixelRatio;
params['DPI'] = Math.round(90 * pixelRatio);
var url;
if (urls.length == 1) {

View File

@@ -33,6 +33,14 @@ describe('ol.source.TileArcGISRest', function() {
});
it('returns a non floating point DPI value', function() {
var source = new ol.source.TileArcGISRest(options);
var tile = source.getTile(3, 2, -7, 1.12, ol.proj.get('EPSG:3857'));
var uri = new goog.Uri(tile.src_);
var queryData = uri.getQueryData();
expect(queryData.get('DPI')).to.be('101');
});
it('returns a tile with the expected URL with url list', function() {
options.urls = ['http://test1.com/MapServer',