title: Google Places API- Address and phone number?
body: <p>I'm trying to create a list and map via Google Places. The following displays makers and a list of local stores. Right now it only shows the name of the store. How would I include Address and Phone? Would I add another object specification?</p>
  
  <p>UPDATE: According to this link: <a href="https://stackoverflow.com/questions/9520808/google-places-api-places-detail-request-undefined">Google Places API - Places detail request undefined</a></p>
  
  <p>place.getDetails() should be added. However my script now only shows one market and not details. What is going on?</p>
  
  <p>UPDATE UPDATE:</p>
  
  <p>HTML example here: <a href="http://simplecomputerblog.com/searchtest1.html" rel="nofollow noreferrer">http://simplecomputerblog.com/searchtest1.html</a></p>
  
  <pre><code>  &lt;script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;libraries=places"&gt;&lt;/script&gt;
      &lt;script&gt;
  var map, placesList;
  var infowindow;
  var service; //declare globally
  
  
  function initialize() {
    var pyrmont = new google.maps.LatLng(40.062664, -83.069101);
  
    map = new google.maps.Map(document.getElementById('map-canvas'), {
      center: pyrmont,
      zoom: 15
    });
  
    var request = {
      location: pyrmont,
      radius: 500,
      types: ['store']
    };
    infowindow = new google.maps.InfoWindow();
     placesList = document.getElementById('places');
   service = new google.maps.places.PlacesService(map);
    service.nearbySearch(request, callback);
  service.getDetails(request, callback);
  
  }
  
  function callback(results, status) {
    if (status == google.maps.places.PlacesServiceStatus.OK) {
      for (var i = 0; i &lt; results.length; i++) {
        createMarker(results[i]);
      }
    }
  }
  
  function createMarker(place) {
    var placeLoc = place.geometry.location;
    var marker = new google.maps.Marker({
    map: map,
    position: place.geometry.location
   });
  
  var request = { reference: place.place_id };
  service.getDetails(request, function(details, status) {
    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(details.name + "&lt;br /&gt;" + details.formatted_address +"&lt;br /&gt;" + details.website + "&lt;br /&gt;" + details.rating + "&lt;br /&gt;" + details.formatted_phone_number);
      infowindow.open(map, this);
     });
   });
   placesList.innerHTML += '&lt;li&gt;' + place.name + '&lt;/li&gt;';
  }
  
  
  
  google.maps.event.addDomListener(window, 'load', initialize);
  
      &lt;/script&gt;
  </code></pre>