Relative Content

Tag Archive for reactjsgoogle-maps

Google Maps clusters duplicating when leaving browser for another tab

I am using Google maps with marker clusters to display some points on a map and everything works fine until I switch from browser to vscode or any other window, or when I change tabs in the browser. When I go back to the map, I see markers duplicated like they have been rendered once again.

Infinite loop when trying to call google maps geocoding API in ReactJS

I’m new to React and API calls. I currently have a list of locations being passed in as a prop to a Geocoder component which contains a geocoding function. This list is 17 objects long. My intent for this function is to convert all locations to a geocode, save them in a list, and plot them on a map. However, I have found myself stuck in an infinite loop of calls to the Google Maps Geocoder API and my geocodedLocations list becomes infinitely long.