Remove indirection between entity and types

This commit is contained in:
Tom MacWright
2013-01-11 15:35:10 -05:00
parent 3680d8ae8a
commit e30995921e
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -77,8 +77,15 @@ iD.Connection = function() {
delete o.lat;
}
o.id = iD.Entity.id.fromOSM(o.type, o.id);
if (o.type === 'node') o._poi = !refNodes[o.id];
return iD.Entity(o);
switch (o.type) {
case 'node':
o._poi = !refNodes[o.id];
return iD.Node(o);
case 'way':
return iD.Way(o);
case 'relation':
return iD.Relation(o);
}
}
function parse(dom) {
+1 -1
View File
@@ -26,7 +26,7 @@ iD.Entity.id.toOSM = function (id) {
// A function suitable for use as the second argument to d3.selection#data().
iD.Entity.key = function (entity) {
return entity.id;
}
};
iD.Entity.prototype = {
tags: {},