SVG file kartograph [closed]

3

Using kartograph, I want to load the SVG of this link: SVG . The first thing I noticed I was missing was the metadata tag. So I copied that tag from another SVG file, but the image still does not show up. Could anyone look at the svg file of the link and tell me what is missing?

Below my html code.

<html>
    <head>
        <script src="../../js/jquery/jquery-1.9.1.min.js"></script>
        <script src="../../js/raphaeljs/raphael-min.js"></script>
        <script src="../../js/kartograph/kartograph.js"></script>
        <script>
                $(document).ready(function(){

                    var map = kartograph.map('#map');
                    map.loadMap('mymap.svg', function () {
                            map.addLayer("Terreno");
                    });
    });
        </script>
    </head>
    <body>
        <div id="map"></div>
    </body>
</html>
    
asked by anonymous 29.12.2014 / 21:24

2 answers

-1

The solution was to generate the map using Kartograph py from SHP files.

    
08.01.2015 / 16:25
0

I can not reproduce the problem, so I'll point out the possible errors in the code:

  • In your code you are using version 1.9.1 of Jquery <script src="../../js/jquery/jquery-1.9.1.min.js"></script>

    But the kartograph uses version 1.10.2 <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>

  • In your code you may be using an outdated version of raphael, kartograph uses "raphael 2.1.0" (as I said "can", you can not be sure)
  • SVG is in a different domain than the current one, your SVG may be in a different domain than the page that is using the "kartograph", this can cause problems with " CORS "

  • Other possible problems

    The files are not in the correct directory, to determine the failure look at your browser's Console, here's how to do it: link    If the Console shows an error, you will know the problem with your code through this "error".

        
    30.12.2014 / 14:50