Documentation
Migration
The hand-wired composition remains supported (see the Composed example on the map demo). New integrations should use PlatformMap + WeatherLayers.
Before (still works)
import { BaseMap, MapControlHud } from '@infoplaza/platform/components'
import { MAP_STYLES } from '@infoplaza/platform/defaults'
import { Providers } from '@infoplaza/platform/providers'
import { LayerComposer, LayerOverlay } from '@infoplaza/platform/layers'
import MapEventsProvider from '@infoplaza/platform/events'
<Providers>
<BaseMap viewState={viewState} onMove={onMove} mapStyles={MAP_STYLES} mapStyleKey="dark">
{({ beforeId }) => (
<>
<MapEventsProvider handler="demand">
{(mapComponents) => (
<LayerComposer beforeId={beforeId} mapComponents={mapComponents}>
{({ layers }) => (
<LayerOverlay layers={layers} interleaved controller />
)}
</LayerComposer>
)}
</MapEventsProvider>
<MapControlHud />
</>
)}
</BaseMap>
</Providers>After (recommended)
import { PlatformMap, WeatherLayers } from '@infoplaza/platform/components'
import { MAP_STYLES } from '@infoplaza/platform/defaults'
<PlatformMap viewState={viewState} onMove={onMove} mapStyles={MAP_STYLES} mapStyleKey="dark">
<WeatherLayers handler="demand" showHud />
</PlatformMap>- Auth route /
PLATFORM_API_KEYunchanged. Providersmoves insideWeatherLayers— do not wrapPlatformMapin an outerProvidersas well.- Feature layers that need the MapLibre instance use
usePlatformMap()(returns{ map, beforeId, … }). - Toggle weather on a feature map by mounting/unmounting
WeatherLayers(no models fetch when unmounted). - Old path remains supported; no forced upgrade.