score:0

constructor( props ){
    super( props );
    this.codeAddress = this.codeAddress.bind(this);
  }

score:0

const setCurrentOnMarkerClick = (function() { 
        this.setState({current: 'City Y'});

            

              setTimeout(() => {
                var pointA = new google.maps.LatLng(54.976713, -1.60728);

                

                var request = {
                  origin: pointA,
                  destination: location,
                  travelMode: 'DRIVING'
                };
                directionsService.route(request, function (result, status) {
                  if (status == 'OK') {
                    directionsRenderer.setDirections(result);
                  }
                });


              }, 2000)
            });          
    }).bind(this);

 marker.addListener("click", setCurrentOnMarkerClick)

Related Query

More Query from same tag