I would like to have a right-click context menu with the information of the point clicked.
I.e. I right click on map, get a dropdown menu, here if I would pick 'add marker' or similar, I need to have the clicked position.
I think simplest for getting the version right would be, if someone could add a simple drpdown menu on rightclick to this Test Fiddle
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: false
})
}),
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
I've seen this solution, but it didn't work out: https://gis.stackexchange.com/questions/148428/how-can-i-select-a-feature-in-openlayers-3-by-right-click-it