我想使用 Wikimapia API。
- 我应该选择什么格式来轻松地从中获取多边形坐标?
- 如何获取文件的坐标和地名?
- 如何从 API 输出中创建变量?
我想用这些信息在 Maps API 中绘制多边形。
我想使用 Wikimapia API。
我想用这些信息在 Maps API 中绘制多边形。
例子:
<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>