removed bermuda

main
Matt Huntington 3 years ago
parent 7d671f2934
commit 575c1b6e6d

File diff suppressed because one or more lines are too long

@ -10,13 +10,15 @@ path {
<body> <body>
<script src="https://d3js.org/d3.v7.min.js"></script> <script src="https://d3js.org/d3.v7.min.js"></script>
<script src="https://unpkg.com/topojson@3"></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 src="map_data3.js" charset="utf-8"></script>
<script> <script>
var width = 960, var width = 960,
height = 500; height = 500;
var projection = d3.geoEquirectangular() var projection = d3.geoEquirectangular()
//.center([-64.7799734332998,32.3072000581802])
//.scale(70000)
var svg = d3.select("body").append("svg") var svg = d3.select("body").append("svg")
.attr("width", width) .attr("width", width)
@ -28,25 +30,68 @@ var path = d3.geoPath()
var g = svg.append("g"); var g = svg.append("g");
// load and display the World // load and display the World
d3.json("world-110m2.json").then(function(topology) { //d3.json("world-110m2.json").then(function(topology) {
const new_map = map_json.features.filter((feature, index)=>{ // const new_map = map_json.features.filter((feature, index)=>{
//return feature.properties.name != 'Argentina' && feature.properties.name != 'Angola' //return feature.properties.name != 'Argentina' && feature.properties.name != 'Angola'
//return feature.properties.name == 'Angola' //return feature.properties.name == 'Angola'
//return true //return true
return index != 21 //return index != 21
}) // })
for(feature of new_map){ // for(feature of new_map){
console.log(feature.properties.name); // console.log(feature.properties.name);
} // }
/*
const new_map = map_json.features.map((feature)=>{
if(feature.properties.name == 'Bermuda'){
//console.log(feature.geometry.coordinates[0].length);
//feature.geometry.coordinates = []
/*console.log(feature.geometry.coordinates[0][33]);
console.log(feature.geometry.coordinates[0][34]);
console.log(feature.geometry.coordinates[0][35]);
const updated_coords = feature.geometry.coordinates[0].filter((coord, index)=>{
return index < 34
})
feature.geometry.coordinates[0] = updated_coords;
feature.geometry.coordinates[0].splice(30, 16)
feature.geometry.coordinates[0] = feature.geometry.coordinates[0].filter((coord, index)=>{
if(
index == 30 ||
index == 31 ||
index == 32 ||
index == 33 ||
index == 34 ||
index == 35 ||
index == 36 ||
index == 37 ||
index == 38 ||
index == 39 ||
index == 40 ||
index == 41 ||
index == 42 ||
index == 43 ||
index == 44 ||
index == 45
){
return true
} else {
return true
}
})
//console.log(feature.geometry.coordinates[0]);
return feature
} else {
return feature
}
})*/
g.selectAll("path") g.selectAll("path")
//.data(topojson.feature(topology, topology.objects.countries).features) //.data(topojson.feature(topology, topology.objects.countries).features)
.data(new_map) .data(map_json.features)
.enter().append("path") .enter().append("path")
.attr("d", path); .attr("d", path);
}); //});
</script> </script>
</body> </body>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save