I have to change vector feature when vectors are intersect each other, I wrote the following code:
// check all vectors features (arrows) in the current layer for intersections
allArrowFeatures = pointsLayer.features;
var hideArr = new Array();
var l = 0;
for(var i = 0 ;i < allArrowFeatures.length;i++){
arrowObj = allArrowFeatures[i];
for(var j = 1 ;j < allArrowFeatures.length;j++){
if(j===i){ // same vector
continue;
}
if(allArrowFeatures[j].geometry.bounds.intersectsBounds(arrowObj.geometry.bounds)){
hideArr[l] = pointsLayer.features[i].style = {display:'none'};
l++;
}
}
}
When you zooming in to the max zoom you wont see any intersections so I assume this code is OK but the problem is when I zooming out the vectors still intersects each other.
Its look like I don't use the correct function for my case, and I tried several ways this was the closest to my case. Any idea what openlayers method I have to use to detect if there was intersection also in zoom out probably not base on the bounds?