JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html> 
<head> 
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
   <title>Google Maps API v3 Directions Example</title> 
   <script type="text/javascript" 
           src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head> 
<body style="font-family: Arial; font-size: 12px;"> 
   <div style="width: 600px;">
     <div id="map" style="width: 400px; height: 400px; float: left;"></div> 
     <div id="panel" style="width: 100px; float: right;"></div> 
   </div>
       <script type="text/javascript"> 
       </script>
</body> 
</html>

JavaScript

var rendererOptions = {
    draggable: true
};
     var directionsService = new google.maps.DirectionsService();

     
     var directionsDisplay = new google.maps.DirectionsRenderer();

     var map = new google.maps.Map(document.getElementById('map'), {
       zoom:7,
       mapTypeId: google.maps.MapTypeId.ROADMAP
     });

     directionsDisplay.setMap(map);

     var request = {
       origin: 'Chicago', 
       destination: 'New York',
       travelMode: google.maps.DirectionsTravelMode.DRIVING
     };

     directionsService.route(request, function(response, status) {
       if (status == google.maps.DirectionsStatus.OK) {
         directionsDisplay.setDirections(response);
       }
     });
     
     google.maps.event.addListener(map, 'mousemove', function(event) {
          document.getElementById('panel').innerHTML =
             'Geographical Coordinates: ' + event.latLng.lat() + ', ' + event.latLng.lng();
      });