I can't understand why the onclick
in the OverlayView
doens't work. I've put a custom object (a simply div) as child, is the BaloonLocationJob
.
How can make the OverlayView
clickable?
<GoogleMap
defaultZoom={16}
defaultCenter={{ lat: props.job.latitude, lng: props.job.longitude }}
options={{mapTypeControl:false,navigationControl:false,streetViewControl:false,scaleControl:false}}>
{
<OverlayView
key={Math.random()}
position={{ lat: props.job.latitude, lng: props.job.longitude }}
onClick={props.hello}
mapPaneName={OverlayView.OVERLAY_LAYER}>
<BaloonLocationJob address={props.job.address} onClick={props.onToggleOpen/* todo: this isn't working*/}/>
</OverlayView>
}
</GoogleMap>