Giter VIP home page Giter VIP logo

Comments (10)

bradcornford avatar bradcornford commented on July 18, 2024

This is the functionality of Google Maps by default, if you want to alter this behaviour you would have to add a script along the line of the below to stop mouse wheel.

map_0.disableScrollWheelZoom();

from googlmapper.

Sennik avatar Sennik commented on July 18, 2024

Yes, I know this is default behavior of Google Maps. But how often will users use this functionality full screen? In most cases it will be a part of the page like for example a map just above (or inside) the footer (with address etc). So a visitors scrolls over it with his mousewheel and suddenly scrolling stops and the map starts zooming in or out, depending on the scroll direction. An extra option in GooglMapper like 'scrollwheelzoom' => false will come in very handy for a lot of users.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Oh, I understand what you are suggesting now, i assumed you wanted to remove scroll wheel zoom from all maps.

On another note, i have now introduced a new "scrollWheelZoom" option which can either be set in the config.php, or passed via construction of a map. This is currently on the develop branch, and can be used as follows:

Mapper::map(53.38112899, -1.47008500 ['markers' => ['title' => 'Marker Title'], 'scrollWheelZoom' => false]);

or

   /*
    |--------------------------------------------------------------------------
    | Scroll wheel Zoom
    |--------------------------------------------------------------------------
    |
    | Set if scroll wheel zoom should be used by Googlmapper.
    |
    */
    'scrollWheelZoom' => true,

Does this fulfill your requirements?

from googlmapper.

Sennik avatar Sennik commented on July 18, 2024

This looks great! I will try it when I am able to work on the project. Should be today. Thanks sofar!

from googlmapper.

Sennik avatar Sennik commented on July 18, 2024

Sorry I had to let you wait but my project is still in development and not ready for the map yet. I pulled in de delopment branch with composer: "cornford/googlmapper": "dev-master"

The map is still zooming when I pass it while scrolling through the page with the scroll wheel.

I added:

/*
 |--------------------------------------------------------------------------
 | Scroll wheel Zoom
 |--------------------------------------------------------------------------
 |
 | Set if scroll wheel zoom should be used by Googlmapper.
 |
 */
'scrollWheelZoom' => false,

to the googlmapper.php config file. Also tried putting it in the construction, same result.

Did you remove the function by accident or am I doing something wrong?

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Hi again,

No you'd have to pull in "cornford/googlmapper": "dev-develop" as your dependency to use this functionality.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Did you have any luck with this?

from googlmapper.

Sennik avatar Sennik commented on July 18, 2024

Yes I have. Used it yesterday with success. Thank you!

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Okay, i'll get this versioned into master sometime today. Thanks for your help!

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

This has now been merged to master and version as 2.3.0.

from googlmapper.

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.