User1535942433 posted
Hi progy85,
Accroding to your codes,I suggest you could loop the ajax and set two variables of "lat" and "lon".Then you could assign the value of the item variable to two data.
Since I don't know your url,so I creat a little test for you.
More details,you could refer to below codes:
<script type="text/javascript">
$(document).ready(function () {
var lat = '';
var lon = '';
var value = [
{
"lat": "45.9606152",
"lon": "13.641309",
},
{
"lat": "47.8006152",
"lon": "15.641309",
}
];
$.each(value, function (i, item) {
$.ajax({
type: "POST",
url: ("https://nominatim.openstreetmap.org/reverse.php?lat=" + item.lat + "&lon=" + item.lon + "&zoom=16&format=json"),
contentType: "application/json",
success: function (data) {
alert(item.lat + "," + item.lon);
alert(JSON.stringify(data));
},
});
});
});
</script>
Best regards,
Yijing Sun