From cd141e5e1194b835015e51991ec90165cfe63057 Mon Sep 17 00:00:00 2001 From: Jean Bertrand Date: Wed, 23 Nov 2016 11:56:06 +0100 Subject: [PATCH] Gibe better syntax to a function --- lib/geometry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/geometry.js b/lib/geometry.js index 958d730..d7b0866 100644 --- a/lib/geometry.js +++ b/lib/geometry.js @@ -78,7 +78,9 @@ var randomPointInPolygon = function(polygon, bbox) { }; var randomPointInBbox = function(bbox) { - return { lat: Math.random() * (bbox._northEast.lat - bbox._southWest.lat) + bbox._southWest.lat, lng: Math.random() * (bbox._northEast.lng - bbox._southWest.lng) + bbox._southWest.lng } + var lat = Math.random() * (bbox._northEast.lat - bbox._southWest.lat) + bbox._southWest.lat; + var lng = Math.random() * (bbox._northEast.lng - bbox._southWest.lng) + bbox._southWest.lng; + return { lat: lat, lng: lng }; }; var insidePolygon = function(point, polygon) {