I am trying to set the interactivity on a sublayer that I created on CartoDB web interface so that my events and tooltips receive the correct fields as arguments of the callback functions. Here is how I have tried to do this:
layers.setInteraction(true) poverty_layer = layers.getSubLayer(0) poverty_layer.set("interactivity", ["cartodb_id, namelsad10, hh_median"]) poverty_layer.on "featureOver", (e,ll,pos,data)-> console.log data
I assumed that by doing this I would see three data fields –– cartodb_id, namelsad10, and hh_median –– but I only see cartodb_id. I already managed to set interactivity successfully on sublayers that are created on the clientside. This is the one use case where it hasn't been successful.