when matching presets, count 'area' match as half

This commit is contained in:
Ansis Brammanis
2013-03-18 16:13:59 -04:00
parent 29b6f34403
commit ae98cd92ae

View File

@@ -18,7 +18,13 @@ iD.presets.Preset = function(id, preset, fields) {
score = 0;
for (var t in tags) {
if (entity.tags[t] === tags[t]) {
score++;
if (t === 'area') {
// score area tag lower to prevent other/area preset
// from being chosen over something more specific
score += 0.5;
} else {
score += 1;
}
} else if (tags[t] === '*' && t in entity.tags) {
score += 0.5;
} else {