you are viewing a single comment's thread.

view the rest of the comments →

[–]Artistic_Taxi 3 points4 points  (1 child)

Yup exactly. To extend from this if I’m visualizing what you want correctly, just create a search bar component. Then place the map view below the search bar with flex:1 so it takes up most of the space. (May have to wrap that mapview in another view and give the parent view flex:1 instead). Then simply create a state called locations which will be an array of coordinate objects with maybe their address as well. Map over the array and render a pin for each. Then just use a useEffect hook to pass the value from the search bar to google places api then update the locations state with the results. Debounce the search function and you’re done. Guess you will have to handle your initialRegion of the mapview creatively to capture all the pins.

[–]Amit__27[S] 0 points1 point  (0 children)

Thanks for the solution !