Geometries playground

Display multiple geographic geometries with different configurations

View on GitHub
SDK 1.0.0

Pick a region set and each subdivision comes back shaded from that set’s own colours. Swap in another palette, or switch the palette mode between taking the colours in turn and ramping through them. Pick a layer position and the set slides up or down the base map’s stack.

  • geometryData takes the geocode response itself as its input, and GeometriesModule.show draws the polygons it returns with no source or layer of your own.
  • applyConfig takes a list of CSS colours as fill.palette and hands them to the features in turn, so you never assign a colour per feature. With fill.paletteMode set to 'ramp', as Chicago’s postcodes start, they blend instead: two colours shade every postcode between them, and a middle colour is a stop the ramp passes through.
  • updateConfig with a beforeLayerConfig re-seats the geometry layers under roads, labels or buildings without re-fetching or re-showing anything.

Related examples