title: Google Places API library use without map - javascript
body: <p>I need to get the closest establishments in 100m radius from specific coordinates.
  I found the Google Places API sample code, but I don't use a map in my application, since this results will be rendered in a list.
  Here is the API code:</p>
  
  <pre><code>var map;
  var infowindow;
  
  function initialize() {
    var pyrmont = new google.maps.LatLng(-33.8665433, 151.1956316);
  
    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();
    var service = new google.maps.places.PlacesService(map);
    service.nearbySearch(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
    });
  
    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(place.name);
      infowindow.open(map, this);
    });
  }
  
  google.maps.event.addDomListener(window, 'load', initialize);
  </code></pre>
  
  <p>Someone here has found that you can use a node to render the attribution into,
  but when I try ti render in it:</p>
  
  <pre><code>var $attrib = $('&lt;div id="attributions"&gt;&lt;/div&gt;');
  $('#main').append($attrib);
  ...
  service = new google.maps.places.PlacesService($attrib);
  service.nearbySearch(request, callback);
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>TypeError: this.j[Wb] is not a function
  </code></pre>
  
  <p>from somewhere deep inside the API library.
  I hope this is enough of information to figure the problem out</p>