shidhincr / LookAround

AngularJS Learning Playground ( with Twitter bootstrap, Google maps API, TDD using Karma runner )
MIT License
174 stars 149 forks source link

Support for searching using city/area name #3

Open shidhincr opened 10 years ago

shidhincr commented 10 years ago

As of now, we can search using only zip code. But Google supports searching by area/city names

dilip-borad commented 10 years ago

Yes but need restrict some small village area because it's doesn't shown anything.

I mean if someone is search for ATM's of small village that is far to some city and also this village not have any ATM that time the result will be 0(zero).

I think this is not a problem but we need to care about it. What you think?

shidhincr commented 10 years ago

Yeah .. The only problem is that the map doesn't show anything. But I guess we have to handle it in a better way.

Why I need to do this because most of the times I don't know the zip code, but know the area name. And note that, with the existing implementation, we can search using place names

Check this link

http://lookaround.herokuapp.com/app/index.html#/search/dubai/bicycle_store

The search query is "dubai" instead of pin code.

But you cannot do it from the UI, as I have restricted the text boxes only zip code. So, I just need to remove the validation.. that's all !!

dilip-borad commented 10 years ago

Yea, Its look like a very good result.

One simple problem is when we search for any small city/area, that time it's not provide us a accurate result. please check this http://lookaround.herokuapp.com/app/index.html#/search/gondal/atm

Your this ideas is a very intelligent to search for any category with in worlds any city. I'm a big fan of this app.

Xliff commented 10 years ago

You could do this with one text box and auto-complete to insure that things match up properly. Rules would be as follows:

If entry is digits, check postal code (most countries, I think -- I know this holds true for India and the US) If entry is letters then digits (<= 4 chars, UK postal codes) If entry is letters and greater than 4 chars, start searching cities, countries.

We pass this to Google autocompleter and let it handle the rest. We then perform validation on the selected result.

pratik14 commented 8 years ago

@Xliff why not directly use google autocomplete map search (input with autocomplete address). User are aware of how it works. The rules that you provided are not known to users. They might get confused why the app is behaving in a random way.

Xliff commented 8 years ago

That would assume that you could restrict Google autocomplete to just zip-codes. When I wrote that comment, that feature wasn't implemented, hence the need for the rules in the previous comment.

If Google Maps auto-complete has been updated to restrict to zip-codes, then you are correct. We can use that instead. It would make things MUCH easier.