Browse Source

helper/has_location: validate coordinates (+-90, +-180)

Nils Schneider 9 years ago
parent
commit
9bdb7c562a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      helper.js

+ 3 - 1
helper.js

@@ -84,7 +84,9 @@ function online(d) {
 }
 
 function has_location(d) {
-  return "location" in d.nodeinfo
+  return "location" in d.nodeinfo &&
+         Math.abs(d.nodeinfo.location.latitude) < 90 &&
+         Math.abs(d.nodeinfo.location.longitude) < 180
 }
 
 function subtract(a, b) {