Traffic area analytics config playground

Configure traffic area analytics: 2D/3D mode toggle, custom color stops with color pickers

View on GitHub
SDK 1.0.0-rc.7

One Amsterdam traffic grid, fetched once, is recoloured, re-extruded and restacked from the panel alone.

  • TrafficAreaAnalyticsModule.show takes a single trafficAreaAnalytics response asked for with metrics: 'all', so no control below refetches.
  • setPalette and setColorStops scope a named palette or your own stops to one metric, so each metric keeps its own ramp. Stops win over the palette, and clearing them brings it back.
  • updateConfig with an activeMetric or a displayMode recolours and reshapes those same cells.
  • trafficAreaAnalyticsKnobCatalogue gives the selects their options, the height inputs their bounds and placeholders, and each metric the range its stops are bounded by.
  • setKnob sets each height input’s knob by id. The input refuses a height below 0, but one above its span still applies.
  • beforeLayerConfig places the grid against named entries in mapStyleLayerIDs, so “under the labels” is a constant, not a layer id you hunt for.

Related examples