title: How to set a default value for a Google places API auto complete textbox
body: <p>I'm working on a page close enough to the one in google samples <a href="https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform" rel="noreferrer">https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform</a> and it works fine. </p>
  
  <p>However I need to add one more feature is to set the value of the autocomplete by default to be the current user city.</p>
  
  <p>I'm using the following code to get the city and the country of the logged in user using geolocation API in HTML5. However the challenge is to make the autocomplete accept this value as it's default value. When I try to put the value in the textbox directly the autocomplete consider it as a wrong value.</p>
  
  <pre><code>navigator.geolocation.getCurrentPosition(function(pos) {
     var currentLocation = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
     var geocoder = new google.maps.Geocoder();
     var city = "";
     var country = "";
     geocoder.geocode({'latLng': currentLocation}, function(results, status, from) {
        if (status == google.maps.GeocoderStatus.OK) {
           if (results[1]) {
              for (var i = 0; i &lt; results[0].address_components.length; i++) {
                 for (var b = 0; b &lt; results[0].address_components[i].types.length; b++) {
                    if (results[0].address_components[i].types[b] == "administrative_area_level_1") {
                       city = results[0].address_components[i];
                       break;
                    }
                    if (results[0].address_components[i].types[b] == "country") {
                       country = results[0].address_components[i];
                       break;
                    }
                 }
              }
              var fromDefault = city.long_name + " - " + country.long_name;
              $('#address-from').val(fromDefault);
           }
        }
     });
  }, 
  function(error) {                    
     alert('Unable to get location: ' + error.message);
  }, options);
  </code></pre>
  
  <p>Any idea how to manually fill in the default value for the autocomplete places textbox?</p>