When I draw a polyangular box on an OpenLayers map, I want to know if the marker is inside the polyangular box or not. I searched in the OpenLayers API but couldn't find a solution.

And you can see my full code in this link .
I got the impression that I should change this function:
function addInteraction() { var value = typeSelect.value; if (value !== 'None') { draw = new ol.interaction.Draw({ source: vectorSource, type: (typeSelect.value) }); map.addInteraction(draw); draw.on('drawend',function(e){
How can i do this?
source share