Fixup saving, test modifying

This commit is contained in:
Tom MacWright
2012-11-26 13:54:34 -05:00
parent 2200a63429
commit ab0b71f548
2 changed files with 8 additions and 6 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
iD.Connection = function() {
var apiURL = 'http://www.openstreetmap.org/api/0.6/',
var apiURL = 'http://www.openstreetmap.org/api/0.6',
connection = {},
refNodes = {},
user = {},
@@ -7,13 +7,13 @@ iD.Connection = function() {
// Request data within the bbox from an external OSM server.
function bboxFromAPI(box, callback) {
loadFromURL(apiURL + 'map?bbox=' +
loadFromURL(apiURL + '/map?bbox=' +
[box[0][0], box[1][1], box[1][0], box[0][1]], callback);
}
// Request data within the bbox from an external OSM server.
function wayFromAPI(id, callback) {
loadFromURL(apiURL + 'way/' + id + '/full', callback);
loadFromURL(apiURL + '/way/' + id + '/full', callback);
}
function loadFromURL(url, callback) {
@@ -115,7 +115,7 @@ iD.Connection = function() {
method: 'PUT',
path: '/changeset/' + changeset_id + '/close'
}, function () {
alert('saved! ' + apiURL.replace('/api/0.6/', '/browse') + '/changeset/' + changeset_id);
alert('saved! ' + apiURL.replace('/api/0.6', '/browse') + '/changeset/' + changeset_id);
});
});
});
+4 -2
View File
@@ -53,7 +53,9 @@ iD.format.XML = {
node: {
'@id': entity.id.replace('n', ''),
'@lat': entity.lat, '@lon': entity.lon,
tag: _.map(entity.tags, function(k, v) {
'@version': (entity.version || 0),
tag: _.map(entity.tags, function(v, k) {
console.log(k, v);
return { keyAttributes: { k: k, v: v } };
})
}
@@ -68,7 +70,7 @@ iD.format.XML = {
nd: entity.nodes.map(function(e) {
return { keyAttributes: { ref: e.id } };
}),
tag: _.map(entity.tags, function(k, v) {
tag: _.map(entity.tags, function(v, k) {
return {
keyAttributes: { k: k, v: v }
};