Search code examples
javascriptjqueryjvectormap

Bind to zooming and dragging at jVectorMap


Does jVectorMap has built-it methods to bind map zooming and map mouse dragging? I did not found them at documentation.

I want to do something like this.

var map = $('#world-map').vectorMap();

map.on('zoom', function(){
    ..
})

Sure i can bind to element where jvectormap was initialized, like

$('#world-map').on('mousewheel', functon(){
    ..
})

But it will looks like 'fast-solution'..


Solution

  • if you use the version 1.1.1, you need add the onViewportChange event in the api events, and in applyTransform method.

    Please check http://pastebin.com/s5GwcEMy