bjornd / jvectormap

Home Page:jvectormap.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when resizing window with hidden map

pettrz opened this issue · comments

I'm using different tabs which hides the map with display: none;. When the map gets hidden it gives me the same error multiple times while resizing.

This is what I see in console:
`
Error: attribute transform: Expected number, "scale(NaN) translate(N…".

  jvm.SVGCanvasElement.applyTransformParams @ jquery-jvectormap-2.0.3.min.js:1
  applyTransform @ jquery-jvectormap-2.0.3.min.js:2
  updateSize @ jquery-jvectormap-2.0.3.min.js:2
  onResize @ jquery-jvectormap-2.0.3.min.js:2
  dispatch @ jquery.min.js:2
  y.handle @ jquery.min.js:2

`

Any idea? Thank you

Seems like I was using a newer version of jquery which the map wasn't fully compatible with. RESOLVED

There's nothing to do with jQuery version.
Do not hide map with display: none, hide it with visibility: hidden
Chrome is fine with display: none, because it doesn't follow SVG spec, but firefox is more into that, so this trick doesn't work