As you can see I'm trying to maximally zoom the map to show two points based on their coordinates
What is a problem, when you click on 2 the zooming work properly, but on 1 the map is zoomed to far - I'm trying to figure out what is wrong witch my calculation that it work only in some cases.
As you can see in function calcZoom I'm calculating zoom based on centroid of this two coordinates and bbox.
Hi guys,
I'm working on project with your library and this is what I got
https://codesandbox.io/s/react-simple-maps-switching-topojson-on-zoom-forked-1s4qh?file=/src/index.js
As you can see I'm trying to maximally zoom the map to show two points based on their coordinates
What is a problem, when you click on 2 the zooming work properly, but on 1 the map is zoomed to far - I'm trying to figure out what is wrong witch my calculation that it work only in some cases.
As you can see in function
calcZoom
I'm calculating zoom based on centroid of this two coordinates and bbox.If someone can help be would be greatfull.
Best!