diff options
| author | Adam Soltys <[email protected]> | 2023-12-27 23:22:43 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-27 23:22:43 -0800 |
| commit | aaf8dd49b07066e534408a2d41d84c518a45c2b6 (patch) | |
| tree | c60e8fe2f7d7dd6b47c2cb9465908d5dbf72d61c | |
| parent | 873b0efba9ddc0e19391943138c4d97674a23b4f (diff) | |
| parent | 81a00b58bcf16da2332dc8283656cf96bef56d74 (diff) | |
| download | coinos-server-aaf8dd49b07066e534408a2d41d84c518a45c2b6.tar.gz coinos-server-aaf8dd49b07066e534408a2d41d84c518a45c2b6.zip | |
Merge branch 'master' into prod
| -rw-r--r-- | lib/locations.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/locations.js b/lib/locations.js index 72bc20b5..39212d05 100644 --- a/lib/locations.js +++ b/lib/locations.js @@ -12,11 +12,16 @@ export let getLocations = async () => { locations = locations.filter( (l) => - l["osm_json"].tags && - l["osm_json"].tags["payment:coinos"] === "yes" && - l["osm_json"]["type"] === "node", + l["osm_json"].tags && l["osm_json"].tags["payment:coinos"] === "yes", ); + locations.map((l) => { + let { bounds, lat, lon } = l["osm_json"]; + + l["osm_json"].lat = lat || (bounds.minlat + bounds.maxlat) / 2; + l["osm_json"].lon = lon || (bounds.minlon + bounds.maxlon) / 2; + }); + for await (let l of locations) { let username = l.tags["payment:coinos"]; if (username) { |
