Hi there,
You will need to load the external script as well. You could add the code to your Child Themeās functions.php :
function custom_google_map() { ?>
echo '<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">';
<?php }
add_action( 'wp_footer', 'custom_google_map' );
Now add the plain JavaScript within Custom JS and add the necessary HTML with proper ID as described there.
Cheers!