1.0.5 • Published 12 days ago

leaflet-d3-color-legend v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
12 days 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

12 days ago

1.0.4

12 days ago

1.0.3

12 days ago

1.0.2

19 days ago

1.0.1

19 days ago

1.0.0

20 days ago