From 583564e48453a054e731e1d1aa0ead63a753c92e Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 16 Apr 2013 16:24:27 +0200 Subject: [PATCH] Port ol.source.StaticImage to new extents --- src/ol/source/staticimagesource.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ol/source/staticimagesource.js b/src/ol/source/staticimagesource.js index 2509d3b526..74dd079a63 100644 --- a/src/ol/source/staticimagesource.js +++ b/src/ol/source/staticimagesource.js @@ -2,6 +2,7 @@ goog.provide('ol.source.StaticImage'); goog.require('ol.Image'); goog.require('ol.ImageUrlFunctionType'); +goog.require('ol.extent'); goog.require('ol.projection'); goog.require('ol.source.ImageSource'); @@ -19,7 +20,7 @@ ol.source.StaticImage = function(options) { var imageExtent = options.imageExtent; var imageSize = options.imageSize; - var imageResolution = imageExtent.getHeight() / imageSize.height; + var imageResolution = (imageExtent[3] - imageExtent[2]) / imageSize.height; var projection = ol.projection.get(options.projection); goog.base(this, { @@ -47,7 +48,7 @@ goog.inherits(ol.source.StaticImage, ol.source.ImageSource); */ ol.source.StaticImage.prototype.getImage = function(extent, resolution, projection) { - if (extent.intersects(this.image_.getExtent())) { + if (ol.extent.intersects(extent, this.image_.getExtent())) { return this.image_; } return null;