I was looking at this example of openLayers ( http://openlayers.org/en/v3.14.1/examples/custom-interactions.html?q=custom ) and I was wondering how can I load a small image like the one in the example on mouse down on the map? I tried several things but couldn't figure it out. Any ideas?
Thanks!
The example you link to uses custom interactions to drag existing features around the map - this code is very useful and I used it to work out how to drag markers around my map.
However, there is a simpler way to add the markers in the first place, which is to use the map's singleclick event handler:
I've put a complete example here, showing how I did it:
http://www.freytag.org.uk/pages/2016/03/06/openlayers-addfeature.html
Once you've got that working, you can use the custom interactions in the OL3 example to then drag those markers around the map.