I'm trying to put on a map a series of topoJSON, but I came into this strange behaviour of the polygons, see the link below. If I try to convert them in to geoJSON and to visualise them, i get the same problem. You can che check here, unfortunately I'm not able to create a JS fiddle due to the ajax call to an external call I have to do. I paste the code here:
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>TopoJSON data</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
path {
stroke-width:1;
stroke-opacity:0.25;
opacity:0.4;
}
</style>
</head>
<body>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<div id='map'></div>
<script>
L.mapbox.accessToken = 'MY-ACCESS-TOKEN';
var map = L.mapbox.map('map', 'mapbox.streets').setView([40, -80], 5);
d3.json("topoJSON_noPoints.json", function(error, topology) {
var geodata = topojson.feature(topology, topology.objects.collection)
console.log(geodata)
L.geoJson(geodata, { style: L.mapbox.simplestyle.style }).addTo(map);
});
</script>
</body>
</html>
Do you ever have a similar problem? Thanks!