How to use react-places-autocomplete - 10 common examples

To help you get started, we’ve selected a few react-places-autocomplete examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prabeen04 / ant-dashboard / src / components / google / googlePlace.js View on Github external
.then(results => {
                console.log(results)
                getLatLng(results[0])
            })
            .then(latLng => console.log('Success', latLng))
github deens-com / frontend / src / styled_scenes / Results / components / SearchFilters.js View on Github external
.then(results => {
        //console.log(results);
        addr = results[0].formatted_address;
        this.setState({ address: addr });
        return getLatLng(results[0]);
      })
      .then(results => {
github prabeen04 / ant-dashboard / src / components / google / googlePlace.js View on Github external
const handleSelect = (address) => {
        props.setGoogleAddress(address)
        geocodeByAddress(address)
            .then(results => {
                console.log(results)
                getLatLng(results[0])
            })
            .then(latLng => console.log('Success', latLng))
            .catch(error => console.error('Error', error))
    }
github prabeen04 / ant-dashboard / src / container / forms / reuseForm.js View on Github external
const handleSelect = address => {
        console.log(props, address)
        geocodeByAddress(address)
            .then(results => getLatLng(results[0]))
            .then(latLng => {
                console.log('Success', latLng)
                setLatlng(latLng)
            })
            .then(() => props.change('location', address))
            .catch(error => console.error('Error', error));
    };
    const renderInput = ({ input, meta, width, label, ...custom }) => (
github letsdoitworld / World-Cleanup-Day / web-app / src / components / Events / EventListHeader.js View on Github external
handleSelect = (address) => {
    geocodeByAddress(address)
      .then(results => this.props.updateSearchResultViewport(results[0].geometry.viewport))
      .catch(error => console.error('Error', error));
  }
github focallocal / fl-maps / imports / client / ui / components / PlacesSearchBox / index.js View on Github external
handleSelect = (address) => {
    const { onSelect } = this.props

    if (!onSelect) {
      return
    }

    geocodeByAddress(address)
      .then(results => getLatLng(results[0]))
      .then(latLng => onSelect({ ...latLng, name: address }))
      .catch(error => console.error('Error', error))
  }
}
github Henriettas-Army / CodeUp / client / src / containers / MapData.jsx View on Github external
const latLngevt = address => (
  geocodeByAddress(address)
    .then(results => getLatLng(results[0]))
    .catch(err => console.log(err))
);
github deens-com / frontend / src / styled_scenes / TripOrganizer / AddServiceModal.js View on Github external
handleLocationChange = async (address, id) => {
    const place = await geocodeByPlaceId(id);

    this.setState(
      {
        city: place[0].formatted_address,
        location: await getLatLng(place[0]),
      },
      this.search,
    );
  };

react-places-autocomplete

A React component for Google Maps Places Autocomplete

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis