0

我正在使用 JQuery Vector Map 加载 svg 文件,但我得到以下

Uncaught TypeError: Cannot read property 'width' of undefined

事实上,问题在于它无法从 svg 文件中读取。有人知道 $('#africa').vectorMap();阅读它需要做什么。

<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>
4

1 回答 1

1

您不能只使用 SVG 文件来渲染非洲地图。很快我将发布新的 jVectorMap 站点,其中将提供许多从 GIS 数据转换而来的新地图。我在这里工作https://github.com/bjornd/jvectormap-site

于 2012-04-06T06:15:20.480 回答