core/comm.js
function (area, layer) {
	
	// check if layer exists
	if (l_layers.hasOwnProperty(layer) === false)
		return [];
	
	// get all current subscriptions at this layer
	var subs = l_layers[layer];
	
	// prepare list of connection of subscribers matching / covering the area
	var connections = [];
	
	// check each subscription to see if it overlaps with the given area
	for (var id in subs) {
		var subscription = subs[id];
		
		// check for overlaps (distance between the two centers is less than sum of radii)
		if (l_dist(subscription, para) <= (subscription.r + para.r))
			connections.push(subscription.conn);
	}
	
	return connections;
}
function (area, layer) {
	
	// check if layer exists
	if (l_layers.hasOwnProperty(layer) === false)
		return [];
	
	// get all current subscriptions at this layer
	var subs = l_layers[layer];
	
	// prepare list of connection of subscribers matching / covering the area
	var connections = [];
	
	// check each subscription to see if it overlaps with the given area
	for (var id in subs) {
		var subscription = subs[id];
		
		// check for overlaps (distance between the two centers is less than sum of radii)
		if (l_dist(subscription, para) <= (subscription.r + para.r))
			connections.push(subscription.conn);
	}
	
	return connections;
}
function ( area , layer ) { // check if layer exists if ( l_layers . hasOwnProperty ( layer ) === false ) return [ ] ; // get all current subscriptions at this layer var subs = l_layers [ layer ] ; // prepare list of connection of subscribers matching / covering the area var connections = [ ] ; // check each subscription to see if it overlaps with the given area for ( var id in subs ) { var subscription = subs [ id ] ; // check for overlaps (distance between the two centers is less than sum of radii) if ( l_dist ( subscription , para ) <= ( subscription . r + para . r ) ) connections . push ( subscription . conn ) ; } return connections ; }
find a list of subscribers covering a given point or area
find a list of subscribers covering a given point or area