mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-25 23:13:42 +00:00
26 lines
571 B
JavaScript
26 lines
571 B
JavaScript
iD.Node = iD.Entity.node = function iD_Node() {
|
|
if (!(this instanceof iD_Node)) {
|
|
return (new iD_Node()).initialize(arguments);
|
|
} else if (arguments.length) {
|
|
this.initialize(arguments);
|
|
}
|
|
};
|
|
|
|
iD.Node.prototype = Object.create(iD.Entity.prototype);
|
|
|
|
_.extend(iD.Node.prototype, {
|
|
type: "node",
|
|
|
|
extent: function() {
|
|
return iD.geo.Extent(this.loc);
|
|
},
|
|
|
|
geometry: function(graph) {
|
|
return graph.isPoi(this) ? 'point' : 'vertex';
|
|
},
|
|
|
|
move: function(loc) {
|
|
return this.update({loc: loc});
|
|
}
|
|
});
|