Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added google.maps.places.Autocomplete class options as prop to autocomplete component #71

Merged
merged 1 commit into from
Aug 7, 2021

Conversation

edisile
Copy link
Contributor

@edisile edisile commented Aug 5, 2021

The google.maps.places.Autocomplete class accepts quite a few useful parameters (e.g. bounds, fields, ecc.), this patch adds an optional options prop such parameters can be passed through.

@TouchSek
Copy link
Collaborator

TouchSek commented Aug 7, 2021

@edisile thanks for PR, put plz write the example of this option too.

const center = { lat: 50.064192, lng: -130.605469 };
// Create a bounding box with sides ~10km away from the center point
const defaultBounds = {
  north: center.lat + 0.1,
  south: center.lat - 0.1,
  east: center.lng + 0.1,
  west: center.lng - 0.1,
};
const options = {
  bounds: defaultBounds,
  componentRestrictions: { country: "us" },
  fields: ["address_components", "geometry", "icon", "name"],
  strictBounds: false,
  types: ["establishment"],
};

Copy link
Collaborator

@TouchSek TouchSek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TouchSek TouchSek merged commit e27b558 into chantouchsek:master Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants