Scale StaticImage image to imageExtent

The imageSize property was only used to determine the scale. It's usage was
never documented nor tested nor shown in an example, so I removed it because I
considered its presence a bug.
This commit is contained in:
Andreas Hocevar
2015-11-13 12:13:38 +01:00
parent f5a148e6b3
commit 6280b35035
6 changed files with 78 additions and 23 deletions

View File

@@ -82,6 +82,31 @@ describe('ol.rendering.layer.Image', function() {
});
});
});
describe('single image layer - scaled', function() {
var source;
beforeEach(function() {
source = new ol.source.ImageStatic({
url: 'spec/ol/data/tiles/osm/5/5/12.png',
imageExtent: ol.proj.transformExtent(
[-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857')
});
});
afterEach(function() {
disposeMap(map);
});
it('renders correctly', function(done) {
map = createMap('canvas');
waitForImages([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/image-scaled.png',
IMAGE_TOLERANCE, done);
});
});
});
});
goog.require('goog.object');