Skip to main content
100%

leaflet example

✓ Published0🌍 Public
EEE2dev
Last edited Sep 17, 2018
Created on Sep 17, 2018

This example shows multiple datasets overlaid as circles on an interactive Leaflet map, with each dataset visualized using a different scale type. It uses the Leaflet library for map tiles and layers, while D3 v5 parses CSV data embedded in `<aside>` elements and binds it to SVG circle markers. The code assigns numerical or categorical attributes to color scales (threshold, quantize, or ordinal) and renders a legend for each group. Map layers for streets, satellite, and grayscale are togglable, and tooltips display an optional address attribute from the data.

AI-generated description
  //////////////////////////////////////////////////////////////////
  // Usage:
  //
  // data: csv file with 
  //  long, lat for position
  //  one numerical or categorical attribute to be visualized
  //  + (optional) one attribute calles "address" to be shown in tooltip
  // 
  // 1. set class of <aside> element above to match the name of the data
  // 2. insert data into aside element
  // 3. specify the following dp (data parameters) 
  // 4. initialize map center with [lat, long]
  // 
  // options for scales:
  // "scaleThreshold", "scaleOrdinal", "scaleOrdinal" or "scaleQuantile"
  //////////////////////////////////////////////////////////////////

Built with blockbuilder.org

mit Licensed

Similar vizzes