0
我通过stackoverflow搜索,但我仍然无法找到答案,即使认为类似的问题已经问了。Kartograph Not Displaying
我想显示由Kartograph.py演示生成的SVG地图。 但无论我做什么,只是不显示。
这里是我的代码:
<!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>
我试图在本地运行,并直接JS文件使用自己的版本。 我试着运行最新版本。
我只是不知道它有什么问题。
您需要本地副本kartograph.js以避免跨域错误。或者,[jquery ajax设置](http://api.jquery.com/jquery.ajax/)中的'crossDomain'选项可能会对您有所帮助(但我不知道它们如何与kartograph进行交互,对不起)。 – collapsar 2015-02-23 15:05:03
我曾尝试使用所有三个JS的本地副本运行。但它仍然不显示。我以为我下载了错误的JS。 – TLCH723 2015-02-23 16:53:54