diff --git a/index.html b/index.html index 5b7d3250c..f3f3bfc6a 100755 --- a/index.html +++ b/index.html @@ -24,7 +24,6 @@ - @@ -62,7 +61,7 @@ var connection = new iD.Connection("http://www.overpass-api.de/api/xapi?"); // Initialise map - var map = iD.renderer.Map({ + var map = iD.Map({ selector: "#map", connection: connection, width: $(document).width(), diff --git a/js/iD/Connection.js b/js/iD/Connection.js index ab71070e0..e72fb5d68 100755 --- a/js/iD/Connection.js +++ b/js/iD/Connection.js @@ -151,6 +151,9 @@ iD.Connection = function(apiURL) { function parse(callback) { return function(dom) { + if (!dom.childNodes) { + return callback(new Error('Bad request')); + } for (var i = 0; i < dom.childNodes[0].childNodes.length; i++) { var obj = dom.childNodes[0].childNodes[i], attrib; if (obj.nodeName === 'node') { @@ -177,7 +180,7 @@ iD.Connection = function(apiURL) { assign(relation); } } - callback(); + callback(null); }; } diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index fe0728851..063e9ee00 100755 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------- // Connection base class -iD.renderer.Map = function(obj) { +iD.Map = function(obj) { var map = {}, selection = [], width = obj.width || 800, @@ -285,7 +285,7 @@ iD.renderer.Map = function(obj) { function getZoom(zoom) { var s = projection.scale(); - return Math.max(Math.log(s) / Math.log(2) - 8, 0); + return Math.max(Math.log(s) / Math.log(2) - 7, 0); } function setZoom(zoom) { diff --git a/js/iD/renderer/renderer.js b/js/iD/renderer/renderer.js deleted file mode 100644 index 593d9bb7a..000000000 --- a/js/iD/renderer/renderer.js +++ /dev/null @@ -1 +0,0 @@ -iD.renderer = {}; diff --git a/test/index.html b/test/index.html index a2baae66d..3677f52f6 100644 --- a/test/index.html +++ b/test/index.html @@ -12,12 +12,16 @@ + + + + @@ -25,6 +29,7 @@ +