src/sidebar/Layers.js
// helper function that returns selected layer.
helper function that returns selected layer.
helper function that returns selected layer .
function updateSelected(){
  var selected_key= ($('li.active').attr('id'));
  for (var i = 0; i < this.state.layer_list.length; i++) {
    if (selected_key == this.state.layer_list[i][1]){
      var layer_position = i
    }
  }
  var geojson_file_name = this.state.layer_list[layer_position][0]
  this.setState({
    selected_layer: geojson_file_name
  })
}
function updateSelected ( ) { var selected_key = ( $ ( 'li.active' ) . attr ( 'id' ) ) ; for ( var i = 0 ; i < this . state . layer_list . length ; i ++ ) { if ( selected_key == this . state . layer_list [ i ] [ 1 ] ) { var layer_position = i } } var geojson_file_name = this . state . layer_list [ layer_position ] [ 0 ] this . setState ( { selected_layer : geojson_file_name } ) }
helper function that returns selected layer.
helper function that returns selected layer .