Heatmap

Heatmap layers visualize point density as a smooth gradient. Great for showing concentrations in large datasets — earthquakes, crime reports, traffic incidents.

Usage

{
  "layers": {
    "quake-heat": {
      "type": "heatmap",
      "data": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson",
      "weight": "mag",
      "radius": 25,
      "intensity": 1.5,
      "palette": "Sunset"
    }
  }
}

Properties

PropertyTypeDefaultDescription
type"heatmap"Required
datastring | objectGeoJSON URL or inline GeoJSON (must contain Point features)
weightstringequal weightFeature property to use as point weight (e.g. "mag")
radiusnumber30Pixel radius of influence per point
intensitynumber1Intensity multiplier — increase for sparse data
opacitynumber0.8Layer opacity (0–1)
palettestring"OrYel"CartoColor palette for the color ramp

Weight

The weight property maps a numeric feature attribute to the heatmap intensity. Points with higher values contribute more to the density.

{
  "type": "heatmap",
  "data": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson",
  "weight": "mag"
}

Without weight, all points contribute equally.

Radius and Intensity

  • radius — how far each point's influence spreads in pixels. Larger values produce smoother, more blurred results.
  • intensity — a multiplier on the density calculation. Increase this for sparse datasets to make the heatmap more visible.
{
  "type": "heatmap",
  "data": "https://example.com/incidents.geojson",
  "radius": 40,
  "intensity": 2
}

Palette

Any CartoColor sequential palette works well. Good choices for heatmaps:

  • "OrYel" (default) — orange to yellow
  • "Sunset" — blue through red to yellow
  • "Burg" — light to dark burgundy
  • "RedOr" — red to orange
  • "Teal" — light to dark teal
{
  "type": "heatmap",
  "data": "https://example.com/points.geojson",
  "palette": "Burg"
}

Tips

  • Heatmaps work best with Point geometry. Polygons and lines are ignored.
  • Use weight for meaningful density (e.g. earthquake magnitude, crime severity).
  • Increase intensity when your data is sparse — the default of 1 works well for datasets with thousands of points.
  • Heatmaps look best on dark basemaps.