Coder Social home page Coder Social logo

Scroll-wheel zoom? about jqvmap HOT 6 CLOSED

10bestdesign avatar 10bestdesign commented on September 13, 2024 1
Scroll-wheel zoom?

from jqvmap.

Comments (6)

maadr avatar maadr commented on September 13, 2024 1

I solved it by using this mousewheel plugin.

Then just use this code, which simply triggers click on zoom buttons when mouse is scrolled.

$('#map').on('mousewheel', function(event, delta, deltaX, deltaY) {
    event.preventDefault();
    if(delta == 1){
        $('.jqvmap-zoomin').trigger('click');
    } else {
        $('.jqvmap-zoomout').trigger('click');
    }
});

anyway, this always zooms to the center of map, so if you want to make it zoom to your cursor, you need to tweak it a bit.

from jqvmap.

bjornd avatar bjornd commented on September 13, 2024

The scroll-wheel zoom is supported by the jVectorMap (https://github.com/bjornd/jvectormap), library from which jqvmap was forked from and which now have much more features than this one.

from jqvmap.

Anahkiasen avatar Anahkiasen commented on September 13, 2024

+1 for this

from jqvmap.

githistory avatar githistory commented on September 13, 2024

but what sucks about jVectorMap is that it assumes that your data stays in the same range when it comes to color scale and if you swap another set of data whose points are all larger than initial set, the max color will simply be taken for all regions. The color scale is then lost.

from jqvmap.

DenysVuika avatar DenysVuika commented on September 13, 2024

Zooming is simply not working with this project.

from jqvmap.

er1c avatar er1c commented on September 13, 2024

@janmadr Do you have an updated version of this? I'm noticing that both the if and else are getting called in rapid success resulting in flash attack: http://screencast.com/t/uBThnLQvv

from jqvmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.