Skip to content

Instantly share code, notes, and snippets.

@hitsujixgit
Created June 19, 2014 11:44
Show Gist options
  • Save hitsujixgit/fc88e660c80c6eae78be to your computer and use it in GitHub Desktop.
Save hitsujixgit/fc88e660c80c6eae78be to your computer and use it in GitHub Desktop.
Read 2 json files.
// file読み込み制御用
var readTopofileDone = false;
var readAttrfileDone = false;
// filedata格納変数
var topodata;
var attrdata;
var map_width = 500;
var map_height = 650;
var svg;
function readTopofile(json) {
topodata = json;
readTopofileDone = true;
}
function readAttrfile(json) {
attrdata = json;
readAttrfileDone = true;
}
d3.json("yokohama_topo_out.json", function(error, json) {
if(error) return console.warn(error);
readTopofile(json);
if (readTopofileDone && readAttrfileDone) {
main(topodata, attrdata);
}
});
d3.json("yokohama_codes.json", function(error, json) {
if(error) return console.warn(error);
readAttrfile(json);
if (readTopofileDone && readAttrfileDone) {
main(topodata, attrdata);
}
});
function main(topo, attr) {
// break
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment