image layer renderers use source projection if given and equivalent

This commit is contained in:
Thomas Hirsch
2014-11-28 22:09:45 +01:00
parent 9e591d21d0
commit c42ec27a4a
3 changed files with 21 additions and 3 deletions

View File

@@ -104,8 +104,14 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame =
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
!ol.extent.isEmpty(renderedExtent)) {
var projection = viewState.projection;
var sourceProjection = imageSource.getProjection()
if (goog.isDefAndNotNull(sourceProjection)) {
goog.asserts.assert(ol.proj.equivalent(projection, sourceProjection));
projection = sourceProjection;
}
var image_ = imageSource.getImage(renderedExtent, viewResolution,
frameState.pixelRatio, viewState.projection);
frameState.pixelRatio, projection);
if (!goog.isNull(image_)) {
var imageState = image_.getState();
if (imageState == ol.ImageState.IDLE) {