title: searchBox Google Maps with pagination
body: <p>So what I am trying to do is implement Google Maps with a search box. Currently, the search box retrieves 20 of the top places based on the search result.</p>
  
  <p>What I noticed is there is no pagination with this. Such as if I type in “pizza”, it will give me the top 20 results in the current location bounds. But when I use the <code>google.maps.places.PlacesService(map)</code> textSearch function to obtain a list of pizza searches, I get more than 20 results with pagination.</p>
  
  <p>Is there a way to get pagination on your searchBox or use the textSearch function to provide pagination after you used searchBox?</p>
  
  <p>What I have here is a snippet:</p>
  
  <pre class="lang-js prettyprint-override"><code>var canvas = element.find('div')[0];
  var mapOptions = {
      zoom: 5,
      minZoom: 2,
  };
  var searchBox = new google.maps.places.SearchBox('pizza');
  var placeService = new google.maps.places.PlacesService(map);
  
  google.maps.event.addListener(searchBox, 'places_changed', locationChange);
  
  function locationChange() {
      var places = searchBox.getPlaces();
      //Determine if there are additional places not provided by searchbox. Using text 
      var request = {
          query: input.value,
      };
      var textSearchPlaces = placeService.textSearch(request, callback);
      function callback(results, status, pagination) {
          if (status == google.maps.places.PlacesServiceStatus.OK) {
              var hi = places;
              for (var i = 0; i &lt; results.length; i++) {
                  var place = results[i];
              }
          }
      }
      if (places.length === 0) {
          return;
      }
  };
  </code></pre>
  
  <p>As you can see this is not the most ideal solution to looking using a pagination as I would have to filter through the textSearchPlaces to see if those places are not duplicates of the searchBox results.</p>
  
  <p>I also thought about just removing the searchBox and just going with the textSearch function but I realized I wouldn’t have the autoComplete function that provides suggestions that searchBox provides. </p>