Port ol.source.StaticImage to new extents

This commit is contained in:
Tom Payne
2013-04-16 16:24:27 +02:00
parent 559e85bc76
commit 583564e484

View File

@@ -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;