With jVectorMap is it possible to hide zoom buttons and call Zoom In/Out using their API? I've checked the API documentation and couldn't find any methods, causing the map re-zoom.
On a side note, you can also disable/enable zooming on scroll using
zoomOnScroll: false
Sure.
Hide the buttons:
$('#map').vectorMap({
map: 'world_mill_en',
zoomButtons : false
});
Get reference to the map:
map = $("#world-map-gdp").vectorMap('get', 'mapObject');
Set the zoom level:
map.setScale(4);
There's no such feature a this moment. But...
I strongly encourage you to create the feature request so the devs behind the project can actually know what are the real needs.
Looking trough the mentioned feature request, I can see there is a parameter to hide zoom buttons. So you will need to build your maps passing a zoomButtons
attribute to false
:
$('#map').vectorMap({
map: 'world_mill_en',
zoomButtons : false
});
The other thing you are looking for (zoom in/out via API), I think if you are really sure there's no way to do it, you should create an issue masked as a feature request.
Months after my answer was posted, the feature got released see that answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With