bjornd / jvectormap

jvectormap.com
GNU Affero General Public License v3.0
1.38k stars 431 forks source link

How to re-initialise the vectormap? #450

Open PadharaHitesh opened 5 years ago

PadharaHitesh commented 5 years ago

I have initialise the chart on ajax success, but when fire datepicker change event then call ajax, chart dublicated..!!

So any destroy and remove event of that.

katalin2003 commented 3 years ago

Hello @PadharaHitesh. Did you find a way to do this? What I'm currently doing is setting the innerHTML of map container to empty and run the new jvm.WorldMap again. BUT this seems to create errors on viewport resizing (1 out 3 times) as it doesn't properly detect the size of the container. Not sure if this makes sense :) For debugging purposes, if I just hide the previous container and create a new one, I no longer get those errors. So this leads me to believe that somehow, a reference to the first map container is kept somehow..