<commit_before>const {Map, Marker, CircleMarker, Popup, TileLayer, MapLayer}  = window.ReactLeaflet

class MapView extends React.Component {
  render(){
    const chips = this.props.person
    const providers = this.props.providers
    const providerElements = _.map(providers, function(p,i){
      var latlong = [p.lat , p.long]
      console.log(latlong)
      return <Marker position = {latlong} key={i}>
        <Popup>
          <span>{JSON.stringify(p)}</span>
        </Popup>
      </Marker>

    })


    let userElement
    if (this.props.user){
      userElement = <CircleMarker center={this.props.latlong}/>
    } else {
      userElement = ''
    }

    // Note: .bind(this) is important for the handler function's 'this'
    // pointer to refer to this MapView instance

    return  <Map center={this.props.center}
          zoom={14}
          onLeafletClick={this.handleLeafletClick.bind(this)}>
        <TileLayer
          url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
          attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
        />
        {providerElements}
        {userElement}
      </Map>
  }


  handleLeafletClick(event){
    console.log('leaflet click event', event)
    this.props.setUserLocationAction(event.latlng)
  }
}

MyComponents.MapView = MapView<commit_msg>Made it so that only the true chip is showing<commit_after>const {Map, Marker, CircleMarker, Popup, TileLayer, MapLayer}  = window.ReactLeaflet

class MapView extends React.Component {
  render(){
    const providers = this.props.providers
    const providerElements = _.map(providers, function(p,i){
      var latlong = [p.lat , p.long]
      console.log(latlong)
      if (p.active == true){
      return <Marker position = {latlong} key={i}>
        <Popup>
          <span><h1>{providers.key}</h1> {JSON.stringify(p)} </span>
        </Popup>
      </Marker>
      }
      else {
        return null
         }
    })
  


    let userElement
    if (this.props.user){
      userElement = <CircleMarker center={this.props.user.pos}/>
    } else {
      userElement = ''
    }


    // Note: .bind(this) is important for the handler function's 'this'
    // pointer to refer to this MapView instance

    return  <Map center={this.props.center}
          zoom={14}
          onLeafletClick={this.handleLeafletClick.bind(this)}>
        <TileLayer
          url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
          attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
        />
        {providerElements}
        {userElement}
      </Map>
  }


  handleLeafletClick(event){
    console.log('leaflet click event', event)
    this.props.setUserLocationAction(event.latlng)

  }
}

MyComponents.MapView = MapView
{'fraction_non_alphanumeric': 0.13757183908045978, 'fraction_numerical': 0.0021551724137931034, 'mean_word_length': 2.5477707006369426, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2220098', 'n_tokens_mistral': 899, 'n_tokens_neox': 880, 'n_words': 181}