- Which format is the best to use depends mostly how you use the data
after. For a Website whit JavaScript jsonp is probably the best
choice (I guess Maps API is the one from Google). Don't use json as this is restricted because the json come from a different server than your JavaScript.
- The first x coordinate is here: your_data_object.folder[0].polygon[0].x
- You will get directly a JavaScript object.
Example:
<script type="text/javascript" >
var apikey = "YOUR API KEY";
var request = "http://api.wikimapia.org/?function=box&bbox=99.555,1.2,104.353,6.751&category=88&count=2&format=jsonp&jsoncallback=readwikimapia&key="+apikey;
// Callback defined in the URL.
// This function is run by the code from WikiMapia
function readwikimapia(data){
document.write(data.folder[0].polygon[0].x);
}
// Create a script object to load the jsonp script
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = request;
document.body.appendChild(script);
</script>