You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
/>
}
My onPlaceSelected method:
onPlaceSelected (place) {
console.log( 'plc', place );
}
The text was updated successfully, but these errors were encountered: