@openweather/maps-maplibre
The MapLibre adapter — createWeatherMap(), the renderer managers it wires together, and
lower-level escape hatches for building a custom map integration. Peer-depends on maplibre-gl ≥ 5.
createWeatherMap(options)
Returns a Promise<WeatherMapHandle> — see the Vanilla (MapLibre) guide
for the full constructor-options and handle-method tables.
createMapLibreController(options)
A lower-level factory — wires a MapController-shaped object to an existing MapLibre map without
the rest of WeatherMapHandle's overlay-manager assembly. Useful when you want flyTo/camera
integration and engine wiring but intend to manage the individual overlay managers yourself. Returns
a MapController (FlyToOptions, camera helpers) — see @openweather/maps-core's base MapController
shape.
Renderer managers
Each of these is exported individually for direct use outside createWeatherMap's assembly:
| Export | Role |
|---|---|
ScalarFlowRenderer |
Owns the @openweather/maps-gl ScalarFlow instance for the active layer |
RasterLayerManager |
XYZ raster tiles (e.g. EUMETSAT clouds) — server-side render params in the URL, opacity as MapLibre paint |
CycloneOverlayManager |
Storm-track GeoJSON — select + popup, exposes interactive layer ids for click-conflict avoidance |
LightningOverlayManager |
WebSocket strike stream — short-lived markers, optional auto-enable on radar. Types: LightningStrike, LightningOverlayOptions |
CropMaskManager |
land/water style-fill cover so soil hides oceans and waves hide continents |
createLocationPins(map, options) |
MapLibre Marker management for search/click pins, shared by both UI renderers since markers are DOM either way. Types: LocationPinsOptions, LocationPinsHandle. Never set inline position on a Marker's element — it silently overrides MapLibre's own position: absolute class. |
WebGL support check
createWeatherMap checks isWebGLSupported() before constructing the map and throws a clear error
if WebGL isn't available, rather than hanging indefinitely waiting for a load event that will
never fire. See Events & State for how MapLibre's own internal error
events (lost context, style/sprite/glyph fetch failures) get forwarded into the same WeatherEngine
error channel.
Re-exported from @openweather/maps-gl
ScalarFlow, logger, ScalarLayerConfig, ParticleLayerConfig — so a consumer using
@openweather/maps-maplibre doesn't need a separate @openweather/maps-gl import for the common types.
Types
WeatherMapHandle, WeatherMapOptions, MapLibreControllerOptions, MapController,
MapControllerFactoryOptions, FlyToOptions.
Internal (not exported from the main barrel)
MultiTileScalarManager and PointQuerySampler are internal to this package — see
Architecture — Multi-tile assembly and
Point query for what they do.