简体   繁体   中英

WebGL Globe Won't Load

I am trying to run the examples in the WebGL Globe code package. I have downloaded the code from the GitHub repository and am attempting to run the page within the globe folder of the main directory.

I have been having issues loading the WebGL Globe locally on my machine. I have set up a SimpleHTTPServer with Python to handle the requests of the webpage locally. This Python script lives in the root directory of the project (where the readme file lives) to ensure that all the file references within the HTML code are correct. I am able to load the page, however, the globe will not load and the progress bar image persists. This yields the following result:

在此处输入图片说明

When I load the page, Python shows the following output: 在此处输入图片说明

The Python code:

import SimpleHTTPServer
import SocketServer

PORT = 8000

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print "serving at port", PORT
httpd.serve_forever()

As you can see, all the files load correctly.

I have visited a previous question but none of the solutions provided worked for me (and for the person who originally asked the question).

Does anyone know what I may be doing wrong? Is it possible that Google has stopped supporting this project?

Due to a recent commit to the project the code was updated to use a newer version of Three.js, but the actual Three.js file did not get updated.

So replace globe/third-party/three.min.js with the newest version of Three.js .

Give the globe a few seconds to pop up. On my computer it took about 6 seconds before I saw it.

Try taking a look at the JSON file that contains all the coordinates and magnitudes for the rendering of the lines on the globe. The JSON file contains the information in the format [longitude, latitude, magnitude, colour, longitude, latitude, magnitude, colour] If any comma is missing, it will not render the globe at all, the last value must not have any comma after it as shown above. An easy way to tell if the JSON file is the problem is to try to click-drag to move the globe and if the cursor changes to a move cursor, then its the JSON file. If all else fails, then try another implementation of a web server (Apache maybe?). Also, check the developer console (CTRL + SHIFT + I) to see if there are any errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM