Port ol.source.StaticImage to new extents
This commit is contained in:
@@ -2,6 +2,7 @@ goog.provide('ol.source.StaticImage');
|
|||||||
|
|
||||||
goog.require('ol.Image');
|
goog.require('ol.Image');
|
||||||
goog.require('ol.ImageUrlFunctionType');
|
goog.require('ol.ImageUrlFunctionType');
|
||||||
|
goog.require('ol.extent');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.projection');
|
||||||
goog.require('ol.source.ImageSource');
|
goog.require('ol.source.ImageSource');
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ ol.source.StaticImage = function(options) {
|
|||||||
|
|
||||||
var imageExtent = options.imageExtent;
|
var imageExtent = options.imageExtent;
|
||||||
var imageSize = options.imageSize;
|
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);
|
var projection = ol.projection.get(options.projection);
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
@@ -47,7 +48,7 @@ goog.inherits(ol.source.StaticImage, ol.source.ImageSource);
|
|||||||
*/
|
*/
|
||||||
ol.source.StaticImage.prototype.getImage =
|
ol.source.StaticImage.prototype.getImage =
|
||||||
function(extent, resolution, projection) {
|
function(extent, resolution, projection) {
|
||||||
if (extent.intersects(this.image_.getExtent())) {
|
if (ol.extent.intersects(extent, this.image_.getExtent())) {
|
||||||
return this.image_;
|
return this.image_;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user