From a601ccc0c9a89a0a9f8d1e4f3f668ff374b8f23e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 24 Oct 2016 18:40:52 -0400 Subject: [PATCH] Use osm-auth 1.0.1, make authenticated OSM API calls (re: #2262) --- modules/services/osm.js | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/services/osm.js b/modules/services/osm.js index da309c461..b888f42d4 100644 --- a/modules/services/osm.js +++ b/modules/services/osm.js @@ -464,20 +464,20 @@ export default { dispatch.call('loading'); } - function bboxPath(tile) { - return '/api/0.6/map?bbox=' + tile.extent.toParam(); - } + inflight[id] = that.loadFromAPI( + '/api/0.6/map?bbox=' + tile.extent.toParam(), + function(err, parsed) { + loadedTiles[id] = true; + delete inflight[id]; - inflight[id] = that.loadFromAPI(bboxPath(tile), function(err, parsed) { - loadedTiles[id] = true; - delete inflight[id]; + if (callback) { + callback(err, _.extend({ data: parsed }, tile)); + } - if (callback) callback(err, _.extend({ data: parsed }, tile)); - - if (_.isEmpty(inflight)) { - dispatch.call('loaded'); - } - }); + if (_.isEmpty(inflight)) { + dispatch.call('loaded'); + } + }); }); }, diff --git a/package.json b/package.json index 26e429294..285651f18 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "diacritics": "1.2.3", "lodash": "4.16.4", "marked": "0.3.6", - "osm-auth": "1.0.0", + "osm-auth": "1.0.1", "rbush": "2.0.1", "sexagesimal": "0.5.0", "togeojson": "0.16.0",