0

So I have been all over plantary.js page, ran though all the checks, installed as they asked etc. I cannot get the site to load. Googled, and looked here as well. I have used the quickstart exactly as they said as well. What am I doing wrong? I am not very well versed in JQuery although I have a working knowledge of it and I believe that it is installed correctly (I'm running other jQuery that works fine.

Code:

<html>
<head>
  <script type='text/javascript' src='http://d3js.org/d3.v3.min.js'></script>
  <script type='text/javascript' src='http://d3js.org/topojson.v1.min.js'></script>
  <script type='text/javascript' src='planetaryjs.min.js'></script>
</head>
<body>
  <canvas id='globe' width='500' height='500'></canvas>
  <script type='text/javascript' src='yourApp.js'></script>
</body>
</html>

js (yourApp.js):

var planet = planetaryjs.planet();
// You can remove this statement if `world-110m.json`
// is in the same path as the HTML page:
planet.loadPlugin(planetaryjs.plugins.earth({
  topojson: { file: 'world-110m.json' }
}));
// Make the planet fit well in its canvas
planet.projection.scale(250).translate([250, 250]);
var canvas = document.getElementById('globe');
planet.draw(canvas);

I appreciate any help!

thanks!

Steve K
  • 1
  • 1
  • How are you viewing the app? You have to view the HTML page over `http://` so that Planetary.js can do the Ajax load of the world `.json` file. Also, are you seeing any errors in your JavaScript console? – Michelle Tilley Jun 15 '15 at 15:49

2 Answers2

0

Your code works for me, so most likely some of these files are not in the right place:

Make sure those files have the right names and are in the same directory as your index.html.

mLuby
  • 673
  • 7
  • 15
0

I know its been a long time but maybe it useful from someone else

You need to configure IIS to work with JSON files

  1. Open IIS Manager.
  2. Select the Default Web Site node.
  3. Double-click MIME Types.
  4. Click the Add… link under the Actions section to open the Add MIME Types window.
  5. In the Add MIME Type window, in the File name extension field, type .json.
  6. In the MIME type field, type text/plain.
  7. Click OK.
remonsam
  • 19
  • 2