[GIS] How to put image on top of OpenLayers 3 map by pixels

htmljavascriptopenlayers

I need to put image which should be in middle top of openlayers 3 map. So, it should be defined with map canvas and pixels. Is that possible to do? This is my code:

 var arrow = new ol.layer.Image({
        source: new ol.source.ImageStatic({
            imageExtent: bounds,
            url: imageUrl,
            imageSize: size

        })
    });
    map.addLayer(arrow);

Best Answer

I figured it out, solution would be to get bounds coords from pixels:

map.getCoordinateFromPixel([x,y]);