I am writing a map with CartoDB, and I would like to connect a slider with a select layer.It is a slider of four points (2010-2011-2012-2013).I want to connect the result of slider with the correspond column of database: data_2010; data_2011; data_2012 and data_2013I am not sure if there is a function to do this, or if I have to use different layers in CartoDB, one to each data column.This is the code:
Time Slider | CartoDB.js html, body, #map { height: 100%; padding: 0; margin: 0; } #slider-range-max { position: absolute; bottom: 40px; right: 850px; left:110px; }
#legend { font-family: serif; font-size: 27px; position: absolute; bottom: 100px; left: 100px; } #legend2 { font-family: serif; font-size: 27px; position: absolute; bottom: 70px; left: 100px; }}
$(function() { $('#legend').html("Chile - Years") $('#legend2').html("" + 2010 + " --- " + 2011 + " --- " + 2012 + " --- " + 2013) $( "#slider-range-max" ).slider({ range: "max", min: 2010, max: 2013, value: 2010, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) ); });
أكثر...
Time Slider | CartoDB.js html, body, #map { height: 100%; padding: 0; margin: 0; } #slider-range-max { position: absolute; bottom: 40px; right: 850px; left:110px; }
#legend { font-family: serif; font-size: 27px; position: absolute; bottom: 100px; left: 100px; } #legend2 { font-family: serif; font-size: 27px; position: absolute; bottom: 70px; left: 100px; }}
$(function() { $('#legend').html("Chile - Years") $('#legend2').html("" + 2010 + " --- " + 2011 + " --- " + 2012 + " --- " + 2013) $( "#slider-range-max" ).slider({ range: "max", min: 2010, max: 2013, value: 2010, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) ); });
أكثر...