Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const onSelect = address => {
- setValue(address);
- const latLng = geocode.getGeocode(address);
- console.log("latLng", latLng);
- };
- import { geocodeByAddress, getLatLng } from "react-places-autocomplete";
- const geocode = {
- getGeocode: address => {
- geocodeByAddress(address)
- .then(results => {
- console.log("results", results);
- return getLatLng(results[0]);
- })
- .catch(error => console.error("Error", error));
- }
- };
- export default geocode;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement