1
vote
1answer
24 views

2 Legends in Leaflet

In Leaflet I want to add a legend when I turn on an overlay, then when I turn off that overlay I want the legend to disappear and when I turn on a second overlay I want a second legend to appear. I ...
0
votes
0answers
7 views

Restrict legend to map bounds in CartoDB.js

Does anyone know how to restrict legend content based on map bounds in CartoDB.js? I am building a large, complicated legend and I would like it to only display visible features to reduce complexity. ...
2
votes
2answers
68 views

How to generate legend in leaflet webmap?

Although I have checked the "Create Legend" option in the qgis2leaf plugin, it did not generate any legend in the output webmap. What am I missing here ?
0
votes
0answers
120 views

How to create dynamic legend for multiply layers with leaflet.js?

I want to create multiple choropleth maps which displays different statistical data with leaflet.js. So it would be nice to show different legends for each map. I create such legends for two layers ...
3
votes
1answer
469 views

Leaflet add and remove legends with layer selection

I'm new to Leaflet/Javascript and have been struggling to get legends a map to show only when a specific layer is selected from the layer control. I have three layers, one of which I would like to ...
3
votes
1answer
229 views

How to create leaflet legend for points

I have points like this in a leaflet map. The points come originally from a GeoJSON file and I used L.circleMarker to convert them to circles. How can I create a legend for these points? Based on ...
0
votes
0answers
95 views

How to add Esri legends for basemap within Leaflet JS?

I have a map with the Esri REST population density basemap. I also have 5 geoJSON layers with a legend. What is a method to display the Esri legend when my geoJSON layers are turned off and my ...
1
vote
1answer
353 views

Leaflet Legend fixed image? not SLD?

I have a style pulled from my GeoServer and have created a basic legend, with a fixed PNG. However I was wondering if it is possible to have this legend be pulled from the layers SLD? so that if the ...
7
votes
1answer
7k views

How to Add/Remove Legend with Leaflet Layers Control?

I have two overlays http://02d0c8c.netsolhost.com/dev/lcb_census_layers3.html that can be turned on and off with a Layer Control. I’d like the legend for each layer to turn on/off along with the ...