开发者

Web GL Globe not working locally

开发者 https://www.devze.com 2023-03-12 10:11 出处:网络
I\'ve been trying to get the Web GL Globe ( http://code.google.com/p/webgl-globe ) working. I downloaded the source code from the Google Code page and unzipped all the files to a single folder. The Ma

I've been trying to get the Web GL Globe ( http://code.google.com/p/webgl-globe ) working. I downloaded the source code from the Google Code page and unzipped all the files to a single folder. The May 13th release is the latest as of writing. However the index.html page loads without the globe in Chrome and other browsers. I had a quick look at the code but I'm new to javascript etc. It appears some of the references to files are incorrect as if I correct the line:

     background: #000000 url(/globe/loading.gif) center center no-repeat;

to

     background: #000000 url(../globe/loading.gif) center center no-repeat;

I get a loading wheel gif loading but spinning forever.

Looking further into the code it appears moving globe.animate(); to a different line creates a working globe but without the data loading functionality. I tried the following to get a globe displaying:

        globe.createPoints();
        settime(globe,0)();
      }
   开发者_如何学JAVA }
  };globe.animate();

Basically I would love a working download (zip?) of the WebGL globe or someone to take a look at the download on http://code.google.com/p/webgl-globe/downloads/list and let me know how to create a working version from the broken code on the site.

Thanks in advance,

Charlotte


Are you hosting this just by running it off the file system? If you are then that is why the images aren't loading "/" will refer to your root directory. If you are running on something that has python you can run the following from the project directory

python -m SimpleHTTPServer 8000

Then browse to http://0.0.0.0:8000/ and it should work.

Web GL Globe not working locally


If you just click on index.html, it would not work, because the js files would not be loaded

<script type="text/javascript" src="/globe/globe.js"></script>

For sure if you use for exemple MAMP (WAMP) and change your document root to /Users/You/Downloads/webgl-globe-master

You will just have to go there in order to load the js files without editing the html code :

http://localhost:8888/globe/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号