Steve K
Steve K

Reputation: 1

Can't get planetary.js to work

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!

Upvotes: 0

Views: 613

Answers (2)

remonsam
remonsam

Reputation: 19

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.

Upvotes: 0

mLuby
mLuby

Reputation: 703

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.

Upvotes: 0

Related Questions