0

I search through stackoverflow but still I cant find the answer even thought similar questions had asked.

I am trying to display a SVG map generated by the Kartograph.py's demo. But whatever I do it just doesn't display.

Here is my code:

<!DOCTYPE html>
<html lang="en=us">
    <head>
        <title>Kartograph Demo</title>

        <script src="/js/jquery-1.10.2.min.js"></script>
        <script src="/js/raphael-2.1.0.min.js"></script>
        <script src="/js/kartograph.js"></script>


    </head>

    <body>
        <h1>Kartograph Demo</h1>

        <p>
            <div id="map"></div>

            <script>
                $(function() {
                    var mymap = $K.map('#map', 600, 0);
                    mymap.loadMap('world.svg', function() {
                        mymap.addLayer('layer_0');
                    });

                });

            </script>


        </p>
    </body>
</html>

I tried running the JS file locally and directly using their version. I tried running the newest version.

I just don't know what wrong with it.

TLCH723
  • 1
  • 1
  • You need a local copy of kartograph.js to avoid cross-domain error. Alternatively, the `crossDomain` option in the [jquery ajax settings](http://api.jquery.com/jquery.ajax/) may help you (but I don't know how they interact with kartograph, sorry). – collapsar Feb 23 '15 at 15:05
  • I did try running with a local copy of all three JS. But it still doesn't display. I thought I downloaded the wrong JS. – TLCH723 Feb 23 '15 at 16:53

1 Answers1

0

Did you run your local copy through a localhost web server? Make sure you are loading something like this 'http://localhost:8888/Kartograph' and not simply dragging the html document to the browser. That got me when I started.