1.0.5 • Published 1 year ago

leaflet-d3-color-legend v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Leaflet d3 Color Legend

A leaflet plugin that extends L.Control and adds a color legend to the map.

Example

var map = L.map('map');

var cScale = d3.scaleSequential([0, 100], d3.interpolateBlues);

var legend = new L.Control.ColorLegend({
    position: "topright",
    colorScale: cScale,
    label: "Scale"
  });
  legend.addTo(map);

Example Image

Options

OptionTypeDefaultDescription
positionString'topright'Inherited from L.Control
colorScalea d3 scale-The colorScale from d3. It should accept a number or string as input and return a color.
labelString''A label that is placed under the colormap
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago