Documentation

Upgrades

@infoplaza/platform

A section appears here when a component change forces you to edit your app. Each guide covers one jump, from the version you have to the version you are installing. Newest first.

HUD multi-map props — 1.1.3 to 1.1.4

What changed. MapControlHud no longer takes isMultipleMapView, mapsLength or mapIndex. The HUD always uses its single-map layout: full-size info and timebar, the Blue Marble hint, up to five elements, and the zoom control on every map.

Before

<WeatherLayers showHud hudProps={{ mapIndex: 0, mapsLength: 1 }} />

<MapControlHud mapIndex={0} isMultipleMapView={false} />

After

<WeatherLayers showHud />

<MapControlHud />

What to update

  • Remove isMultipleMapView, mapsLength and mapIndex from MapControlHud and from hudProps. TypeScript reports them as unknown props.
  • To place controls per map in a grid, replace the HUD with your own controls, such as MapControlTimebar and MapControlLegend.

Unchanged. preloadOnGrab and skipUnavailableFrames stay on MapControlHud. Providers and WeatherLayers still take mapIndex.

Separate map timelines — 1.1.3 to 1.1.4

What changed. Each Providers, and so each WeatherLayers, keeps its own timeline. Two maps on one page no longer share the timestamp, playback, scrubbing or frame list, even with the same mapIndex. Before, every map with the same mapIndex moved together, and maps without one all used 0.

Before

// Different mapIndex values kept the maps apart
<WeatherLayers mapIndex={0} showHud />
<WeatherLayers mapIndex={1} showHud />

After

// Maps are independent by default
<WeatherLayers showHud />
<WeatherLayers showHud />

What to update

  • Nothing, if your maps should run independently. mapIndex values added to keep maps apart can stay or go.
  • If you used a shared mapIndex to keep two maps on the same time, sync them yourself: take onChange from one MapControlTimebar and call setTimestamp from useTimestampMap() inside the other map.

Unchanged. mapIndex is still accepted and useProviders() still returns it, as a label for the map. useTimestampMap() works as before inside each map.

Maritime elements — 1.1.3 to 1.1.4

What changed. The Maritime group follows the full ECMWF wave set. Three element slugs are renamed or removed, and new elements are added: primary, total and maximum wave heights, spectral and zero-crossing periods, tidal current speed, tidal sea surface height, tidal current direction and sea surface temperature.

Before

<WeatherLayers weatherConfig={{ element: 'seaheight' }} showHud />

After

<WeatherLayers weatherConfig={{ element: 'waveheight_wind' }} showHud />

What to update

  • Replace seaheight with waveheight_wind.
  • Replace swell with waveheight_swell.
  • Replace significantwaveheight_wind with waveheight_significant.
  • Update saved links or stored selections that use the old slugs.

Unchanged. Every other Maritime slug, such as waveperiod_swell and current_seasurface, keeps its name.

Contours — 1.1.3 to 1.1.4

What changed. Contour lines are traced in the browser from the image tiles, with labels and highs and lows. Pressure, geopotential and theta-w draw CONTOURS instead of server CONTOURGEOJSON. Every grayscale element offers contours, off unless its config turns them on. The RANGE rendering type is removed. Highs and lows are the internal HIGHLOW type, built from CONTOURS tiles. Stored global contour intervals and on/off choices are discarded, so each element starts from its own defaults.

Before

{ element: 'pressure_meansealevel', connection: 'ContourConnection', rendering: ['CONTOURGEOJSON'] }
{ element: 'pressure_meansealevel', connection: 'ImageConnection', rendering: ['RANGE'] }

After

{
  element: 'pressure_meansealevel',
  connection: 'ImageConnection',
  rendering: ['CONTOURS'],
  grayscale: true,
  settings: { contour: { contourEnabled: true, contourInterval: 4, contourMajorInterval: 20, contourHighLowEnabled: true } },
}

What to update

  • Remove RANGE from custom layer configs. Set contourHighLowEnabled on a CONTOURS layer instead.
  • To keep contours on for an element in a custom config, set settings.contour.contourEnabled: true. Without it they start off.
  • Contour tiles need CPU pixels, so a CONTOURS layer needs grayscale: true and an ImageConnection.
  • Contour geometry runs in a module worker, dist/workers/geometry-worker.js. Bundlers that already serve the bitmap worker need no change.

Unchanged. CONTOURGEOJSON still renders when a custom config asks for it. The contour settings panel keeps interval, major interval, width, colour and opacity.

GPU memory — 1.1.3 to 1.1.4

What changed. @deck.gl/extensions 9.4 leaks one canvas-sized framebuffer per collision group, and contour labels use collision groups. The package now uses one group per layer, which keeps the leak small. The full fix is a patch to @deck.gl/extensions, which only your app can apply. The package ships it in patches/.

Before

npm install @infoplaza/platform

After

npm install --save-dev patch-package
mkdir -p patches
cp node_modules/@infoplaza/platform/patches/@deck.gl+extensions+9.4.0.patch patches/
# package.json: "scripts": { "postinstall": "patch-package" }
npm install

What to update

  • Copy the patch and run it with patch-package on install.
  • The patch targets @deck.gl/extensions 9.4.0. On a deck.gl upgrade, check whether upstream fixed the leak and delete the patch if it did.

Unchanged. Without the patch everything renders. GPU memory grows by about one framebuffer per contour layer, window resizes add more, and none of it is freed until the page reloads.

Events — 1.1.3 to 1.2.0

