venugopal24 / geo-autocomplete

Automatically exported from code.google.com/p/geo-autocomplete
0 stars 0 forks source link

Limit search to cities only, and display whole result #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, I love this plugin, it's ALMOST perfect for my needs.

I've been stuck on a couple small things and was hoping you could help me.

1. Is there a way to limit the search results to only show city names?
(example: if I type "cleveland", I'd like to see only "Cleveland, OH, USA",
and not "Hopkins International Airport, Cleveland, OH, USA" and other
landmarks)

2. Is there a way to change the output to the text field to show everything
and not just the city name?
(example: right now if I type "New Yo", it suggests "New York, New York,
USA", but when you select it the input field only gets "New York", I"d like
"New York, New York".

Thanks so much for any help!

Original issue reported on code.google.com by lowt...@gmail.com on 17 Mar 2010 at 12:56

GoogleCodeExporter commented 8 years ago
Also while I have your attention, is there any way to restrict it to english 
results
only? Thanks again :)

Original comment by lowt...@gmail.com on 17 Mar 2010 at 5:31

GoogleCodeExporter commented 8 years ago
I solved #2, so thought I'd share my work for other's in my shoes.

There is a piece of code in geo_autocomplete.js that looks like this:

_parsed.push({
    data: _result,
    value: _place,
    result: _place
                            });

replace the last line with the unchanged full formatted address, like such:

_parsed.push({
    data: _result,
    value: _place,
    result: _result.formatted_address
                            });

Original comment by lowt...@gmail.com on 17 Mar 2010 at 6:33

GoogleCodeExporter commented 8 years ago
marking s Done as this is supported in v2.1. keep those feature requests coming.

Original comment by hitch...@gmail.com on 21 Nov 2010 at 12:18