0

I have merchants and consumer's based application. Where the logged in Consumer can search the merchant with their own(Consumer's zip code) zip code.

The merchants those are matched (Zip code of merchant) with the zip code of consumer are displayed on google map. So I am having an issue on below task:-

If there are no merchants matching the consumer ZIP code, then the map should zoom out to show one level of zoom beyond the next nearest merchant. I want to get the next nearest zip code from the list of merchants' zip code. Which already we have in our database.

  • Can you try something like ```SELECT * FROM Merchant ORDER BY `zipcode` - :zipcode ASC``` ? – Gwendal Feb 15 '16 at 08:41
  • Actually I am trying to fetch the records (zip-codes) from the table those are matched to next nearest location or zip code. Here is the reference. `http://stackoverflow.com/questions/6922195/nearest-zip-code-search-using-asp-net` – Prabhdeep Singh Feb 15 '16 at 09:44
  • Maybe you can try to convert zipcodes to latitude / longitude coordinates ? – Gwendal Feb 15 '16 at 09:46
  • Yes we can convert to the latt, long and then we can get the data based upon the next nearest latt, lang. I am right? – Prabhdeep Singh Feb 15 '16 at 09:49
  • Yes, maybe this can help you http://stackoverflow.com/questions/1006654/fastest-way-to-find-distance-between-two-lat-long-points – Gwendal Feb 15 '16 at 09:51

0 Answers0