bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

Region Issue: AU #187

Closed pgbrown closed 6 years ago

pgbrown commented 7 years ago

Hi

I've implemented the plugin and it works great.

Except some searches are way off. My client's locations are all in Australia. I've set the locator to start in Australia. I've set the region to AU. But still with some searches it is way off. Notably when I put in the postcode/zipcode of 2000 which is Sydney it ends up in Brisbane, which is way off.

Looking at the Developer Console Network tabthis response is getting returned for 2000:

v: origLat:22.1284552 origLng:-100.90936950000003 origAddress:2000 formattedAddress:Cd+2000%2C+San+Luis%2C+S.L.P.%2C+Mexico boundsNorthEast:%7B%22lat%22%3A22.1304811%2C%22lng%22%3A-100.9016039%7D boundsSouthWest:%7B%22lat%22%3A22.1258574%2C%22lng%22%3A-100.91224720000002%7D

So I'm guessing that Brisbane, Australia is closer to San Luis, Mexico than Sydney, Australia.

If I enter Sydney instead of 2000 it works fine

v: origLat:-33.8688197 origLng:151.20929550000005 origAddress:Sydney formattedAddress:Sydney NSW, Australia boundsNorthEast:{"lat":-33.5781409,"lng":151.34302090000006} boundsSouthWest:{"lat":-34.118347,"lng":150.52092859999993}

If I enter 2070 (Lindfield) which is a postcode close to 2000, a few miles away the returned data is correct:

v: origLat:-33.7785908 origLng:151.16653769999994 origAddress:2070 formattedAddress:Lindfield NSW 2070, Australia boundsNorthEast:{"lat":-33.7585183,"lng":151.1988295} boundsSouthWest:{"lat":-33.7944299,"lng":151.14343869999993}

I've tried various ways of getting the AU region to stick but nothing is working. I was wondering if you can help.

Thanks!

bjorn2404 commented 6 years ago

This should be improved with the component restriction addition in v3.0.0 that can work with the existing region functionality.