mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Fixup area drawing, removing bonus nodes, preventing selection of
mid-drawing areas which incurs an expensive fetch.
This commit is contained in:
+1
-1
@@ -292,7 +292,7 @@ input#geocode-location {
|
||||
|
||||
.commit-section {
|
||||
max-height:250px;
|
||||
overflow:scroll;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
/* mobile tweaks */
|
||||
|
||||
@@ -8,7 +8,8 @@ iD.modes = {};
|
||||
iD.modes._node = function(ll) {
|
||||
return iD.Node({
|
||||
lat: ll[1],
|
||||
lon: ll[0]
|
||||
lon: ll[0],
|
||||
tags: {}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -219,7 +220,7 @@ iD.modes.AddArea = {
|
||||
title: "+ Area",
|
||||
way: function() {
|
||||
return iD.Way({
|
||||
tags: { building: 'yes', area: 'yes' }
|
||||
tags: { building: 'yes', area: 'yes', elastic: 'true' }
|
||||
});
|
||||
},
|
||||
enter: function() {
|
||||
@@ -312,6 +313,8 @@ iD.modes.DrawArea = function(way_id) {
|
||||
way.nodes.push(way.nodes[0]);
|
||||
this.map.perform(iD.actions.addWayNode(way,
|
||||
this.map.history.graph().entity(way.nodes[0])));
|
||||
delete way.tags.elastic;
|
||||
this.map.perform(iD.actions.changeTags(way, way.tags));
|
||||
// End by clicking on own tail
|
||||
return this.exit();
|
||||
} else {
|
||||
@@ -322,7 +325,8 @@ iD.modes.DrawArea = function(way_id) {
|
||||
node = iD.modes._node(this.map.projection.invert(
|
||||
d3.mouse(surface.node())));
|
||||
}
|
||||
way.nodes.pop();
|
||||
var old = this.map.history.graph().entity(way.nodes.pop());
|
||||
this.map.perform(iD.actions.removeWayNode(way, old));
|
||||
way.nodes.push(node.id);
|
||||
this.map.perform(iD.actions.addWayNode(way, node));
|
||||
way.nodes = way.nodes.slice();
|
||||
|
||||
@@ -370,7 +370,7 @@ iD.Map = function(elem, connection) {
|
||||
function selectClick() {
|
||||
var entity = d3.select(d3.event.target).data();
|
||||
if (entity) entity = entity[0];
|
||||
if (!entity || selection === entity.id) return;
|
||||
if (!entity || selection === entity.id || (entity.tags && entity.tags.elastic)) return;
|
||||
selection = entity.id;
|
||||
d3.select('.inspector-wrap')
|
||||
.style('display', 'block')
|
||||
|
||||
@@ -38,12 +38,14 @@ iD.commit = function() {
|
||||
.attr('placeholder', 'Brief Description');
|
||||
|
||||
body.append('button').text('Save')
|
||||
.attr('class', 'save')
|
||||
.on('click', function() {
|
||||
event.save({
|
||||
comment: d3.select('textarea.changeset-comment').node().value
|
||||
});
|
||||
});
|
||||
body.append('button').text('Cancel')
|
||||
.attr('class', 'cancel')
|
||||
.on('click', function() {
|
||||
event.cancel();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user