title: Check coordinates/places inside polygons in openlayers
body: <p>I have some code by which I am checking places or coordinates inside in polygons or not. The problem is it may have 10000 places or more which is getting performance issue and map is getting slow. Please find my code below:</p>
  
  <pre><code>    places.forEach(p =&gt; {
         this.isInsidePolygons(p.latitude, p.longitude)
      })
  
      isInsidePolygons(latitude: number, longitude: number): boolean {
                  let isInsidePolygon = false;
  
                  var coordinate = OlHelper.transformToEPSG3857([Number(longitude), Number(latitude)]);
                  var shapes = this.getShapes();
                  for (let i = 0; i &lt; shapes.length; i++) {
                      let features = shapes[i].getSource().getFeatures();
                      if (!features || features.length == 0) continue;
  
                      for (let j = 0; j &lt; features.length; j++) {
                          var geometry = features[j].getGeometry();
                          isInsidePolygon = geometry.intersectsCoordinate(coordinate);
                          if (isInsidePolygon) break;
                      }
                      if (isInsidePolygon) break;
                  }
  
                  return isInsidePolygon;
              }
  
     getShapes(): ol.layer.Vector[] {
          var shapes = [];
          this.MapControl.getLayers().forEach((layer) =&gt; {
              if (layer instanceof ol.layer.Vector) shapes.push(layer);
          });
          return shapes;
      }
  </code></pre>
  
  <p>Is it possible to check all places are inside polygons in openlayers in a single check instead of looping for each one?</p>