diff --git a/css/app.css b/css/app.css
index 0986381bb..e95f4b203 100644
--- a/css/app.css
+++ b/css/app.css
@@ -251,7 +251,7 @@ button.action .label {
/* Definitions for every icon */
.icon.browse { background-position: 0px 0px;}
.icon.add-place { background-position: -20px 0px;}
-.icon.add-road { background-position: -40px 0px;}
+.icon.add-line { background-position: -40px 0px;}
.icon.add-area { background-position: -60px 0px;}
.icon.undo { background-position: -80px 0px;}
.icon.redo { background-position: -100px 0px;}
@@ -268,7 +268,7 @@ button.action .label {
.active .icon.browse { background-position: 0px -20px;}
.active .icon.add-place { background-position: -20px -20px;}
-.active .icon.add-road { background-position: -40px -20px;}
+.active .icon.add-line { background-position: -40px -20px;}
.active .icon.add-area { background-position: -60px -20px;}
.active .icon.undo { background-position: -80px -20px;}
.active .icon.redo { background-position: -100px -20px;}
@@ -285,7 +285,7 @@ button.action .label {
button[disabled] .icon.browse { background-position: 0px -40px;}
button[disabled] .icon.add-place { background-position: -20px -40px;}
-button[disabled] .icon.add-road { background-position: -40px -40px;}
+button[disabled] .icon.add-line { background-position: -40px -40px;}
button[disabled] .icon.add-area { background-position: -60px -40px;}
button[disabled] .icon.undo { background-position: -80px -40px;}
button[disabled] .icon.redo { background-position: -100px -40px;}
diff --git a/index.html b/index.html
index 94543bf93..3c2924650 100644
--- a/index.html
+++ b/index.html
@@ -63,10 +63,10 @@
-
+
-
+
diff --git a/js/id/id.js b/js/id/id.js
index 4af92b870..42e75e994 100644
--- a/js/id/id.js
+++ b/js/id/id.js
@@ -29,7 +29,7 @@ window.iD = function(container) {
.attr('class', 'buttons-joined');
var buttons = buttons_joined.selectAll('button.add-button')
- .data([iD.modes.Browse(), iD.modes.AddPlace(), iD.modes.AddRoad(), iD.modes.AddArea()])
+ .data([iD.modes.Browse(), iD.modes.AddPlace(), iD.modes.AddLine(), iD.modes.AddArea()])
.enter().append('button')
.attr('class', function (mode) { return mode.title + ' add-button'; })
.attr('data-original-title', function (mode) { return mode.description; })
@@ -131,7 +131,7 @@ window.iD = function(container) {
.on('click', function(d) { return d[2](); })
.append('span')
.attr('class', function(d) {
- return d[0] + ' icon'
+ return d[0] + ' icon';
});
var gc = this.append('div').attr('class', 'geocode-control map-control');
@@ -139,18 +139,11 @@ window.iD = function(container) {
.attr('class','narrow')
.html("")
.on('click', function() {
- d3.select(this)
- .classed('active', function() {
- if ( !gcForm.classed('hide')) {
- return false;
- } else {
- return true;
- }
- });
- gcForm.classed('hide', function() {
- return !gcForm.classed('hide');
- });
- d3.select('.map-overlay input').node().focus();
+ d3.select(this).classed('active', gcForm.classed('hide'));
+ gcForm.classed('hide', !gcForm.classed('hide'));
+
+ if (!gcForm.classed('hide')) d3.select('.map-overlay input').node().focus();
+ else map.surface.node().focus();
});
var gcForm = gc.append('form');
gcForm.attr('class','content map-overlay hide')
@@ -164,6 +157,7 @@ window.iD = function(container) {
d3.event.preventDefault();
d3.json('http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
encodeURIComponent(this.value) + '.json', function(err, resp) {
+ gc.select('button').on('click').apply(gc.select('button').node());
map.center([resp.results[0][0].lon, resp.results[0][0].lat]);
});
});
@@ -206,7 +200,7 @@ window.iD = function(container) {
controller.enter(iD.modes.AddPlace());
})
.on('r', function(evt, mods) {
- controller.enter(iD.modes.AddRoad());
+ controller.enter(iD.modes.AddLine());
})
.on('z', function(evt, mods) {
if (mods === '⇧⌘') history.redo();
diff --git a/js/id/modes/add_road.js b/js/id/modes/add_line.js
similarity index 91%
rename from js/id/modes/add_road.js
rename to js/id/modes/add_line.js
index daf7e455f..bf5172b4a 100644
--- a/js/id/modes/add_road.js
+++ b/js/id/modes/add_line.js
@@ -1,9 +1,9 @@
-iD.modes.AddRoad = function() {
+iD.modes.AddLine = function() {
var mode = {
- id: 'add-road',
- button: 'road',
- title: 'Road',
- description: 'Roads can be highways, streets, pedestrian paths, or even canals.'
+ id: 'add-line',
+ button: 'line',
+ title: 'Line',
+ description: 'Lines can be highways, streets, pedestrian paths, or even canals.'
};
mode.enter = function() {
@@ -59,7 +59,7 @@ iD.modes.AddRoad = function() {
'started a road');
}
- controller.enter(iD.modes.DrawRoad(way.id, direction));
+ controller.enter(iD.modes.DrawLine(way.id, direction));
});
map.keybinding().on('⎋.addroad', function() {
diff --git a/js/id/modes/draw_road.js b/js/id/modes/draw_line.js
similarity index 73%
rename from js/id/modes/draw_road.js
rename to js/id/modes/draw_line.js
index 463e97f76..09789c8f7 100644
--- a/js/id/modes/draw_road.js
+++ b/js/id/modes/draw_line.js
@@ -1,6 +1,6 @@
-iD.modes.DrawRoad = function(wayId, direction) {
+iD.modes.DrawLine = function(wayId, direction) {
var mode = {
- button: 'road'
+ button: 'line'
};
mode.enter = function() {
@@ -16,19 +16,19 @@ iD.modes.DrawRoad = function(wayId, direction) {
map.dblclickEnable(false)
.fastEnable(false)
- .hint('Click to add more points to the road. ' +
- 'Click on other roads to connect to them, and double-click to ' +
- 'end the road.');
+ .hint('Click to add more points to the line. ' +
+ 'Click on other lines to connect to them, and double-click to ' +
+ 'end the line.');
history.perform(
iD.actions.AddNode(node),
iD.actions.AddWayNode(wayId, node.id, index));
- map.surface.on('mousemove.drawroad', function() {
+ map.surface.on('mousemove.drawline', function() {
history.replace(iD.actions.Move(node.id, map.mouseCoordinates()));
});
- map.surface.on('click.drawroad', function() {
+ map.surface.on('click.drawline', function() {
var datum = d3.select(d3.event.target).datum() || {};
if (datum.id === tailId) {
@@ -36,7 +36,7 @@ iD.modes.DrawRoad = function(wayId, direction) {
history.replace(
iD.actions.DeleteNode(node.id),
iD.actions.AddWayNode(wayId, tailId, index),
- 'added to a road');
+ 'added to a line');
controller.enter(iD.modes.Select(way));
@@ -51,9 +51,9 @@ iD.modes.DrawRoad = function(wayId, direction) {
history.replace(
iD.actions.DeleteNode(node.id),
iD.actions.AddWayNode(wayId, datum.id, index),
- 'added to a road');
+ 'added to a line');
- controller.enter(iD.modes.DrawRoad(wayId, direction));
+ controller.enter(iD.modes.DrawLine(wayId, direction));
} else if (datum.type === 'way') {
// connect the way to an existing way
@@ -61,16 +61,16 @@ iD.modes.DrawRoad = function(wayId, direction) {
history.replace(
iD.actions.AddWayNode(datum.id, node.id, connectedIndex),
- 'added to a road');
+ 'added to a line');
- controller.enter(iD.modes.DrawRoad(wayId, direction));
+ controller.enter(iD.modes.DrawLine(wayId, direction));
} else {
history.replace(
iD.actions.Noop(),
- 'added to a road');
+ 'added to a line');
- controller.enter(iD.modes.DrawRoad(wayId, direction));
+ controller.enter(iD.modes.DrawLine(wayId, direction));
}
});
@@ -92,7 +92,7 @@ iD.modes.DrawRoad = function(wayId, direction) {
history.replace(iD.actions.DeleteWay(wayId));
controller.enter(iD.modes.Browse());
} else {
- controller.enter(iD.modes.DrawRoad(wayId, direction));
+ controller.enter(iD.modes.DrawLine(wayId, direction));
}
}
@@ -108,10 +108,10 @@ iD.modes.DrawRoad = function(wayId, direction) {
controller.enter(iD.modes.Browse());
}
- map.keybinding().on('⎋.drawroad', esc)
- .on('⌫.drawroad', backspace)
- .on('delete.drawroad', del)
- .on('↩.drawroad', ret);
+ map.keybinding().on('⎋.drawline', esc)
+ .on('⌫.drawline', backspace)
+ .on('delete.drawline', del)
+ .on('↩.drawline', ret);
};
mode.exit = function() {
@@ -119,12 +119,12 @@ iD.modes.DrawRoad = function(wayId, direction) {
mode.map.fastEnable(true);
mode.map.surface
- .on('mousemove.drawroad', null)
- .on('click.drawroad', null);
- mode.map.keybinding().on('⎋.drawroad', null)
- .on('⌫.drawroad', null)
- .on('delete.drawroad', null)
- .on('↩.drawroad', null);
+ .on('mousemove.drawline', null)
+ .on('click.drawline', null);
+ mode.map.keybinding().on('⎋.drawline', null)
+ .on('⌫.drawline', null)
+ .on('delete.drawline', null)
+ .on('↩.drawline', null);
window.setTimeout(function() {
mode.map.dblclickEnable(true);
}, 1000);
diff --git a/test/index.html b/test/index.html
index e904c9276..85d99fc74 100644
--- a/test/index.html
+++ b/test/index.html
@@ -42,6 +42,7 @@
+
@@ -59,10 +60,10 @@
-
+
-
+
diff --git a/test/spec/connection.js b/test/spec/connection.js
index 25a95c53d..7a0bbacbe 100644
--- a/test/spec/connection.js
+++ b/test/spec/connection.js
@@ -49,12 +49,5 @@ describe('Connection', function() {
});
});
- it('passes errors for 404s', function(done) {
- c.loadFromURL('404', function(err, graph) {
- expect(graph).to.be.a('Error');
- done();
- });
- });
-
});
});
diff --git a/test/spec/renderer/map.js b/test/spec/renderer/map.js
index 99db16e95..bfd4d90a0 100644
--- a/test/spec/renderer/map.js
+++ b/test/spec/renderer/map.js
@@ -56,8 +56,8 @@ describe('Map', function() {
it('reports extent', function() {
expect(map.size([100, 100])).to.equal(map);
expect(map.center([0, 0])).to.equal(map);
- expect(map.extent()[0][0]).to.be.closeTo(-36, 0.5);
- expect(map.extent()[1][0]).to.be.closeTo(36, 0.5);
+ expect(map.extent()[0][0]).to.be.closeTo(-17.5, 0.5);
+ expect(map.extent()[1][0]).to.be.closeTo(17.5, 0.5);
});
});