function pinPoster(locations) {

        // creates a Google place search service object. PlacesService does the work of actually searching for location data.
        var service = new google.maps.places.PlacesService(map);

        // Iterates through the array of locations, creates a search object for each location
        var lengthLocations = locations.length;
        for (var place = 0; place < lengthLocations; place++) {

            // the search request object
            var request = {
                query: locations[place]
            };

            // Actually searches the Google Maps API for location data and runs the callback function with the search results after each search.
            service.textSearch(request, callback);
        }
    }
// pinPoster(locations) takes in the array of locations created by locationFinder() and fires off Google place searches for each location
pinPoster(locations) takes in the array of locations created by locationFinder() and fires off Google place searches for each location
pinPoster ( locations ) takes in the array of locations created by locationFinder () and fires off Google place searches for each location
function pinPoster(locations) {
        var service = new google.maps.places.PlacesService(map);
        var lengthLocations = locations.length;
        for (var place = 0; place < lengthLocations; place++) {
            var request = {
                query: locations[place]
            };
            service.textSearch(request, callback);
        }
    }
function pinPoster ( locations ) { var service = new google . maps . places . PlacesService ( map ) ; var lengthLocations = locations . length ; for ( var place = 0 ; place < lengthLocations ; place ++ ) { var request = { query : locations [ place ] } ; service . textSearch ( request , callback ) ; } }
pinPoster(locations) takes in the array of locations created by locationFinder() and fires off Google place searches for each location
pinPoster ( locations ) takes in the array of locations created by locationFinder () and fires off Google place searches for each location
// creates a Google place search service object. PlacesService does the work of actually searching for location data. // Iterates through the array of locations, creates a search object for each location // the search request object // Actually searches the Google Maps API for location data and runs the callback function with the search results after each search.