3

With Cartodb, is it possible to show the filter options on the embedded map?

The explain, I have generated a visualisation and have shared, but I want people accessing the visualisation to be able to filter the results.

1

The most common way to do this is by using CartoDB.js, the JavaScript library to build your own application. This lesson shows how to do it.

If you don't want to do JavaScript, you can create a multilayer map with each each layer being from the same original data table but with a different query applied to each. I made this map, by starting with one dataset and then clicking "add layer" and selecting the same dataset again. Once there are two layers, I applied different SQL to them. For example, something like this:

1st one: SELECT * FROM table_name WHERE var > 10

2nd one: SELECT * FROM table_name WHERE var <= 10

After that, you can turn on "layer selector":

enter image description here

Finally, you can toggle the layers in the upper right once the layer selector is toggled on:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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