Wind Layer API Documentation

website·Indexed 31 days ago

https://blog.sakitam.com/wind-layer

Technical API reference for Wind Layer, featuring components such as leaflet-wind, wind-gl-core, and rbush. Includes documentation for classes like WindLayer, WebglLayer, TileSource, and ImageSource, as well as utility functions for coordinate handling, extent intersection, and data range parsing.

Tokens
48.2K
Snippets
341
Records
479
Agent score
47%

What's inside Wind Layer

  1. Overview of wind-layer meteorological visualization

    wind-layer is a plugin specialized in the visualization of meteorological grid data. It uses fluid field animations to represent global wind speed and direction, inspired by the earth.nullschool.net project. While primarily used for wind fields, it can be used for general meteorological data visualization across various WebGIS libraries including maptalks, mapbox-gl, openlayers, leaflet, Baidu Maps, and Gaode Maps.
  2. Implement WebGL-based Tile and Image layers in Leaflet

    For developers needing high-performance rendering in Leaflet, WebGL layers can be used to replace standard DOM-based implementations. Specifically, WebGL alternatives are available for:

    • TileLayer: A WebGL replacement for the internal Leaflet TileLayer DOM implementation.
    • ImageOverlay: A WebGL replacement for the internal Leaflet ImageOverlay implementation.
  3. Extend Wind Layer to other map rendering libraries

    The Wind Layer architecture separates the core rendering library from the map-specific implementation. This decoupling allows developers to extend the wind visualization capabilities to different map rendering libraries beyond the default implementation.
  4. Supported projection codes for OpenLayers map displays

    The following projection codes are used for different map display requirements:

    • EPSG:3857: Standard Web Mercator projection (Default).
    • EPSG:4326: WGS 84 projection (Note: causes deformation at the poles).
    • EPSG:3413: Polar Stereographic projection.
    • ESRI:53009: Mollweide projection.
  5. Install @sakitam-gis/mapbox-wind

    The @sakitam-gis/mapbox-wind plugin can be installed via npm, pnpm, yarn, or included as a script tag for browser-based usage.
    # Using npm
    npm add @sakitam-gis/mapbox-wind
    
    # Using pnpm
    pnpm add @sakitam-gis/mapbox-wind
    
    # Using yarn
    yarn add @sakitam-gis/mapbox-wind
    <!-- Using CDN -->
    <script src="https://unpkg.com/@sakitam-gis/mapbox-wind/dist/mapbox-wind.js"></script>
  6. Install wind-layer via CDN

    Depending on the WebGIS library you are using, you can include the appropriate wind-layer distribution via unpkg or jsdelivr. The core libraries provide the base functionality, while the specific plugins integrate with map engines like maptalks, mapbox-gl, leaflet, and others.
    Libraryunpkgjsdelivr
    wind-corehttps://unpkg.com/wind-core/dist/wind-core.jshttps://cdn.jsdelivr.net/npm/wind-core/dist/wind-core.js
    wind-gl-corehttps://unpkg.com/wind-gl-core/dist/wind-gl-core.jshttps://cdn.jsdelivr.net/npm/wind-gl-core/dist/wind-gl-core.js
    @sakitam-gis/maptalks-windhttps://unpkg.com/@sakitam-gis/maptalks-wind/dist/maptalks-wind.jshttps://cdn.jsdelivr.net/npm/@sakitam-gis/maptalks-wind/dist/maptalks-wind.js
    @sakitam-gis/mapbox-windhttps://unpkg.com/@sakitam-gis/mapbox-wind/dist/mapbox-wind.jshttps://cdn.jsdelivr.net/npm/@sakitam-gis/mapbox-wind/dist/mapbox-wind.js
    @sakitam-gis/maplibre-windhttps://unpkg.com/@sakitam-gis/maplibre-wind/dist/maplibre-wind.jshttps://cdn.jsdelivr.net/npm/@sakitam-gis/maplibre-wind/dist/maplibre-wind.js
    leaflet-windhttps://unpkg.com/leaflet-wind/dist/leaflet-wind.jshttps://cdn.jsdelivr.net/npm/leaflet-wind/dist/leaflet-wind.js
    amap-windhttps://unpkg.com/amap-wind/dist/amap-wind.jshttps://cdn.jsdelivr.net/npm/amap-wind/dist/amap-wind.js
    bmap-windhttps://unpkg.com/bmap-wind/dist/bmap-wind.jshttps://cdn.jsdelivr.net/npm/bmap-wind/dist/bmap-wind.js
    ol5-windhttps://unpkg.com/ol5-wind/dist/ol-wind.jshttps://cdn.jsdelivr.net/npm/ol5-wind/dist/ol-wind.js