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

onPlaceChanged method #29

Open
y1ann1s85 opened this issue Oct 28, 2019 · 1 comment
Open

onPlaceChanged method #29

y1ann1s85 opened this issue Oct 28, 2019 · 1 comment

Comments

@y1ann1s85
Copy link

y1ann1s85 commented Oct 28, 2019

Sorry to report this as a bug. It is not.

Can you give me an example of how the method onPlaceChanged of StandAloneAutoComplete is used?
I want to get info about the place I typed.
I used it on react-google-maps and it was working. I can't seem to get it to work with this package though.
Here is what I have so far:

const SimpleMap = (props) => {
return(

<StandaloneAutocomplete
style={{
width: '100%',
height: '5vh',
marginBottom: '5%',
boxSizing: border-box,
border: 1px solid transparent,
padding: 0 12px,
borderRadius: 3px,
boxShadow: 0 2px 6px rgba(0, 0, 0, 0.3),
fontSize: 14px,
outline: none,
textOverflow: ellipses
}}
id="standalone-search-box"
placeholder="Search..."
onPlaceChanged={props.onPlaceSelected}
/>
<MapBox
apiKey={API_KEY}
opts={{
center: {lat: props.currentLocation.lat, lng: props.currentLocation.lng},
zoom: 14,
}}
style={{
height: '80vh',
width: '100%',
}}
useDrawing
useGeometry
usePlaces
useVisualization
/>
<Marker
id="marker"
opts={{
draggable: true,
label: '',
position: { lat: props.currentLocation.lat, lng: props.currentLocation.lng },
}}
/>
<InfoWindow
opts={{
content: props.address,
position: {lat: props.currentLocation.lat + 0.0018, lng: props.currentLocation.lng},
}}
hidden
/>

    </GoogleMapProvider>
)

}

My onPlaceSelected method:

onPlaceSelected (place) {
console.log( 'plc', place );
}

@loicboset
Copy link

loicboset commented Jun 21, 2021

@y1ann1s85 do you remember how you fixed that?

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

No branches or pull requests

2 participants