Using ID's to create a URL

Using ID's to create a URL

This snippet logs ID's from span element into the console.

Can someone help me with which method(s) will format my ID's into a string separated by /?

My goal is to append one URL with that string. I've been messing around with many variations, and I'm able to append a URL, but it logs each ID as a separate URL. For example, the ID's are latitude and longitude. If there are two ID's logged to the console, it displays twice..
https://www.google.com/maps/dir/Current+Location/LATLONG
https://www.google.com/maps/dir/Current+Location/LATLONG

How do I get it to one instance of URL and append LATLONG string?
https://www.google.com/maps/dir/Current+Location/LATLONG/LATLONG/

  1. function getPubs() {
      var dirURL = "https://www.google.com/maps/dir/Current+Location/";

      $('#map_pub').click(function(e) {
          e.preventDefault();
      $("#pub_list span").each(function( index ) {
          console.log(dirURL + $(this).attr('id') + "/");
    });
    });
    }