Files
iD/modules/presets/category.js
2016-06-22 12:34:43 +05:30

27 lines
623 B
JavaScript

import { Collection } from './collection';
export function Category(id, category, all) {
category = _.clone(category);
category.id = id;
category.members = Collection(category.members.map(function(id) {
return all.item(id);
}));
category.matchGeometry = function(geometry) {
return category.geometry.indexOf(geometry) >= 0;
};
category.matchScore = function() { return -1; };
category.name = function() {
return t('presets.categories.' + id + '.name', {'default': id});
};
category.terms = function() {
return [];
};
return category;
}