diff --git a/js/id/behavior/draw_way.js b/js/id/behavior/draw_way.js index c741abf90..a99a0a745 100644 --- a/js/id/behavior/draw_way.js +++ b/js/id/behavior/draw_way.js @@ -110,6 +110,14 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { }; } + function RemoveTemporaryTag(way) { + return function(graph) { + var area = graph.entity(wayId); + return graph + .replace(area.update({tags:_.omit(area.tags, '__area__')})); + }; + } + // Accept the current position of the temporary node and continue drawing. drawWay.add = function(loc) { var newNode = iD.Node({loc: loc}); @@ -163,6 +171,8 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { var way = context.entity(wayId); if (way) { + context.perform( + RemoveTemporaryTag(way)); context.enter(iD.modes.Select(context, [way.id], true)); } else { context.enter(iD.modes.Browse(context)); diff --git a/js/id/core/way.js b/js/id/core/way.js index 9eb27650d..f39cf1eeb 100644 --- a/js/id/core/way.js +++ b/js/id/core/way.js @@ -43,7 +43,7 @@ _.extend(iD.Way.prototype, { }, isArea: function() { - if (this.tags.area === 'yes') + if (this.tags.area === 'yes' || this.tags.__area__ === 'yes') return true; if (!this.isClosed() || this.tags.area === 'no') return false; diff --git a/js/id/modes/add_area.js b/js/id/modes/add_area.js index 1614a3997..18d51f018 100644 --- a/js/id/modes/add_area.js +++ b/js/id/modes/add_area.js @@ -11,7 +11,7 @@ iD.modes.AddArea = function(context) { .on('start', start) .on('startFromWay', startFromWay) .on('startFromNode', startFromNode), - defaultTags = {area: 'yes'}; + defaultTags = {__area__: 'yes'}; function start(loc) { var graph = context.graph(),