I am trying to load topojson files into openlayers
I use topojson files from https://github.com/deldersveld/topojson/tree/master/continents
When i draw south america it does work:
https://codepen.io/pixelatorz/pen/LdJwzQ?&editors=1010
var raster = new ol.layer.Tile({
source: new ol.source.TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-dark.json?secure'
})
});
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
});
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'https://raw.githubusercontent.com/deldersveld/topojson/master/continents/south-america.json',
format: new ol.format.TopoJSON(),
overlaps: false
}),
style: style
});
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 1
})
});
however when i change the source url to the one of north-america, or europe it does not work, oceania for example does work
example: https://codepen.io/pixelatorz/pen/MVqqqJ?editors=1010
I tested some other topojson files from other sources and some do get drawn others won't, I don't see much difference between the files and can't find what is going wrong.