mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-23 12:30:29 +01:00
Add area tag by default, remove when applying preset
This commit is contained in:
@@ -5,9 +5,13 @@ iD.presets = function(context) {
|
||||
|
||||
var other = iD.presets.Preset('other', {
|
||||
tags: {},
|
||||
geometry: ['point', 'vertex', 'line', 'area']
|
||||
geometry: ['point', 'vertex', 'line']
|
||||
}),
|
||||
all = iD.presets.Collection([other]),
|
||||
otherarea = iD.presets.Preset('other/area', {
|
||||
tags: { area: 'yes' },
|
||||
geometry: ['area']
|
||||
}),
|
||||
all = iD.presets.Collection([other, otherarea]),
|
||||
defaults = { area: all, line: all, point: all, vertex: all },
|
||||
fields = {},
|
||||
universal = [],
|
||||
|
||||
@@ -13,18 +13,15 @@ iD.ui.TagEditor = function(context, entity) {
|
||||
selection_ = selection;
|
||||
var geometry = entity.geometry(context.graph());
|
||||
|
||||
if (!preset) preset = presets.match(entity, context.graph());
|
||||
|
||||
// preset was explicitly chosen
|
||||
if (newpreset) {
|
||||
if (preset) {
|
||||
tags = preset.removeTags(tags, geometry);
|
||||
}
|
||||
|
||||
tags = preset.removeTags(tags, geometry);
|
||||
|
||||
newpreset.applyTags(tags, geometry);
|
||||
preset = newpreset;
|
||||
|
||||
// find a preset that best fits
|
||||
} else if (!preset) {
|
||||
preset = presets.match(entity, context.graph());
|
||||
}
|
||||
|
||||
selection.html('');
|
||||
|
||||
Reference in New Issue
Block a user