You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
54 lines
1.2 KiB
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
path {
|
|
stroke: white;
|
|
stroke-width: 0.25px;
|
|
fill: grey;
|
|
}
|
|
</style>
|
|
<body>
|
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
<script src="https://unpkg.com/topojson@3"></script>
|
|
<script src="https://cdn.rawgit.com/mahuntington/mapping-demo/master/map_data3.js" charset="utf-8"></script>
|
|
<script>
|
|
|
|
var width = 960,
|
|
height = 500;
|
|
|
|
var projection = d3.geoEquirectangular()
|
|
|
|
var svg = d3.select("body").append("svg")
|
|
.attr("width", width)
|
|
.attr("height", height);
|
|
|
|
var path = d3.geoPath()
|
|
.projection(projection);
|
|
|
|
var g = svg.append("g");
|
|
|
|
// load and display the World
|
|
d3.json("world-110m2.json").then(function(topology) {
|
|
|
|
const new_map = map_json.features.filter((feature, index)=>{
|
|
//return feature.properties.name != 'Argentina' && feature.properties.name != 'Angola'
|
|
//return feature.properties.name == 'Angola'
|
|
//return true
|
|
return index != 21
|
|
})
|
|
|
|
for(feature of new_map){
|
|
console.log(feature.properties.name);
|
|
}
|
|
g.selectAll("path")
|
|
//.data(topojson.feature(topology, topology.objects.countries).features)
|
|
.data(new_map)
|
|
.enter().append("path")
|
|
.attr("d", path);
|
|
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|