Closed andreizet closed 1 year ago
Hi @andreizet
Unfortunately, the US has a special known case because the path takes the full width, it's impossible to focus on the US by region name.
However there's another way, you can focus using the coordinates, example:
const map = new jsVectorMap({
...
focusOn: {
coords: [37.0902, -95.7129],
scale: 5,
animate: true,
},
...
})
@themustafaomar it makes sense, indeed!
For everyone else having the same issue as I did, another solution is to focus on Mexico and Canada:
regions: ['CA', 'MX']
Hey!
It seems that there is an issue with focusOn when setting the region or regions to US. On any other region, the focus works as it should.
https://codepen.io/andreizet/pen/YzORLNy?editors=0110