Extracting Postal Code: The function starts by extracting the postal code from the input field.
Getting Place Details: It then retrieves details about the selected place using the Autocomplete service, just like before.
Creating Bounds from Viewport: Once the place details are obtained, it constructs a google.maps.LatLngBounds object using the viewport of the selected place. The viewport represents the area that encompasses the place, providing a bounding box.
Performing Nearby Search with Bounds: With the bounds defined, it sets up a nearby search request to find places within both the specified radius and the bounds. This biases the search results to only include places within the viewport of the selected place.
Displaying Results: Finally, it displays the nearby search results (street addresses) in a list format, allowing the user to select a specific address.
I tried to solve using above steps (Google place api).
How to show street address like these in the image(using Different library).enter image description here
Sajo Sunny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.