My goal is to find nearby establishments based on points selected by the user on a map through clicks. I successfully implemented a click handler on the map using google.maps.event.addListener to retrieve the lat/lng of the clicked location.
The issue arises when clicking on points of interest (POIs) on the map, as they do not trigger the usual event and display their infowindow. This prevents me from determining where the user clicked. While I can create code to forcibly insert content into the info window, I am uncertain how to obtain the lat/lng of the POI.
In order of preference, I would like to achieve one of the following:
1. Receive notification through an event when a user clicks on a POI, set custom content for the info window, and receive the lat/lng of the POI.
2. Disable the infowindow for POIs so that the standard click handler functions as intended.
3. Ensure the normal click handler works even when a POI is clicked, as explained in https://developers.google.com/maps/documentation/javascript/events
4. Prevent POIs from displaying altogether.
Any suggestions?