0

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);
1

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

map.getCoordinateFromPixel([x,y]);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.