I'm trying to add a georeferenced image layer to my map object. I'm using Node, with the v4.2.0 Openlayers module.
My code to add the georefenced image is as follows. Within the layers array of the map object (there is another OSM WMS background layer):
new ol.layer.Image({
source: new ol.source.ImageStatic({
attributions: '© some note',
url: __dirname + '/image.tiff',
projection: 'EPSG:3857',
imageExtend: [486303.9778100852272473,
800886.4222691040486097,
486822.4427326705190353,
6801434.6447209259495139]
})
})
Using the ol-debug.js library I get the following error:
Uncaught TypeError: Cannot read property '2' of undefined at Object.ol.extent.intersects
> at ol.source.ImageStatic.getImageInternal
> at ol.source.ImageStatic.ol.source.Image.getImage
> at ol.renderer.canvas.ImageLayer.prepareFrame
> at ol.renderer.canvas.Map.renderFrame
> at ol.Map.renderFrame_
> at ol.Map.<anonymous>
.
What could be wrong here? Meanwhile I have used a workaround by creating a tiled XYZ image which works, but I would still like to know what is going wrong here.