bjorn2404 / jQuery-Store-Locator-Plugin

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

problem when search by postcode [bug] #166

Closed manucnx closed 6 years ago

manucnx commented 7 years ago

f I search by postcode 26100 (Cremona), it is redirecting me in France. I've added this line <script src="https://maps.google.com/maps/api/js?key=MYKEYS&region=IT&language=it"></script>
but doesn't works.

ssherriff commented 7 years ago

This also happens for me. It seems as region biasing doesn't always work as it is only a suggestion for weighting results.

It seems as though the suggested solution is to use componentRestrictions, but I haven't actually tried it. https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingRequests

Example: geocoder.geocode({'address': request.term, componentRestrictions: {country: 'GB'}}

@manucnx Did you end up finding a solution?

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.