Skip to content

Commit

Permalink
converted tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Mareschal committed Mar 6, 2017
1 parent 10c4632 commit 00492b6
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions geofence.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ module.exports = function(RED) {
longitude: msg.payload.lon
};
}
if (node.name) {//add shape to list of areas of interest if it has a name
var flowContext = this.context().flow;
var shapes = flowContext.get('shapes') || {};
if(! shapes[node.name]) {
if (node.mode === 'circle') {
shapes[node.name] = {
mode: node.mode,
centre: node.centre,
radius: node.radius
};
} else {
shapes[node.name] = {
mode: node.mode,
points: node.points
};
}
flowContext.set('shapes', shapes);
}
}
if (node.name) {//add shape to list of areas of interest if it has a name
var flowContext = this.context().flow;
var shapes = flowContext.get('shapes') || {};
if(! shapes[node.name]) {
if (node.mode === 'circle') {
shapes[node.name] = {
mode: node.mode,
centre: node.centre,
radius: node.radius
};
} else {
shapes[node.name] = {
mode: node.mode,
points: node.points
};
}
flowContext.set('shapes', shapes);
}
}

if (loc) {
var inout = false;
Expand Down Expand Up @@ -126,21 +126,21 @@ module.exports = function(RED) {
d[node.name] = distance;
msg.location.distances.push(d);

var shapes = msg.shapes || {};
if(! shapes[node.name]) {
if (node.mode === 'circle') {
shapes[node.name] = {
mode: node.mode,
centre: node.centre,
radius: node.radius
};
} else {
shapes[node.name] = {
mode: node.mode,
points: node.points
};
}
}
var shapes = msg.shapes || {};
if(! shapes[node.name]) {
if (node.mode === 'circle') {
shapes[node.name] = {
mode: node.mode,
centre: node.centre,
radius: node.radius
};
} else {
shapes[node.name] = {
mode: node.mode,
points: node.points
};
}
}

}
node.send(msg);
Expand Down

0 comments on commit 00492b6

Please sign in to comment.