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.


enter image description here

Any suggestions?

closed as off-topic by PolyGeo Jul 16 '15 at 9:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to GIS SE! To assist potential answerers to help you I would recommend always including your code snippets as text rather than pictures. The format {} button makes this easy to do. – PolyGeo Nov 13 '14 at 3:39
  • this is a known bug: github.com/CartoDB/cartodb.js/issues/75 – javisantana Nov 14 '14 at 7:50
  • Looks like it's working now, right? – Jorge Arévalo Jan 20 '15 at 17:30

This was caused by a bug as @Javi Santana says in the comments, but it's been fixed already and your map seems to be behaving as expected :-)

Not the answer you're looking for? Browse other questions tagged or ask your own question.