image layer renderers use source projection if given and equivalent
This commit is contained in:
@@ -108,8 +108,14 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
|
|||||||
|
|
||||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||||
!ol.extent.isEmpty(renderedExtent)) {
|
!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;
|
||||||
|
}
|
||||||
image = imageSource.getImage(
|
image = imageSource.getImage(
|
||||||
renderedExtent, viewResolution, pixelRatio, viewState.projection);
|
renderedExtent, viewResolution, pixelRatio, projection);
|
||||||
if (!goog.isNull(image)) {
|
if (!goog.isNull(image)) {
|
||||||
var imageState = image.getState();
|
var imageState = image.getState();
|
||||||
if (imageState == ol.ImageState.IDLE) {
|
if (imageState == ol.ImageState.IDLE) {
|
||||||
|
|||||||
@@ -104,8 +104,14 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame =
|
|||||||
|
|
||||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||||
!ol.extent.isEmpty(renderedExtent)) {
|
!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,
|
var image_ = imageSource.getImage(renderedExtent, viewResolution,
|
||||||
frameState.pixelRatio, viewState.projection);
|
frameState.pixelRatio, projection);
|
||||||
if (!goog.isNull(image_)) {
|
if (!goog.isNull(image_)) {
|
||||||
var imageState = image_.getState();
|
var imageState = image_.getState();
|
||||||
if (imageState == ol.ImageState.IDLE) {
|
if (imageState == ol.ImageState.IDLE) {
|
||||||
|
|||||||
@@ -124,8 +124,14 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame =
|
|||||||
}
|
}
|
||||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||||
!ol.extent.isEmpty(renderedExtent)) {
|
!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,
|
var image_ = imageSource.getImage(renderedExtent, viewResolution,
|
||||||
frameState.pixelRatio, viewState.projection);
|
frameState.pixelRatio, projection);
|
||||||
if (!goog.isNull(image_)) {
|
if (!goog.isNull(image_)) {
|
||||||
var imageState = image_.getState();
|
var imageState = image_.getState();
|
||||||
if (imageState == ol.ImageState.IDLE) {
|
if (imageState == ol.ImageState.IDLE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user