How can I add alt/title text into my JavaScript

Wondering if anyone can help.

We are in the process of completing an accessibility audit on our website.

One of the things axe DevTools has identified is that on the google map, the little icons next to the map destinations are missing ARIA accessible names.

I have taken a look into the code onto this page, but I can’t work out how I would a title/alt text to the icon to pass this issue.

This is the page I am working on – https://www.knowsleycollege.ac.uk/contact/ and this is the code used:

 <script>

    var locations = [
      ['<h4>Main Campus, Stockbridge Lane</h4>', 53.428737, -2.8593184],
      ['<h4>Kirkby Campus</h4>', 53.4810983, -2.8934299],
      ['<h4>Main Campus, Institute of Advanced Manufacturing and Technology</h4>', 53.423517, -2.861301]
    ];
    
    // Setup the different icons and shadows
    var iconURLPrefix = '<?php echo get_bloginfo('template_directory');?>/images/icons/';
    
    var icons = [
      iconURLPrefix + 'main-campus.png',
      iconURLPrefix + 'kirkby.png',
      iconURLPrefix + 'iamt.png'
    ]

    var iconsLength = icons.length;

    var map = new google.maps.Map(document.getElementById('map'), {
                    zoom: 16,
                center: new google.maps.LatLng(53.4287376, -2.8593184),
          mapTypeId: 'terrain',
          navigationControl: false,
                mapTypeControl: false,
                scaleControl: false,
                scrollwheel: false
    });

    var infowindow = new google.maps.InfoWindow({
      maxWidth: 400
    });

    var markers = new Array();
    
    var iconCounter = 0;
    
    // Add the markers and infowindows to the map
    for (var i = 0; i < locations.length; i++) {  
      var marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][1], locations[i][2]),
        map: map,
        icon: icons[iconCounter]
      });

      markers.push(marker);

      google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
          infowindow.setContent(locations[i][0]);
          infowindow.open(map, marker);
        }
      })(marker, i));
      
      iconCounter++;
      // We only have a limited number of possible icon colors, so we may have to restart the counter
      if(iconCounter >= iconsLength) {
        iconCounter = 0;
      }
    }
    
    
    </script>

Any help will be very much appreciated.

Thanks
Sam