Add pixelRatio to ol.source.Image#getImage
This commit is contained in:
@@ -78,8 +78,8 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
|
||||
var hints = frameState.viewHints;
|
||||
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING]) {
|
||||
image = imageSource.getImage(
|
||||
frameState.extent, viewResolution, view2DState.projection);
|
||||
image = imageSource.getImage(frameState.extent, viewResolution,
|
||||
frameState.devicePixelRatio, view2DState.projection);
|
||||
if (!goog.isNull(image)) {
|
||||
var imageState = image.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -66,8 +66,8 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame =
|
||||
var hints = frameState.viewHints;
|
||||
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING]) {
|
||||
var image_ = imageSource.getImage(
|
||||
frameState.extent, viewResolution, view2DState.projection);
|
||||
var image_ = imageSource.getImage(frameState.extent, viewResolution,
|
||||
frameState.devicePixelRatio, view2DState.projection);
|
||||
if (!goog.isNull(image_)) {
|
||||
var imageState = image_.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -95,8 +95,8 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame =
|
||||
var hints = frameState.viewHints;
|
||||
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING]) {
|
||||
var image_ = imageSource.getImage(
|
||||
frameState.extent, viewResolution, view2DState.projection);
|
||||
var image_ = imageSource.getImage(frameState.extent, viewResolution,
|
||||
frameState.devicePixelRatio, view2DState.projection);
|
||||
if (!goog.isNull(image_)) {
|
||||
var imageState = image_.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -113,6 +113,7 @@ ol.source.Image.prototype.findNearestResolution =
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {ol.Image} Single image.
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ goog.inherits(ol.source.ImageStatic, ol.source.Image);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.ImageStatic.prototype.getImage =
|
||||
function(extent, resolution, projection) {
|
||||
function(extent, resolution, pixelRatio, projection) {
|
||||
if (ol.extent.intersects(extent, this.image_.getExtent())) {
|
||||
return this.image_;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ ol.source.ImageWMS.prototype.getParams = function() {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.ImageWMS.prototype.getImage =
|
||||
function(extent, resolution, projection) {
|
||||
function(extent, resolution, pixelRatio, projection) {
|
||||
resolution = this.findNearestResolution(resolution);
|
||||
|
||||
var image = this.image_;
|
||||
|
||||
@@ -72,7 +72,7 @@ goog.inherits(ol.source.MapGuide, ol.source.Image);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.MapGuide.prototype.getImage =
|
||||
function(extent, resolution, projection) {
|
||||
function(extent, resolution, pixelRatio, projection) {
|
||||
resolution = this.findNearestResolution(resolution);
|
||||
|
||||
var image = this.image_;
|
||||
|
||||
Reference in New Issue
Block a user