2

I am trying to dynamically change the language on google maps. As we all know this is not possible in the api itself, so one needs to reload the script. But with this comes serious question: how to properly destory previous map object ? The very interesting answer can be found here: unload-google-maps-api. And indeed there are memory leaks after reloading google api, after few times it stops working in my case. (Uncaught TypeError: Cannot read property 'transclude' of undefined).

Does someone have any experience with reloading the api in order to change language and memory leaks related to that? What is the proper way of doing it (changing the language without reloading the page)? Google really hasn't thought about this or am I missing something ?

Thanks!

Community
  • 1
  • 1
Adam Wolski
  • 5,448
  • 2
  • 27
  • 46

0 Answers0