From 2be3d4b74088e87c456d136313ebce20071bd970 Mon Sep 17 00:00:00 2001 From: roblevesque Date: Thu, 7 Jul 2016 10:44:57 -0400 Subject: [PATCH] Add JSON Data load code --- js/mapviewgl.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/mapviewgl.js b/js/mapviewgl.js index ea0ecd2..9633af7 100644 --- a/js/mapviewgl.js +++ b/js/mapviewgl.js @@ -1,3 +1,17 @@ +// Load Data +var xmlhttp = new XMLHttpRequest(); +var url = "empiredata.json"; +var jsonEmpire; + +xmlhttp.onreadystatechange = function() { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + jsonEmpire = JSON.parse(xmlhttp.responseText); + + } +}; +xmlhttp.open("GET", url, true); +xmlhttp.send(); + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var camera, controls, scene, renderer;