我已经在d3中创建了一张地图,并且需要在其中添加一系列圆圈。我试图得到一个圆圈来展示和不能。我也改变了圈子的大小。开发工具在页面上显示一个圆圈,但不会显示。这是我的代码:将圆圈追加到d3中的地图
该圆圈放置在地图的中心。
var features = parsedJSON.features;
mapLayer.selectAll('path')
.data(features)
.enter().append('path')
.attr('d', path)
.attr('vector-effect', 'non-scaling-stroke')
.attr('fill', '#e8edfc')
.select('svg').enter()
.append('circle')
.attr('cx',-106.661513)
.attr('cy', 35.05917399)
.attr('r','10px')
.style('fill', 'red');
纠正错误,在我的示例代码 –
谁downvoted这可能做的理由很简单:有多少圈,你认为你的代码附加(右一个比其他)? –
我回答了手头的问题:)“我试图让一个圆圈显示,但不能。” –