Use osmId/Entity.id.toOSM

This commit is contained in:
John Firebaugh
2013-01-28 10:16:51 -05:00
parent 2ac0f1dc26
commit f6ff3e678b
2 changed files with 3 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ _.extend(iD.Node.prototype, {
asJXON: function(changeset_id) {
var r = {
node: {
'@id': this.id.replace('n', ''),
'@id': this.osmId(),
'@lon': this.loc[0],
'@lat': this.loc[1],
'@version': (this.version || 0),

View File

@@ -88,10 +88,10 @@ _.extend(iD.Way.prototype, {
asJXON: function(changeset_id) {
var r = {
way: {
'@id': this.id.replace('w', ''),
'@id': this.osmId(),
'@version': this.version || 0,
nd: _.map(this.nodes, function(id) {
return { keyAttributes: { ref: id.replace('n', '') } };
return { keyAttributes: { ref: iD.Entity.id.toOSM(id) } };
}),
tag: _.map(this.tags, function(v, k) {
return { keyAttributes: { k: k, v: v } };