mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 09:04:02 +02:00
Remove indirection between entity and types
This commit is contained in:
+9
-2
@@ -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) {
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
Reference in New Issue
Block a user