Closed NicoSan20 closed 1 year ago
Hello,
Thank you for your suggestion! In the latest version, we've introduced a setComponents
method that allows you to set postal code restrictions. Feel free to give it a try.
import {setKey, setComponents, fromAddress} from 'react-geocode';
setKey('AIzaSyDUAzKPR3MoFHwZz7wEYThVptNvnq_cBJY');
setComponents('locality:santa+cruz|country:ES');
fromAddress('high st hasting')
.then(({results}) => {
console.log(results);
})
.catch(console.error);
import {setKey, geocode} from 'react-geocode';
setKey('AIzaSyDUAzKPR3MoFHwZz7wEYThVptNvnq_cBJY');
geocode('components', 'locality:santa+cruz|country:ES')
.then(({results}) => {
console.log(results);
})
.catch(console.error);
If you have further questions or need assistance, don't hesitate to ask.
Hi,
In the Geocoding of google, you have now the possibility to do a restriction on the postal code.
You can append this like that : components=country:CH|postal_code:8000
Here the documentation from Google : Geocoding FAQ
This will feature will be appreciate...
Thank you in advance and sorry for my english, I speak only french.
Regards