title: Google Maps (Reverse) Geocoding API should display only Cityname
body: <p>Im using the Google Maps GeolocationAPI to retrieve the Cityname of given Coordinates ( this is called reverse geolocation). Documentation is available <a href="https://developers.google.com/maps/documentation/geocoding/intro?hl=en#ReverseGeocoding" rel="nofollow noreferrer">here</a></p>
  
  <p>i send a post request with jquery and get a JSON formatted object at my script its this array: <code>locationName[]</code>. </p>
  
  <p>for some coordinates i have success displaying the city name using: </p>
  
  <pre><code>locationName[0].address_components[0].long_name;
  </code></pre>
  
  <p>but for some coordinates the city name is at</p>
  
  <pre><code>locationName[0].address_components[1].long_name;
  </code></pre>
  
  <p>or even at </p>
  
  <pre><code>locationName[0].address_components[3].long_name;
  </code></pre>
  
  <p>additionally i want to display the City district (if its available for the given coordinates if not then i only want to display the cityname)</p>
  
  <p>how can i determine which field in the array is the city name and how to determine if a city district is available and if so in which field it is ?</p>