So I have a simple map divided into different states and everytime I click one state I want it to zoom in into that region, so it fills the screen.
I'm using Mapael with the zoom enabled, but when I specify a region, see the code below, it does zoom in but then it zooms back when i try to pan around or zoom closer. What can I do to make it smoother? Like if it was a "natural" zoom in? Thank you!
$(document).ready(function() {
$('path').click(function() {
$('svg').each(function() {
$(this)[0].setAttribute('viewBox', '256 68 600 300');
});
});
});