mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Let geohash handle null island
and add test
This commit is contained in:
@@ -69,6 +69,7 @@ module.exports = function(RED) {
|
||||
var len = parseInt(value.precision || 9);
|
||||
if (len < 1) { len = 1; }
|
||||
if (len > 9) { len = 9; }
|
||||
value.precision = len;
|
||||
if (typeof lat === 'number' && typeof lon === 'number') {
|
||||
value.geohash = geohash.encode(lat, lon, len);
|
||||
RED.util.setMessageProperty(msg,node.property,value);
|
||||
|
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name" : "node-red-node-geohash",
|
||||
"version" : "0.1.9",
|
||||
"version" : "0.1.10",
|
||||
"description" : "A Node-RED node to encode and decode lat,lon pairs to a geohash.",
|
||||
"dependencies" : {
|
||||
"ngeohash" : "0.6.0"
|
||||
"ngeohash" : "^0.6.3"
|
||||
},
|
||||
"repository" : {
|
||||
"type":"git",
|
||||
|
Reference in New Issue
Block a user