jVectorMap custom zoom buttons

user1514042 picture user1514042 · Feb 11, 2013 · Viewed 13k times · Source

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.

Answer

Blas Ruiz picture Blas Ruiz · Mar 12, 2013

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);