I have a list of functions and a vector layer, and I need to know if each function is within the scope of the map or not.
I use openlayers v3.9.0, and in the corresponding documentation there is a function containsExtent()( link ) that has a boolean value. It seems exactly what I'm looking for. But there is an error saying that containsExtent is not a function.
Uncaught TypeError: extent.containsExtent is not a function
code snippet:
var extent = someVectorSource.getExtent();
_.each(allMyFeatures, function(feature) {
if (extent.containsExtent(feature.getGeometry().getExtent())) {
}
});
What is the problem?
If this is the best way, it will be even better to get only those functions that are within, in a single call without repeating through the list.
schub source
share