From c88bc4346278edc65061529233f3985c78fdaeeb Mon Sep 17 00:00:00 2001 From: Viglino Date: Sun, 11 Aug 2019 17:05:20 +0200 Subject: [PATCH] [ADD] GoeImage layer with getExtent #330 --- src/layer/GeoImage.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/layer/GeoImage.js diff --git a/src/layer/GeoImage.js b/src/layer/GeoImage.js new file mode 100644 index 000000000..84c4d0072 --- /dev/null +++ b/src/layer/GeoImage.js @@ -0,0 +1,30 @@ +/* Copyright (c) 2019 Jean-Marc VIGLINO, + released under the CeCILL-B license (French BSD license) + (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt). +*/ +import ol_layer_Image from 'ol/layer/Image' +import {ol_ext_inherits} from '../util/ext' + +/** + * @classdesc + * Image layer to use with a GeoImage source and return the extent calcaulted with this source. + * @extends {ol.layer.Image} + * @param {Object=} options Layer Image options. + * @api + */ +var ol_layer_GeoImage = function(options) { + ol_layer_Image.call(this, options); +} +ol_ext_inherits (ol_layer_GeoImage, ol_layer_Image); + +/** + * Return the {@link module:ol/extent~Extent extent} of the source associated with the layer. + * @return {ol.Extent} The layer extent. + * @observable + * @api + */ +ol_layer_GeoImage.prototype.getExtent = function() { + return this.getSource().getExtent(); +} + +export default ol_layer_GeoImage;