[Solved] A toggle button on and off for markers in google maps react
As you already have handleToggle1 function setting the isMarkerVisible flag then on render() you can have this: render() { const markers = this.state.isMarkerVisible ? this.props.policeCall : [] … <your code> return <div> … <your code> {markers.map(({ A, B, M, N, L,O }) => { return ( <Marker onClick={this.onMarkerClick} name={A} info={B} priority={L} position={{ lat: M, lng: … Read more