3👍
✅
I suggest using country-bounding-boxes which would allow you the following method:
import boundingBoxes from 'country-bounding-boxes/bounding-boxes.json';
export default {
// ...
methods: {
zoomToCountry(isoCode) {
this.map.fitBounds(boundingBoxes[isoCode][1]);
}
}
}
Here’s a pretty basic working demo.
👤tao
Source:stackexchange.com