Rosso69 / storelocator

Automatically exported from code.google.com/p/storelocator
0 stars 0 forks source link

Introduce autocomplete country restriction #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Great library, guys! It could however need a minor tweak to make it more locale 
friendly:

Many stores around the world have a strictly local customer base, including 
webshops only shipping within their home country. When a user starts typing in 
the storelocator autocomplete input field, they will get suggestions from all 
over the world. For addresses in small countries, such as the scandinavian 
ones, this can involve quite a bit of typing before you start hitting sensible 
suggestions for the autocompletion. This in turn leads to a bad user experience 
/ defeats the purpose of autocompletion.

google.maps.places.Autocomplete() supports options precisely for this purpose. 
Specifically; passing this as a second parameter to that method would allow 
restricting the suggestions to addresses within a given country:

var options = { componentRestrictions: {country: "country code"} };

(Where /contry code/ should be replaced with an ISO 3166 Alpha-2 country code, 
such as "us" for USA.)

It would be nice if you introduced a configuration option for setting it. At 
the moment we can't even override the init method, which appears to be private.

Original issue reported on code.google.com by sigve.h...@gmail.com on 4 Mar 2013 at 9:15

GoogleCodeExporter commented 8 years ago
On a related note: It wouldn't hurt if various strings such as "Directions", 
"Zoom here" and "Street view" as well as the texts for no stores/no stores in 
view could be easily overridden for translation either. At the moment it seems 
to be quite painful due to private/scope issues.

(We can always use additional JS to locate and replace these strings... but 
that's a bit dirty.)

Original comment by sigve.h...@gmail.com on 5 Mar 2013 at 1:08

GoogleCodeExporter commented 8 years ago
Would be grateful for a response on this. Thanks!

Original comment by sigve.h...@gmail.com on 25 Apr 2013 at 8:07

GoogleCodeExporter commented 8 years ago
I'm guessing this project is abandoned - but trying one last *bump* for the 
heck of it...

Original comment by sigve.h...@gmail.com on 25 Aug 2013 at 12:32