0.0.6 • Published 2 years ago
weather_condition v0.0.6
Weather condition
The Weather Condition Render library provides an interfance for displaying GRIB2 data on given OpenLayers map.
Публикация пакета в npm
- Установить зависимости:
npm i
- Запустить сборку билда
npm run build
- Авторизоваться в npm:
npm login
- Опубликовать в npm:
npm publish
Setup
Clone the repository, then run npm install
to install the library's dependencies.
Use
Import the API function that creates WeatherRenderer
instance from project's index:
import renderWeather from 'lhs-weather-conditon/index.js';
Then call it to assign the instance to a variable, with an OpenLayers map as a parameter:
const weather = renderWeather(ol_map);
API
WeatherRenderer
class has methods to work with:
loadData(grib2_file)
gets GRIB2 file and renders it's content on a maprenderWeather(ol_map)
set;setLayer(wind|temperature|pressure|precipitation)
change rendered layer to the specified (it should be 'wind', 'temperature', 'pressure' or 'precipitation').
show
boolean property toggles the visibility of weather map. Set show
to false
to hide weather condition, or true
to show it again.