Bring Your Own Data: GeoJSON Heatmap with Custom Module

Render a custom GeoJSON heatmap and labeled symbol layer with the CustomGeoJSONModule, with style-change restore, hover and click events.

View on GitHub
SDK 1.0.0-rc.7

One fetched file drives two rendered layers at once: a density surface low in the stack and a labelled marker layer above it.

  • CustomGeoJSONModule.create takes a named source per dataset, and show with no source name feeds the one fetched collection to both.
  • images registers the canvas icon with the module rather than the style, so it survives a base map style change on its own.
  • events.markers scopes clicks and hovers to the marker source alone, leaving the density surface inert.
  • attribution.credits credits the dataset next to TomTom, and the credit stays through every style switch.

Related examples