简体   繁体   中英

Error: Invalid value for <g> attribute transform=“scale(NaN) translate(NaN, NaN)”

I am trying to use jVectorMap in an application and I'm receiving this error.

The example shown on their website says that all you have to do is put, $('#map').vectorMap({map: 'world_mill_en'}); on your page.

Well, I have both a div with an id of map as well as this script loaded, and I am getting this error. What is ? I'm guessing it has something to do with SVG or some setting that isn't being set (like height or width?)

Here's my use of the script:

<script>
  $('#map').vectorMap({map: 'world_mill_en'});
</script>

And my div:

<div id="map"></div>

How do I set the height/width of the div? Or do I set this value in vectormap, or is it something else entirely?

Here is how my header scripts are organized:

<script src="js/jquery-1.11.2/jquery-1.11.2.min.js"></script>
<script src="js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script> 
<script src="jvectormap/jquery-jvectormap-2.0.2.min.js"></script>
<link rel="stylesheet" href="jvectormap/jquery-jvectormap-2.0.2.css" />
<script src="jvectormap/jquery-jvectormap-world-mill-en.js"></script>

use [{x: 0, y: 1}] instead of [[0,1]]

usually this ends up being the cause of this error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM