webglearth / webglearth2

[UNMAINTAINED] WebGL Earth 2 - the source code of the project
Apache License 2.0
884 stars 212 forks source link

Uncaught SyntaxError: Unexpected token '<' api.js:1 in webGL #127

Open danishkhan3621 opened 3 years ago

danishkhan3621 commented 3 years ago

I'm trying to intwegrate WebGL but when i run the same in browser i'm getting this error:

Uncaught SyntaxError: Unexpected token '<'
api.js:1

Uncaught ReferenceError: WE is not defined
    at initialize (index-new.html:7)
<!DOCTYPE HTML>
    <html>
      <head>
        <script src="http://www.webglearth.com/v2/api.js"></script>
        <script>
          function initialize() {
              var options = {
              sky: true,
              atmosphere: true,
              zooming: true
          };
            var earth = new WE.map('earth_div',options);
            WE.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{

            }).addTo(earth);
          }
        </script>
        <style>
          html, body{padding: 0; margin: 0;}
          #earth_div{top: 0; right: 0; bottom: 0; left: 0; position: absolute !important;}
        </style>
        <title>WebGL Earth API: Hello World</title>
      </head>
      <body onload="initialize()">
        <div id="earth_div"></div>
      </body>
    </html>
sebastian-marinescu commented 1 month ago

This

Uncaught SyntaxError: Unexpected token '<' api.js:1

makes me think (know), that the js-file is probably not loaded correctly.

Checklist: