React Google Map API Polyline Not Clearing Properly
I’m currently developing a map view feature for a project where custom markers and connected polylines are displayed based on different sets of latitude and longitude coordinates for each day. There’s also an option to view all markers and polylines for every day at once.
However, I’m encountering an issue: when I select the ‘All’ option to display markers and polylines for all days simultaneously, everything appears as expected. But, after toggling back to view markers and polylines for individual days and selecting a specific day, such as ‘SAT’, the markers and polylines for that day are displayed correctly. However, when I switch to another day, such as SUN, the map retains the polyline from the previous day (SAT), without showing its markers. This behavior is problematic and I’m struggling to resolve it.
React Googel Map API Polyline Not Clearing Properly
I’m currently developing a map view feature for a project where custom markers and connected polylines are displayed based on different sets of latitude and longitude coordinates for each day. There’s also an option to view all markers and polylines for every day at once.
However, I’m encountering an issue: when I select the ‘All’ option to display markers and polylines for all days simultaneously, everything appears as expected. But, after toggling back to view markers and polylines for individual days and selecting a specific day, such as ‘SAT’, the markers and polylines for that day are displayed correctly. However, when I switch to another day, such as SUN, the map retains the polyline from the previous day (SAT), without showing its markers. This behavior is problematic and I’m struggling to resolve it.