Monday 21 January 2019

carto - Can I do a toggle map view with multiple layers in the cartodb UI?


I have successfully created a toggle map following the instructions in this tutorial http://developers.cartodb.com/tutorials/toggle_map_view.html.


The toggle map is linked to a map in my cartodb account that has two layers in the UI - the first layer shows colored points in a choropleth view, the second layer shows a sort of cluster view so that I can have numbers appear where there are large clusters. I have have my buttons set up in the toggle map so that you can see points from different years - 2011, 2012, 2013, and 2014. When I click on a year, say 2011, all the points from the first layer (choropleth layer) that are from 2011 appear and all others disappear, so the buttons are selecting correctly for my first layer. But the buttons don't filter through any of the points in the second layer (the cluster layer with the numbers appearing for clusters). This is providing inaccurate numbers for my clusters when I'm clicking on different years. For example, in one area of the map, there are 37 points for all the years (so when all points are visible the cluster layer accurately says there are 37 points there). But when I select 2011, there are 0 points in that region for 2011, and it still says 37 on the cluster layer.


Is there a separate way to set up the toggle map so that it will interact with and select from all layers in my UI?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...