What changed. Every forecast model loads the tiles in view, including regional models and global models that were not on the old slug list. Nowcast already used tiles. The observations element on a forecast model, tropical storms, and grades stay on the full-domain loader. TILE_MODEL_SLUGS is removed.

Before

<WeatherLayers />

After

<WeatherLayers />

What to update

  • Delete any import of TILE_MODEL_SLUGS.
  • Expect every forecast model to load tiles. Pass handler="simple" where a forecast should keep the full-domain loader.
  • Pass handler="demand" where a model should keep viewport full-domain fetches.

Unchanged. Nowcast still uses tiles. An explicit handler still wins. Observations on a forecast model still use the simple handler.

WeatherLayers — 1.1.3 to 1.2.0

What changed. Passing element: null no longer selects temperature. useWeatherMap().element can be null, and no layer is fetched.

Before

<WeatherLayers weatherConfig={{ element: null }} showHud />

After

<WeatherLayers weatherConfig={{ element: 'temperature' }} showHud />

What to update

  • If you passed element: null and expected temperature, omit element or pass 'temperature'.
  • Treat useWeatherMap().element as string | null.

Unchanged. Omitting element still selects temperature, and showHud is unchanged.

Timebar — 1.1.2 to 1.1.3

What changed. Tile forecast models no longer start playback on their own. The bar stays on the current frame until someone presses play. Nowcast was already manual.

Before

<WeatherLayers showHud />

After

<WeatherLayers showHud />

What to update

  • No prop change. Expect the play bar to wait for the play button.

Unchanged. Play, pause, step, and speed stay as they are. A stall still resumes once the next frames are loaded.

Map styles — 1.1.2 to 1.1.3

What changed. Sea and Traffic marine basemaps are the remote imweather-sea-land style. Neutral and Blue Marble are new style keys. A host that controls mapStyleKey passes onMapStyleKeyChange so “Use Blue Marble” can switch the style.

Before

<PlatformMap mapStyleKey={styleKey} />

After

<PlatformMap
  mapStyleKey={styleKey}
  onMapStyleKeyChange={setStyleKey}
/>

What to update

  • Pass onMapStyleKeyChange when the host owns mapStyleKey.
  • Add imweather-sea and blue-marble if a picker lists style keys.

Unchanged. dark and land stay as they are. Omitting mapStyleKey still keeps the choice inside the map.

Particles — 1.1.2 to 1.1.3

What changed. Stored particle settings that still match the old defaults move to the new ones: 5500 particles, max age 25, speed 4.9, width 1.5, opacity 0.98. A value the user set is left alone.

Before

<WeatherLayers showHud />

After

<WeatherLayers showHud />

What to update

  • No prop change. Reload the map so stored defaults can upgrade.

Unchanged. Particle color, palette use, and the animate flag stay as stored.

Timebar — 1.1.0 to 1.1.1

What changed. The HUD picks the bar from the model type when that type is forecast, nowcast, or climate. Other type values, such as Deterministic, fall through to format. Climate models show a month and period bar. The observations element shows a scrubber. Forecast and nowcast keep the play bar.

Before

<WeatherLayers showHud />

After

<WeatherLayers showHud />

What to update

  • Expect a month and period bar on climate models. It writes the month and period the demand handler already reads.
  • Expect the observations element to step through timestamps without a play button.
  • Screens that render the play timebar themselves are unchanged.

Unchanged. Forecast and nowcast play, speed, and the desktop load track stay as they are. MapControlHud takes no new props.

PlatformMap — 1.0.39 to 1.1.0

What changed. The map keeps the camera for the whole pan and zoom, including the release coast. Writing viewState from onMove no longer steers the map on every frame.

Before

<PlatformMap
  viewState={viewState}
  onMove={(event) => setViewState(event.viewState)}
/>

After

<PlatformMap
  viewState={viewState}
  onMoveEnd={(event) => setViewState(event.viewState)}
/>

What to update

  • Persist longitude, latitude, and zoom from onMoveEnd. The same callback exists on BaseMap.
  • Keep onMove only for a live readout. It still fires on every frame.
  • Move the map from code with the map ref (flyTo, jumpTo, easeTo) or fitBounds. Setting viewState to a new camera still moves the map once it is idle.

Unchanged. minZoom, maxZoom, and dragRotate on viewState still apply live. Style props, onClickMap, and peer sync stay as they are.

Map — 1.0.39 to 1.1.0

What changed. Nowcast and the high-resolution global models load the tiles in view. Other global models load the full domain. A single map blends between frames. Saved layer settings from before this version are discarded. The dark marine basemap is a hosted style URL.

Before

<WeatherLayers />

After

<WeatherLayers handler="demand" />

What to update

  • Pass handler="demand" where a global model should keep loading the whole run on demand.
  • Pass handler="nowcast" where nowcast should keep the previous full-domain loader.
  • Expect saved layer settings to reset. Image range is no longer written to storage.
  • Read the dark marine style as a URL. It is no longer an inline style object.

Unchanged. Timeseries, ensemble, and the PlatformMap style props stay as they are. One map still plays from the play-speed setting.

Timeseries table — 1.0.36 to 1.1.0

What changed. The table no longer adds a Position group with Lat and Long rows. showPosition is removed from TimeseriesTableForecast and TimeseriesTableProvider.

Before

<TimeseriesTableForecast
  lat={52.3676}
  lon={4.9041}
  showPosition
/>

After

<TimeseriesTableForecast
  lat={52.3676}
  lon={4.9041}
/>

What to update

  • Delete showPosition from forecast and provider calls.
  • Delete any read of showPosition from useTimeseriesTable().

Unchanged. lat and lon are still required. They select the forecast point. Other groups stay as they are.