How to unload / dispose a map when navigating to another page

I am using google maps API, my map works perfectly but when I navigate to the previous page that page does not reload as it normally would and I get this error when I navigate to the previous page. Please advise

I’m not sure how to navigate to other pages normally and have them refresh automatically after using a map. At the moment I have to refresh pages manually