I made this webpage with JavaScript and CartoDB.
The layer selector works like I expected it to but I noticed that the legend are stacking on top of each other and not being removed when the layer is changed. I tried a few different things but to no avail.
A few posts on the internet also relate to a possible bug in CartoDB that may be causing this. Anyone have experience with this?
If you open the map switch layers several times then examine the DOM you will see that the map.remove(); option is not totally clearing all elements of the layers for the previous selection.
Example:
Any suggestions?
{}
button makes this easy to do.