Jvector地图插件问题

4

希望有人能够帮我解决问题。我在我们内部网络中找到了一个很棒的jQuery插件,可以显示矢量地图,但我无法创建HTML代码使其正常工作。

http://jvectormap.owl-hollow.net/

如果您能提供帮助或指导,我将不胜感激。

谢谢, Tony

2个回答

3

可能您忘记设置容器的大小,而您想要在其中放置地图。这样做应该可以解决问题:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <link rel="stylesheet" href="jquery.vector-map.css" type="text/css" media="screen" />
    <script src="jquery-1.6.min.js"></script>
    <script src="jquery.vector-map.js"></script>
    <script src="world-en.js"></script>
    <script>
        $(function(){
            $('#map').vectorMap();
        });
    </script>
</head>
<body>
    <div id="map" style="width: 600px; height: 400px;"></div>
</body>
</html>

我将在下一个版本中添加宽度和高度参数


1

您必须设置您的地图,其名称位于map.js文件的顶部。可能您忘记了。

$('#map').vectorMap({map: 'europe_en'});

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接