Bring Your Own Data: Median Price per Hexagon

Colour a city by the median asking price per square metre in each hexagon, aggregated from your own listings and drawn with the CustomGeoJSONModule.

View on GitHub
SDK 1.0.0-rc.7

Five thousand listings turn into a map of where Berlin is expensive, each cell coloured by the median price of the listings inside it.

  • aggregateIntoCells gives each hexagon or square its median, mean and count, so a cell of a few pricey flats colours as strongly as one of many cheap ones. minCount leaves cells of fewer than five listings empty.
  • The cells are plain polygons with the statistics as properties, so CustomGeoJSONModule colours them by ['get', 'median'].
  • A new cell size is one more aggregateIntoCells call, and gridOrigin keeps the cells in place.

Related examples