0

Looking to get just the "city" return value from reverse geocoding in the Google Maps API to insert via a variable into a form. I've looked at the documentation but it doesn't appear to offer a means or example of just getting this value (or any specific value) from this that can then be inserted into a form field in this manner.

Any ideas on the best way to do this? Thanks.

Why Not
  • 603
  • 3
  • 14
  • 25
  • This looks like a duplicate of: http://stackoverflow.com/questions/6359995/get-city-from-geocoder-results – andresf Jun 14 '12 at 03:51
  • I'm not looking for an array; just a variable containing the city info I can automatically insert into a form. I already have the map displayed and don't need a marker or other info. – Why Not Jun 14 '12 at 04:09
  • 1
    You're missing the point. There is no built-in variable. However, you can parse the response from the geocoding service and only grab what you need: in this case the city. Once you parse the response, get the city, then you can use JS to set the form field value accordingly. – andresf Jun 14 '12 at 04:25

0 Answers0