let countyURL = 'https://raw.githubusercontent.com/deldersveld/topojson/master/countries/nigeria/nigeria-states.json'
let countyData
let canvas = d3.select('#canvas')
let tooltip = d3.select('#tooltip')
let drawMap = () => {
canvas.selectAll('path')
.data(countyData)
.enter()
.append('path')
.attr('d', d3.geoPath())
.attr('class', 'county')
}
d3.json(countyURL).then(
(data, error) => {
if(error){
console.log(log)
}else{
//countyData = topojson.feature(data, data.objects.counties).features
countyData = topojson.feature(data, data.objects.NGA_adm1).features
console.log(countyData)
drawMap()
}
}
)
I created a drawmap() function which I called but the map is not coming up
I don’t know if I making any mistake in my referencing (data.objects.NGA_adm1)
this is my map data source (“https://raw.githubusercontent.com/deldersveld/topojson/master/countries/nigeria/nigeria-states.json”)
Please I will really appreciate if I can get any help