When I draw a polygon in an OpenLayers map, I want to know if the marker is inside the polygon or not. I searched in the OpenLayers API, but didn\'t find a solution.
You have a method 'intersectsCoordinate' for the ol.geom.Geometry.
So the code for that will look like:
var polygonGeometry = e.feature.getGeometry(); var coords = iconFeature.getGeometry().getCoordinates(); polygonGeometry.intersectsCoordinate(coords)