function createMapMarker(placeData) {

        // The next lines save location data from the search result object to local variables
        var lat = placeData.geometry.location.lat();  // latitude from the place service
        var lon = placeData.geometry.location.lng();  // longitude from the place service
        var name = placeData.name;   // name of the place from the place service
        var bounds = window.mapBounds;            // current boundaries of the map window

        // marker is an object with additional data about the pin for a single location
        var marker = new google.maps.Marker({
            map: map,
            position: placeData.geometry.location,
            // changing the original icon map
            icon: './images/mapa.png'
        });
        
        // the content inside the windows that opens when we click the markers in the map
        var contentString = '<div id="content"><div id="siteNotice"></div>' +
        '<h1 id="firstHeading" class="firstHeading">' + name + '</h1>' +        
        '</div>';

        // infoWindows are the little helper windows that open when you click or hover over a pin on a map.
        // They usually contain more information about a location.
        var infoWindow = new google.maps.InfoWindow({
            // Here to put the info that will show up in the windows
            content: contentString
        });

        // hmmmm, I wonder what this is about...
        google.maps.event.addListener(marker, 'click', function () {
            infoWindow.open(map, marker);
        });

        // this is where the pin actually gets added to the map.
        // bounds.extend() takes in a map location object
        bounds.extend(new google.maps.LatLng(lat, lon));
        // fit the map to the new marker
        map.fitBounds(bounds);
        // center the map
        map.setCenter(bounds.getCenter());
    }
/*
    createMapMarker(placeData) reads Google Places search results to create map pins.
    placeData is the object returned from search results containing information about a single location.
    */
createMapMarker(placeData) reads Google Places search results to create map pins.
placeData is the object returned from search results containing information about a single location.
createMapMarker ( placeData ) reads Google Places search results to create map pins . placeData is the object returned from search results containing information about a single location .
function createMapMarker(placeData) {
        var lat = placeData.geometry.location.lat();  
        var lon = placeData.geometry.location.lng();  
        var name = placeData.name;   
        var bounds = window.mapBounds;            
        var marker = new google.maps.Marker({
            map: map,
            position: placeData.geometry.location,
            icon: './images/mapa.png'
        });
        var contentString = '<div id="content"><div id="siteNotice"></div>' +
        '<h1 id="firstHeading" class="firstHeading">' + name + '</h1>' +        
        '</div>';
        var infoWindow = new google.maps.InfoWindow({
            content: contentString
        });
        google.maps.event.addListener(marker, 'click', function () {
            infoWindow.open(map, marker);
        });
        bounds.extend(new google.maps.LatLng(lat, lon));
        map.fitBounds(bounds);
        map.setCenter(bounds.getCenter());
    }
function createMapMarker ( placeData ) { var lat = placeData . geometry . location . lat ( ) ; var lon = placeData . geometry . location . lng ( ) ; var name = placeData . name ; var bounds = window . mapBounds ; var marker = new google . maps . Marker ( { map : map , position : placeData . geometry . location , icon : './images/mapa.png' } ) ; var contentString = '<div id="content"><div id="siteNotice"></div>' + '<h1 id="firstHeading" class="firstHeading">' + name + '</h1>' + '</div>' ; var infoWindow = new google . maps . InfoWindow ( { content : contentString } ) ; google . maps . event . addListener ( marker , 'click' , function ( ) { infoWindow . open ( map , marker ) ; } ) ; bounds . extend ( new google . maps . LatLng ( lat , lon ) ) ; map . fitBounds ( bounds ) ; map . setCenter ( bounds . getCenter ( ) ) ; }
createMapMarker(placeData) reads Google Places search results to create map pins.
createMapMarker ( placeData ) reads Google Places search results to create map pins .
// The next lines save location data from the search result object to local variables // latitude from the place service // longitude from the place service // name of the place from the place service // current boundaries of the map window // marker is an object with additional data about the pin for a single location // changing the original icon map // the content inside the windows that opens when we click the markers in the map // infoWindows are the little helper windows that open when you click or hover over a pin on a map. // They usually contain more information about a location. // Here to put the info that will show up in the windows // hmmmm, I wonder what this is about... // this is where the pin actually gets added to the map. // bounds.extend() takes in a map location object // fit the map to the new marker // center the map