0

I need to parse my "M" and "N", inside my

return (
 <Map
   google={this.props.google}
   zoom={14}
   style={mapStyles}
   initialCenter={{
      lat: 32.71573699,
      lng: -117.16108799
   }}
 >
 {this.props.policeCall.map(({ A, M, N }) => {
    return (
      <Marker
        onClick={this.onMarkerClick}
        name={A}
        position={{ lat: M, lng: N }}
      />)             
  })}

 {this.props.policeCall.map(({  M, N }) => {
    return (
        <HeatMap
          gradient={gradient}
          opacity={3}
          positions={{lat: parseFloat(M), lng: parseFloat(N)}} // parse this part
          radius={30}
        />)
 })}
 <InfoWindow
   marker={this.state.activeMarker}
   visible={this.state.showingInfoWindow}
   onClose={this.onClose}
 >
   <div>
     <h4>{this.state.selectedPlace.name}</h4>
   </div>
 </InfoWindow>
 </Map>
);

How can i parse my and n ? my M and N are part of a big array, only calling keys m and n for my heatmap but parse them and use them as a floats for my positions. I am using Redux with react and passing data from a different .js file that has a huge array inside of it

k.s.
  • 2,964
  • 1
  • 25
  • 27
David Arriaga
  • 69
  • 2
  • 11

0 Answers0