Closed Goernado closed 5 years ago
Hello @Goernado!
The layer selector doesn't work because you are retrieving data
property from the wrong node. Whenever you click on those selectors, you retrieve data
property from event target, which is not your <li>
element but the span beneath.
So, to make it work properly you need to set $li
as $(this)
:
var $li = $(this);
Apart from that, retailer
property is not defined within your code, so if you want it to work you will need to set it to some value.
I noticed that the SQL query is malformed as well, it should be like:
SELECT * FROM test_1_copy WHERE handler_id = {{country}}
I hope this helps you to fix your errors if it's not too late.
Context
I would like to create a layer selector, so that you can choose what kind of data should be shown. It is a carto torque map. The layer ist working properly. But the data selector is not working fine. If you click, there is nothing happening.
Current Result
Can somebody help me? What is wrong with the code? Thanks in advance.