Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ol_graph_Vector.prototype.getConnections = function(node, inout, filter) {
var p = node.getCoordinates ? node.getCoordinates() : node;
var features = this.edges.getFeaturesInExtent([p[0]-1, p[1]-1, p[0]+1, p[1]+1]);
var con = inout ? {'in':[],'out':[]} : [];
// Verify connection
for (var i=0, c; c=features[i]; i++) if (!filter || filter(c)) {
if (ol_coordinate_equal(p, c.getGeometry().getFirstCoordinate())) {
if (inout) con.out.push(c);
else con.push(c);
} else if (ol_coordinate_equal(p, c.getGeometry().getLastCoordinate())) {
if (inout) con.in.push(c);
else con.push(c);
}
}
return con;
};
ol_graph_Vector.prototype.getConnections = function(node, inout, filter) {
var p = node.getCoordinates ? node.getCoordinates() : node;
var features = this.edges.getFeaturesInExtent([p[0]-1, p[1]-1, p[0]+1, p[1]+1]);
var con = inout ? {'in':[],'out':[]} : [];
// Verify connection
for (var i=0, c; c=features[i]; i++) if (!filter || filter(c)) {
if (ol_coordinate_equal(p, c.getGeometry().getFirstCoordinate())) {
if (inout) con.out.push(c);
else con.push(c);
} else if (ol_coordinate_equal(p, c.getGeometry().getLastCoordinate())) {
if (inout) con.in.push(c);
else con.push(c);
}
}
return con;
};