diff --git a/css/app.css b/css/app.css
index ec71f7ac5..9e874aa55 100644
--- a/css/app.css
+++ b/css/app.css
@@ -1586,4 +1586,19 @@ div.combobox {
}
@media only screen and (max-height: 840px) {
-}
\ No newline at end of file
+}
+
+/* Address input */
+
+.preset-input .addr-housename {
+ width: 300px;
+ display: block;
+}
+
+.preset-input .addr-number {
+ width: 50px;
+}
+
+.preset-input .addr-streetname {
+ width: 250px;
+}
diff --git a/index.html b/index.html
index bb49d19ef..cdebb64ad 100644
--- a/index.html
+++ b/index.html
@@ -93,6 +93,7 @@
+
diff --git a/js/id/core/tree.js b/js/id/core/tree.js
index 94b28f12e..94b174230 100644
--- a/js/id/core/tree.js
+++ b/js/id/core/tree.js
@@ -12,8 +12,8 @@ iD.Tree = function(graph) {
function extentRectangle(extent) {
x = m * extent[0][0],
y = m * extent[0][1],
- dx = m * extent[1][0] - x || 1,
- dy = m * extent[1][1] - y || 1;
+ dx = m * extent[1][0] - x || 2,
+ dy = m * extent[1][1] - y || 2;
return new RTree.Rectangle(~~x, ~~y, ~~dx - 1, ~~dy - 1);
}
diff --git a/js/id/geo.js b/js/id/geo.js
index 682980758..f0c30d4a3 100644
--- a/js/id/geo.js
+++ b/js/id/geo.js
@@ -85,3 +85,7 @@ iD.geo.pathLength = function(path) {
}
return length;
};
+
+iD.geo.metresToCoordinates = function(loc, vector) {
+ return [vector[1] / 111200, vector[0] / 111200 / Math.cos(loc[1])];
+};
diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js
index 259cabcf6..8c13239cf 100644
--- a/js/id/ui/inspector.js
+++ b/js/id/ui/inspector.js
@@ -16,14 +16,13 @@ iD.ui.Inspector = function() {
entity = selection.datum();
- var iwrap = selection
- messagewrap = iwrap.append('div')
+ var messagewrap = selection.append('div')
.attr('class', 'message inspector-inner fillL'),
message = messagewrap.append('h3');
- inspectorbody = iwrap.append('div')
+ inspectorbody = selection.append('div')
.attr('class', 'fillL'),
- iwrap.append('div')
+ selection.append('div')
.attr('class', 'inspector-actions pad1 col12')
.call(drawButtons);
@@ -57,7 +56,7 @@ iD.ui.Inspector = function() {
inspectorbody.call(tagEditor);
}
- iwrap.call(iD.ui.Toggle(true));
+ selection.call(iD.ui.Toggle(true));
}
function drawButtons(selection) {
diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js
index 9c8e94f2c..9f61c0134 100644
--- a/js/id/ui/preset.js
+++ b/js/id/ui/preset.js
@@ -134,6 +134,11 @@ iD.ui.preset = function() {
// Multiple elements, eg, address
} else {
if (d.type === 'address') {
+ wrap.append('div')
+ .attr('class', 'col8 preset-input', d)
+ .call(iD.ui.preset.address()
+ .context(context)
+ .entity(entity));
}
}
});
diff --git a/js/lib/d3.combobox.js b/js/lib/d3.combobox.js
index 07b214746..815256045 100644
--- a/js/lib/d3.combobox.js
+++ b/js/lib/d3.combobox.js
@@ -226,6 +226,8 @@ d3.combobox = function() {
}
function mousedown() {
+
+ input.node().focus();
update('');
var entries = container.selectAll('a'),
diff --git a/presets/presets.json b/presets/presets.json
index af5c4828e..04a046f50 100644
--- a/presets/presets.json
+++ b/presets/presets.json
@@ -19,6 +19,10 @@
{
"key": "cuisine",
"type": "combo"
+ },
+ {
+ "type": "address",
+ "title": "Address"
}
]
},
diff --git a/test/spec/core/tree.js b/test/spec/core/tree.js
index 8cd4e55b6..1719f0d64 100644
--- a/test/spec/core/tree.js
+++ b/test/spec/core/tree.js
@@ -52,5 +52,13 @@ describe("iD.Tree", function() {
var g = tree.graph().replace(n1).replace(n2);
expect(tree.intersects(iD.geo.Extent([0, 0], [1.1, 1.1]), g)).to.eql([n1]);
});
+
+ it("doesn't include removed entities", function() {
+ var n1 = iD.Node({ id: 'n1', loc: [1, 1]});
+ var g = tree.graph().replace(n1);
+ expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), g)).to.eql([n1]);
+ g = g.remove(n1);
+ expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), g)).to.eql([]);
+ });
});
});