title: How to restrict the geocode request of the Google Geocoding API to return only cities and zips in a certain country
body: <p>I want to build a map with a search input. The user should be able to search for zip or city with that input. This appears not so be well documented in the <a href="https://developers.google.com/maps/documentation/geocoding/" rel="noreferrer">Google Geocoding API</a> or in the Javascript API reference for the <a href="https://developers.google.com/maps/documentation/javascript/reference?hl=sv-se&amp;csw=1#Geocoder" rel="noreferrer">Geocoder</a>.</p>
  
  <p>I tried to use the geocode function as follows:</p>
  
  <pre><code>geocode({ address: inputValue })
  </code></pre>
  
  <p>but this will give results in the whole world.</p>
  
  <p>Then I used the region and the bounds:</p>
  
  <pre><code>geocode({ address: this.value, region: 'XX', bounds: myCountryBounds })
  </code></pre>
  
  <p>This will still give results from the entire world. (I read on one of the documentation pages that the <code>region</code> and <code>bounds</code> are only informative and not strict restrictions, but I cannot find the page anymore.)</p>
  
  <p>Then I used only <code>componentRestrictions</code>:</p>
  
  <pre><code>geocode({ address: this.value, componentRestrictions: { country: 'XX' })
  </code></pre>
  
  <p>This now gives me only results in country <code>XX</code>. But it also gives me street and company names.</p>
  
  <p>Now I want the search only to match zips and cities. Because if I search for <code>2000</code> I find lots of company names that have <code>2000</code> in their names. So how can I make sure the search is only performed in zips and city names?</p>