
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
wind-layer
Advanced tools
a openlayers | bmap | amap | maptalks extension to windjs
示例:openlayers | ol6.x | bmap | amap | maptalks
git clone https://github.com/sakitam-fdd/wind-layer.git
npm install
npm run dev
npm run build
npm install wind-layer --save
import windLayer from 'wind-layer'
// 分模块
import {
AMapWind, // amap
BMapWind, // bmap
OlWind // openlayers
} from 'wind-layer'
// ol5
import OlWindy from 'wind-layer/dist/OlWindy.js'
import OlWindy from 'wind-layer/dist/OlWindy.esm.js'
// ol6
import OlWindy from 'wind-layer/dist/Ol6Windy.js'
import OlWindy from 'wind-layer/dist/Ol6Windy.esm.js'
// maptalks
import MaptalksWindy from 'wind-layer/dist/MaptalksWindy.js'
import MaptalksWindy from 'wind-layer/dist/MaptalksWindy.esm.js'
目前可通过 unpkg.com / jsdelivr 获取最新版本的资源。
# jsdelivr (jsdelivr由于缓存原因最好锁定版本号,否则可能会出现意料之外的问题)
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/windLayer.js
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/windLayer.min.js
# npm
https://unpkg.com/wind-layer/dist/windLayer.js
https://unpkg.com/wind-layer/dist/windLayer.min.js
# 分模块
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/AMapWind.js // amap
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/BMapWind.js // bmap
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/OlWind.js // openlayers
https://cdn.jsdelivr.net/npm/wind-layer@0.1.2/dist/MaptalksWindy.js // maptalks

天气数据由全球预报系统(GFS)生成, 由美国国家气象局管理。 预测每天产生四次,并可用于 从NOMADS下载。 这些文件位于GRIB2 格式并包含超过300条记录。 我们只需要这些记录中的一小部分就可以在特定的等压线上可视化风资料。 下面的命令下载 1000 hPa风向量,并使用grib2json将它们转换为JSON格式。
YYYYMMDD=<a date, for example: 20140101>
curl "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs.pl?file=gfs.t00z.pgrb2.1p00.f000&lev_10_m_above_ground=on&var_UGRD=on&var_VGRD=on&dir=%2Fgfs.${YYYYMMDD}00" -o gfs.t00z.pgrb2.1p00.f000
grib2json -d -n -o current-wind-surface-level-gfs-1.0.json gfs.t00z.pgrb2.1p00.f000
cp current-wind-surface-level-gfs-1.0.json <earth-git-repository>/public/data/weather/current
默认运行在3000端口, 使用koa2构建。 目前仅抓取少量数据, 全部数据数据量过大会造成抓取时间过长和转换失败。
npm run start // 调试环境启动服务
npm run prd:server // 部署环境启动服务
| url | params | desc |
|---|---|---|
autofetch | null | 无需参数,开启自动抓取程序,默认30分钟抓取一次数据源 |
stopautofetch | null | 停止自动抓取程序 |
getdata | Object (目前只支持time 参数,时间戳) | 获取json数据,存在转换过的直接返回,若只存在元数据则转换后返回,若元数据也不存在则抓取转换后再响应 |
gribdata | Object (目前只支持time 参数,时间戳) | 获取grib2数据(强制抓取数据) |
getSourceTree | null | 无需参数,获取抓取的数据源 grib2 源数据。返回一个list,包含文件名和服务器地址。 |
getParseTree | null | 无需参数,获取转换后的 json 数据。返回一个list,包含文件名和服务器地址。 |
getDataByFileName | { filename } | 通过文件名请求 json 数据,文件名可为源数据文件和json文件名 |
如果想简单的运行一下看看,可以执行这个命令:
docker run -d -p 8080:3333 sakitamclone/wind-server:0.0.1
启动后就可以通过主机的 8080 端口看到运行结果了,比如用的是本机 Docker 的话,访问:http://localhost:8080 即可。
测试结束后,彻底清除容器可以用命令:
docker rm -fv <容器ID>
这样可以停止、删除容器,并清除数据。
新建文件 docker-compose.yml, 内容如下:
version: '3'
services:
wind-server:
image: sakitamclone/wind-server:latest
build:
context: ./
args:
NODE_ENV: development
hostname: wind-server
environment:
- CORS_ORIGIN=****
ports:
- "8080:3333"
volumes:
yarn:
然后使用命令 docker-compose up -d 来启动,停止服务使用 docker-compose down。
FAQs
a openlayers ol bmap amap maptalks extension to windjs
The npm package wind-layer receives a total of 17 weekly downloads. As such, wind-layer popularity was classified as not popular.
We found that wind-layer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.