Documentation
Introduction
@infoplaza/platform
React components and providers for Infoplaza weather on a MapLibre map, plus a portable timeseries forecast table, timeseries charts, and ensemble plume charts. PlatformMap is the general map shell; weather is optional via WeatherLayers.
What you get
Four sibling products, one package. Import each from its own entry point — do not nest timeseries, timeseries charts, or ensemble under the map barrel.
- Map —
PlatformMap±WeatherLayers(providers, events, Deck overlay, HUD). - Timeseries — location-aware forecast table. Catalog and rows load through PlatformAuth.
- Timeseries charts — Recharts LINE / DIRECTION / VALUE / PRECIPITATION_TYPE charts from the same timeseries catalog.
- Ensemble — plume / line / bar charts from the ensemble catalog.
What you need
- A React 18 or 19 application.
- An API token from the Infoplaza developer platform, plus the platform auth route mounted on your server with
PLATFORM_API_KEY— this powers the internal models and forecast requests. See Server setup. - For maps: a MapLibre style (built-in
MAP_STYLESor your own) and MapLibre 6 worker wiring. See MapLibre 6. - Package styles imported once:
@infoplaza/platform/styles.cssorstyles.embed.cssin a Tailwind host. See Styling. - MapLibre CSS imported once:
maplibre-gl/dist/maplibre-gl.css.
Entry points
Prefer the subpath that matches the product. The top-level @infoplaza/platform barrel re-exports map components, providers, layers, and defaults — not auth, events, timeseries, timeseries charts, ensemble, or CSS.
Imports
| Import | Type | Default | Description |
|---|---|---|---|
| @infoplaza/platform | barrel | — | Top-level API: PlatformMap, WeatherLayers, providers, LayerComposer / LayerOverlay, MAP_STYLES. |
| @infoplaza/platform/components | map | — | PlatformMap, WeatherLayers, BaseMap, MapControlHud. |
| @infoplaza/platform/providers | map | — | Providers, usePlatformMap, useModels, useProviders. |
| @infoplaza/platform/defaults | map | — | MAP_STYLES, MapStyle type, beforeId constants. |
| @infoplaza/platform/auth | server | — | PlatformAuth catch-all route handler. |
| @infoplaza/platform/events | map | — | MapEventsProvider. |
| @infoplaza/platform/layers | map | — | LayerComposer, LayerOverlay. Deep imports /composer and /overlay. |
| @infoplaza/platform/timeseries | table | — | TimeseriesForecast, models/provider, toolbar, builder, chart, footer. |
| @infoplaza/platform/timeseries-charts | charts | — | TimeseriesChartsForecast, models/provider, toolbar, builder, chart, graph. |
| @infoplaza/platform/ensemble | charts | — | EnsembleForecast, models/provider, toolbar, builder, chart, graph. |
| @infoplaza/platform/styles.css | css | — | Full stylesheet including Tailwind preflight — standalone apps. |
| @infoplaza/platform/styles.embed.css | css | — | Prefixed utilities only, no preflight — Tailwind hosts. |
Weather models are fetched internally by
Providers / WeatherLayers. Timeseries and ensemble catalogs load the same way. You must create an API token and mount the auth route — without them, maps, tables, and charts will not load data.Next steps
- Install the package and peer
maplibre-gl. - Create an API token on the Infoplaza developer platform.
- Mount PlatformAuth with
PLATFORM_API_KEY. - Follow the Quick start for a map, or jump to timeseries / ensemble.
- See live API request counts and token credits in the platform examples: maps and charts (timeseries and ensemble).
npm install @infoplaza/platform maplibre-gl