Files
iD/js/id/graph/node.js
John Firebaugh 292c916cb1 Converting some actions to entity methods
The guidelines here are:

Entity methods:
  return a modified entity
  don't necessarily maintain whole-graph consistency

Actions:
  return a modified graph
  always maintain whole-graph consistency
  call entity methods liberally
  generally don't call other actions
2013-01-23 12:40:27 -05:00

26 lines
558 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() {
return this._poi ? 'point' : 'vertex';
},
move: function(loc) {
return this.update({loc: loc});
}
});