Hi,
I am developing an android app using phonegap apis. I would like the app to to upload map data to osm using the osm apiv0.6. iam using the code below from localhost to create a changeset:
function createChangeset(){
var xmlData = '<osm><changeset><tag k="created_by" v="mappr"/><tag k="comment" v="first upload"/></changeset></osm>';
var url1 = "http://api06.dev.openstreetmap.org/api/0.6/changeset/create";
$.ajax({
type:"PUT",
username: "debukali@gmail.com",
password: "lettersforme",
url: url1,
data: xmlData,
"error":function(xhr, textStatus, errorThrown)
{
if (xhr.status === 0) {
alert('Not connect.\n Verify Network.');
} else if (xhr.status == 404) {
alert('Requested page not found. [404]');
} else if (xhr.status == 500) {
alert('Internal Server Error [500].');
} else if (textStatus === 'parsererror') {
alert('Requested JSON parse failed.');
} else if (textStatus === 'timeout') {
alert('Time out error.');
} else if (textStatus === 'abort') {
alert('Ajax request aborted.');
} else {
alert('Uncaught Error.\n' + xhr.responseText);
}
},
"success":function(data)
{
alert("Success: "+data);
//$("#openingmessage").css("background","yellow").html(data);
}
});
}
Above code returns alert with success but the data is not shown.
Please show how to make changeset creation calls to osm api v0.6 in jquery or phonegap?
asked
12 Apr '12, 10:16
DavidSerene
11●1●1●2
accept rate:
0%