Heatmap

Visualize data density and intensity with a smooth color gradient heatmap.

Use MapHeatmap to render a density heatmap from an array of weighted points or a GeoJSON FeatureCollection<Point>. It uses AMap's built-in AMap.HeatMap plugin.

Performance: The heatmap is rendered natively by AMap and handles large datasets efficiently. For best results keep the data array stable (memoized) to avoid unnecessary re-renders.

Example

Simulated activity density across Beijing. Warmer colors indicate higher density.

MapHeatmap

Renders a heatmap overlay. Must be used inside Map.

PropTypeDefaultDescription
dataHeatmapPoint[] | GeoJSON.FeatureCollection<Point>Array of { lng, lat, count? } points, or a GeoJSON FeatureCollection<Point> (reads properties.count or properties.weight).
radiusnumber30Influence radius per point in pixels.
opacitynumber0.8Maximum opacity of the heatmap (0 to 1).
gradientRecord<string, string>Color gradient where keys are 0-1 positions. Defaults to blue → cyan → green → yellow → red.
maxnumber100Maximum count value used to normalize intensity.