From 4a34761f726599eb0fa448b82c98e93e80cde3ae Mon Sep 17 00:00:00 2001 From: roblevesque Date: Thu, 7 Jul 2016 11:35:52 -0400 Subject: [PATCH] Change to onload execution use onLoad instead of right away so the body dom element isn't null --- mapview/js/mapviewgl.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mapview/js/mapviewgl.js b/mapview/js/mapviewgl.js index 96dc399..2ccad9f 100644 --- a/mapview/js/mapviewgl.js +++ b/mapview/js/mapviewgl.js @@ -19,8 +19,13 @@ var canvas_t=[]; var context_t=[]; var clock = new THREE.Clock(); var WIDTH = window.innerWidth , HEIGHT = window.innerHeight + +window.onload = function() { init(); animate(); +render(); +} + function init() { scene = new THREE.Scene(); @@ -158,7 +163,6 @@ function render () { renderer.render( scene, camera ); } - render();