I used the CartoDB layer selector example (http://cartodb.github.io/cartodb.js/examples/layer_selector.html) with my data. Works fine. Now, what I really want to do is to select data from 2 layers at the same time - not from only one as it is the case now.
The second layer I want to select from is subLayer(3) and the sql would be the same as the first one: "select * from all_lachine2014_post where eventdist = " + event;
(the subLayer(3) table name is all_lachine2014_post)
I have tried a few things - but can't figure out how to create a second selector and have the sql combined to select from my two tables at the same time.
Layer selector example | CartoDB.js html, body, #map { height: 100%; padding: 0; margin: 0; } #layer_selector { position: absolute; top: 170px; right: 20px; padding: 0; } #layer_selector ul { padding: 0; margin: 0; list-style-type: none; } #layer_selector li { border-bottom: 1px solid #999; padding: 12px 22px; font-family: "Helvetica", Arial; font-size: 12px; color: #444; cursor: auto; } #layer_selector li:hover { background-color: #F0F0F0; cursor: pointer; } #layer_selector li.selected { background-color: #EEE; }
أكثر...
The second layer I want to select from is subLayer(3) and the sql would be the same as the first one: "select * from all_lachine2014_post where eventdist = " + event;
(the subLayer(3) table name is all_lachine2014_post)
I have tried a few things - but can't figure out how to create a second selector and have the sql combined to select from my two tables at the same time.
Layer selector example | CartoDB.js html, body, #map { height: 100%; padding: 0; margin: 0; } #layer_selector { position: absolute; top: 170px; right: 20px; padding: 0; } #layer_selector ul { padding: 0; margin: 0; list-style-type: none; } #layer_selector li { border-bottom: 1px solid #999; padding: 12px 22px; font-family: "Helvetica", Arial; font-size: 12px; color: #444; cursor: auto; } #layer_selector li:hover { background-color: #F0F0F0; cursor: pointer; } #layer_selector li.selected { background-color: #EEE; }
- Parcours 21.1 km
- Parcours 10 km
- Parcours 5 km
- Parcours 1 et 2 km
أكثر...