Stophface Stophface - 1 year ago 70
HTML Question

Make SVG transparent with d3 on leaflet

I am following Mike Bostock's tutorial on how to display a

on a
leaflet map

It works - sort of.
When I try to display this file here (the geoJSON "US States") I get a black block on my map isntead of the outlines of the states.screenshot

Any ideas why?

Answer Source

You may have an issue with you stylesheet.

The source code of your tutorial has the following :

path {
  fill: #000;
  fill-opacity: .2;
  stroke: #fff;
  stroke-width: 1.5px;

path:hover {
  fill: brown;
  fill-opacity: .7;

You should play with the fill and fill-opacity properties to match your needs.