我的数据集托管在我的保管箱帐户上,但不是托管它的Javascript文件.我正在使用D3和Polymaps来可视化数据,但是我得到一个错误 - "XMLHttpRequest无法加载https://www.dropbox.com/s/89adzt973quosda/solaruse.json.否'访问控制 - 允许 - 来源'标题出现在请求的资源上.因此,不允许原点'null'访问." (dropbox文件的链接有效,所以你可以看看)
这是我用来加载JSON文件的代码(我在本地开发网站)我不确定从这一点开始做什么.
var po = org.polymaps;
//Create map object, append to #map
var map = po.map()
.container(d3.select("#map").append("svg").node())
.zoom(4)
.add(po.interact());
// Add the CloudMade image tiles as a base layer…
map.add(po.image()
.url(po.url("http://{S}tile.cloudmade.com"
+ "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
+ "/998/256/{Z}/{X}/{Y}.png")
.hosts(["a.", "b.", "c.", ""])));
// Add the compass control on top.
map.add(po.compass()
.pan("none"));
// Add the custom locations/acres
d3.json("https://www.dropbox.com/s/89adzt973quosda/solaruse.json", function(data){
// Insert layer beneath the compass.
var layer = d3.select("#map svg").insert("svg:g", ".compass");
// Add …
Run Code Online (Sandbox Code Playgroud)