maptemplates
maptemplates copied to clipboard
Use d3.geoBounds() instead of turf.extent()?
turf.extent(areas)
// [-8.607227544131755,49.91001820137803,1.7629159475701766,60.84535348677859]
d3.geoBounds(areas)
// [[-8.607227544131755,49.91001820137803],[1.7629159475701766,60.84535348677859]]
It looks like we could avoid the 546 kB Turf JavaScript file by using d3.geoBounds.
Hmmmm... I think the Turf function might run a lot faster than the D3 function. The D3 one does lots of fancy maths: https://www.jasondavies.com/maps/bounds/
Possibly faster than D3: https://stackoverflow.com/a/35692917