[英]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. 我试图在应用程序中使用jVectorMap,我收到此错误。
The example shown on their website says that all you have to do is put, $('#map').vectorMap({map: 'world_mill_en'});
他们网站上显示的例子说你需要做的就是放置
$('#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. 好吧,我有一个带有地图ID的div以及加载的这个脚本,我收到了这个错误。 What is ?
什么是 ? I'm guessing it has something to do with SVG or some setting that isn't being set (like height or width?)
我猜它与SVG或某些未设置的设置有关(如高度或宽度?)
Here's my use of the script: 这是我对脚本的使用:
<script>
$('#map').vectorMap({map: 'world_mill_en'});
</script>
And my div: 我的div:
<div id="map"></div>
How do I set the height/width of the div? 如何设置div的高度/宽度? Or do I set this value in vectormap, or is it something else entirely?
或者我在vectormap中设置此值,还是完全不同于其他内容?
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]] 使用[{x:0,y:1}]代替[[0,1]]
usually this ends up being the cause of this error 通常这最终会导致此错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.