This post describes how to build a very basic background map of the world with d3.js and canvas. Note that the same kind of code would work with any geospatial data stored in geojson
format. You can see many other examples in the background map section of the gallery.
canvas
. Rest of the code adds stuff in it.svg
to draw shapes in javascript. Read an intro to canvas here.svg
(see here). But once the projection anc the path generator are ready, shapes are drawn with fill()
and stroke()
.