You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ol3 port RBush, the traversal takes a callback which allows you to break out of the traversal by returning a truthy value. This can be used in many ways, for example:
// return true if any feature is at the coordinatevarcoordinate=[x,y];varanyFeatureAtCoordinate=rBush.forEachInExtent(extent,function(feature){returnfeature.getGeometry().containsCoordinate(coordinate);});// find first feature onlyvarfirstFeatureFound=rBush.forEachInExtent(extent,function(feature){returnfeature;});
RBush is often used for collisions, so lets make a method that does the same as search but without collecting/returning items, just true/false.
The text was updated successfully, but these errors were encountered: