Reputation: 20150
I'm using JQuery Vector Map to load an svg file but I'm getting the following
Uncaught TypeError: Cannot read property 'width' of undefined
In fact the problem is that it is not being able to read from the svg file. Does someone know what needs to be done for $('#africa').vectorMap();
to read it.
<html>
<head>
<title>Testing Map</title>
<script src="jquery.vector-map/jquery-1.6.min.js" type="text/javascript"></script>
<link href="jquery.vector-map/jquery.vector-map.css" media="screen" rel="stylesheet" type="text/css" />
<script src="jquery.vector-map/jquery.vector-map.js" type="text/javascript"></script>
<script type="text/javascript">
$(function()
{
$('#africa').vectorMap();
});
</script>
</head>
<body>
<div id="africa">
<embed src="africa.svg"/>
</div>
</body>
</html>
Upvotes: 0
Views: 3543
Reputation: 22943
You can't just use SVG file to be able to render Africa map. Soon I'm going to release new jVectorMap site, where many new maps, converted from GIS data, will be available. I work on it here https://github.com/bjornd/jvectormap-site.
Upvotes: 1