My map visualization has two layers:

1) A city layer where the cities are represented as standard markers.

2) A county layer underlying the cities which has county level aggregate data. The layer is a choropleth.


Can we get mouseover and / or mouseclick events working on both layers simultaneously?

I need to be able to click/hover a city or a county and get the popup data response. (and probably highlight the county polygon)

At this point I can access one or the other depending on their order in the vis. After looking around a bit it looks like at least at some point this was handled by a variety of workarounds.

I was hoping to get it going somewhat automagically. If not, is this template the "right" way of doing it? I could stuff all the data into one table but that feels like it will make more complication. Users will be entering new marker points into the DB and it would be preferable to keep that data on its own.


  • Not sure about The Right Way™ but Keller's template works quite well for exactly what you're describing.
    – Amanda
    Feb 5, 2014 at 21:15

1 Answer 1


Yep, mhkeller's way is great. Here is another example with minor variation from the lead developer of cartodb.js


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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