mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Fix areas vs lines in presets
This commit is contained in:
+7
-3
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user