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's gravatar image

DavidSerene
11112
accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×159
×4

question asked: 12 Apr '12, 10:16

question was seen: 1,734 times

last updated: 12 Apr '12, 10:16

powered by OSQA