Hi,
I encountered an issue when I resize the map. The map container size is programatically resized, then i use the "updateSize" function.
If I resize slowly, the size of the map is ok, but if I shrink quickly the window then the map slowly shrinks and then stop shriking, so the map overflows the container.
I don't know the cause, but i wrote a workaround if someone encounters the same issue. Not really beautiful, but it works :). The idea is to call X times the updateSize function, and stop as soon as the size of the map is not updated by the function.
`
//this.map is the jvectormap object
let lastWidth = null;
let resize = (i)=> {
console.log("resize iteration", i);
console.log("lastWidth", lastWidth, this.map.width);
this.map.updateSize();
setTimeout(()=>{
if( Math.abs(this.map.width - lastWidth) > 2) {
lastWidth = this.map.width;
resize(i+1);
}
},5);
}
resize(0);
Hi, I encountered an issue when I resize the map. The map container size is programatically resized, then i use the "updateSize" function. If I resize slowly, the size of the map is ok, but if I shrink quickly the window then the map slowly shrinks and then stop shriking, so the map overflows the container.
I don't know the cause, but i wrote a workaround if someone encounters the same issue. Not really beautiful, but it works :). The idea is to call X times the updateSize function, and stop as soon as the size of the map is not updated by the function.
` //this.map is the jvectormap object let lastWidth = null; let resize = (i)=> { console.log("resize iteration", i); console.log("lastWidth", lastWidth, this.map.width); this.map.updateSize(); setTimeout(()=>{ if( Math.abs(this.map.width - lastWidth) > 2) { lastWidth = this.map.width; resize(i+1); } },5); } resize(0);
`
Have a good day !
Dorian