0

I successfully completed the "Let's make a map" tutorial and now want to make a world map. However, all examples I tried (a couple from mbostock) only display background graphics in chrome and firefox. I get the following error in firebug:

SyntaxError: JSON.parse: unexpected character

return JSON.parse(request.responseText);

in d3.v3.js but I assume it starts with the following code in the index.htm:

queue()
.defer(d3.json, "world-110m.json")
.defer(d3.tsv, "world-country-names.tsv")
.await(ready); 

The call d3.json of "world-110m.json" seems to produce the error. I have found nothing about this error on the internet -- I'd appreciate some help.

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
Peter
  • 1
  • 1
  • This is a response given when something in your .json file is broken. You might have saved your .json file in a text editor that left unknown characters or saved only part of it, or it might otherwise be corrupted. Or maybe you forgot to move world-110m.json to your development environment? – Elijah May 25 '13 at 14:40
  • https://github.com/mbostock/topojson/blob/master/examples/world-110m.json – Peter May 27 '13 at 08:07
  • I actually only downloaded the file there and didn't do anything else with it. Could it be that I have to install an editor so the javascript can open it? – Peter May 27 '13 at 08:09
  • I also get the ok in firebug that the file is loaded properly. You have any other ideas or should I try to make my own world-110m.json file? That seems not very elegant however. @Elijah – Peter May 27 '13 at 08:12
  • Could this be the problem: http://stackoverflow.com/questions/8524933/json-parse-unexpected-character-error ? – Derek Hill Jul 16 '13 at 20:49

0 Answers0