简体   繁体   中英

Geojson file not showing up in D3.js

I am trying to use Mike Bostock's geopaths plugin for D3.js, as seen here: http://bl.ocks.org/mbostock/4310087

When I use Mike's raw file the visualization shows up fine, but when I use my own nothing shows up.

Here is my Geojson file, what am I doing wrong?

https://gist.github.com/anonymous/5a1ada2ac7d57383b661

Your file looks correct. I assume that you're referring to the geopaths file within your local directory. In order to utilize this file when calling d3.json() the folder from which you are accessing the file must be served by an http server.

A simple http server can be created by the following node.js module: https://npmjs.org/package/http-server .

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