jvectormap深入各大洲

时间:2018-09-17 14:06:27

标签: jvectormap

我使用jVectorMap来显示各大洲的地图。我想通过单击各大洲来打开特定大洲的地图... 这是我的代码:

    <!DOCTYPE html>
    <html>
      <head>
        <title>mydcs jVectorMap</title>

        <script src="jquery-3.2.1.min.js"></script>
        <script src="jquery-jvectormap-2.0.3.min.js"></script>        
        <link rel="stylesheet" href="jquery-jvectormap-2.0.3.css" type="text/css" media="screen"/>    
        <script src="jquery-jvectormap-continents-mill.js"></script>
      </head>
      <body>


        <div id="map1" style="width: 800px; height: 600px"></div>


        <script>
          //@code_start
          $(function () {
            new jvm.MultiMap({
              container: $('#map1'),
              maxLevel: 1,
              main: {
                map: 'continents_mill'
              },
              mapUrlByCode: function (code, multiMap) {
                return './continents/jquery-jvectormap-data-' + code.toLowerCase() + '-' + multiMap.defaultProjection + '-en.js';
              }
            });
          });
          //@code_end
        </script>


      </body>
    </html>

但是...当我单击一个大陆时...看起来地图正在缩放,然后容器为空白!我在浏览器控制台中检查了错误..并且没有错误!

在“大陆”文件夹中,我有各大洲的js文件(例如,北美的jquery-jvectormap-data-na-mill-en.js ...)

0 个答案:

没有答案