Fix areas vs lines in presets

This commit is contained in:
Ansis Brammanis
2013-02-01 14:46:21 -05:00
parent d2ab5d7f6d
commit ca940d9975
3 changed files with 409 additions and 405 deletions
+7 -3
View File
@@ -15,17 +15,21 @@ iD.presetData = function() {
};
presets.match = function(entity) {
var type = entity.type == 'node' ? 'node' : entity.geometry();
return data.filter(function(d) {
return _.contains(d.type, entity.type);
return _.contains(d.type, type);
});
};
presets.matchTags = function(entity) {
var tags, count, maxcount = 0, best;
var tags, count, best,
maxcount = 0,
type = entity.type == 'node' ? 'node' : entity.geometry();
for (var i = 0; i < data.length; i++) {
count = 0;
tags = data[i].tags;
if (!_.contains(data[i].type, entity.type)) continue;
if (!_.contains(data[i].type, type)) continue;
for (var k in tags) {
if (entity.tags[k] == tags[k]) count++;
}
+1 -1
View File
@@ -39,7 +39,7 @@ for item in dom1.getElementsByTagName('item'):
jitem = {
"name": item.getAttribute('name'),
"type": item.getAttribute('type').split(','),
"type": item.getAttribute('type').replace('closedway', 'area').replace('way', 'line').split(','),
"tags": tags,
"main": []
}
+401 -401
View File
File diff suppressed because it is too large Load Diff