anchor.diff:            window.alert('Directions request failed due to ' + status)
           }
         });
  +
  +//calc distance within route
  +    var service = new google.maps.DistanceMatrixService();
  +    service.getDistanceMatrix(
  +      {
  +       origins: [document.getElementById("address1").value],
  +        destinations: [document.getElementById("address2").value],
  +        travelMode: google.maps.TravelMode.DRIVING
  +      }, callback);
  +
  +    function callback(response, status) {
  +      if (status == google.maps.DistanceMatrixStatus.OK) {
  +        var origins = response.originAddresses;
  +        var destinations = response.destinationAddresses;
  +
  +        for (var i = 0; i < origins.length; i++) {
  +          var results = response.rows[i].elements;
  +          for (var j = 0; j < results.length; j++) {
  +            var element = results[j];
  +            var distance = element.distance.text; //distance between address1 and address2
  +            var duration = element.duration.text; //duration of time between address1 and address2
  +            var from = origins[i];
  +            var to = destinations[j];
  +          }
  +        }
  +      }
       }
  +  }
       var onChangeHandler = function() {
         calculateAndDisplayRoute(directionsService, directionsDisplay);
           };
   
       document.getElementById('address_submit').addEventListener('click', onChangeHandler);
  -
  -
   
     }
   
  
positive.code: 
  // Assigns an info window to every marker
  
    function handleSearchResults(results, status){
      for(var i = 0; i < results.length; i++) {
        var marker1 = new google.maps.Marker({
          position: results[i].geometry.location,
          map: map,
        });
        var infoWindow = new google.maps.InfoWindow({
          content: JSON.stringify(results[i].rating)
        });
        google.maps.event.addListener(marker1, 'click', function(){
          infoWindow.open(map, this)
        })
      }
    }
  
  // Searches for the specific name within the bounds of the screen
    function performSearch(){
      var request = {
        bounds: map.getBounds(),
        name: "Bar"
      }
      activity.nearbySearch(request, handleSearchResults);
    }
  //Runs all this functions during on initialization
    function initialize(location){
  
  
negative.code:       map: map
      });
  
  //***this is for the search of activity. Uncomment to have search markers show on map***
      // activity = new google.maps.places.PlacesService(map);
      // google.maps.event.addListenerOnce(map, 'bounds_changed', performSearch)
  
  //Directions And Route Creation
      var directionsService = new google.maps.DirectionsService;
  