I need to showcase some SVG circle elements on a map using d3.
Here is the code for one of the circles positioned over Rome, styled with D3 attributes:
var feature = g.append("circle")
.style("stroke", "#006600")
.style("fill", "#00cc00")
.attr("r", 20);
Unfortunately, as depicted in the image below, the element block does not display correctly with the specified color from the right panel.
https://i.sstatic.net/YwGLD.png
EDIT: The issue actually lies within the CSS rules. By setting the width and height properties of the svg element like so:
var svg = d3.select(map.getPanes().overlayPane).append("svg").style("width", "10000").style("height", "10000"),
g = svg.append("g").attr("class", "leaflet-zoom-hide");
the circles will appear on the map. While this might work, it would be ideal to have the size adjusted to fit the group element inside (if possible) or at least the browser window. I have attempted setting the width and height properties to 100%, but it didn't work without adjusting the parent div as well, resulting in an undesirable view.