I’m encountering a recurring issue in my Blazor .NET8 application where the buttons on my Google Maps (such as the zoom and fullscreen buttons) display repeated icons every time I navigate away from the map page and then return to it. Initially, when the map loads for the first time, everything appears normal. However, upon returning to the map after visiting other parts of the application, the icons on the map controls multiply.
Could anyone suggest why this might be happening and how to fix this issue or properly clean up or reset the Google Maps instance to prevent icons from duplicating on the controls? Any insights or suggestions would be greatly appreciated!
Thank you in advance for your help!
Ensuring that the Google Maps API script is loaded only once.
Cleaning up the map instance using JavaScript before reinitializing the map. I’ve removed all markers, event listeners, and reset the map variable to null.
TomW22 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.