【文件属性】:
文件名称:wikigeo:用于从Wikipedia API获取geojsonJavaScript库
文件大小:11KB
文件格式:ZIP
更新时间:2021-05-07 08:32:26
CoffeeScript
*
wikigeo允许您围绕给定的地理坐标获取文章的 。 使用,可以轻松将其添加到地图中。 数据直接来自安装了扩展名的 。
基本
将wikigeo.js添加到HTML页面后,您将获得一个名为geojson的函数,该函数传递一个坐标[longitude, latitude]和一个回调函数,该函数将接收geojson数据:
geojson ( [ - 73.94 , 40.67 ] , function ( data ) {
console . log ( data ) ;
} ) ;
此调用的geojson应该类似于:
{
"type" : "FeatureCollection" ,
"features" : [
{
"id" : "30854694" ,
"type" : "Feature" ,
"properties"
【文件预览】:
wikigeo-master
----example.html(961B)
----src()
--------wikigeo.coffee(6KB)
----lib()
--------wikigeo.js(7KB)
----.npmignore(22B)
----.travis.yml(18B)
----test()
--------wikigeo.coffee(3KB)
----README.md(8KB)
----.editorconfig(415B)
----.gitignore(13B)
----package.json(579B)