Comments (10)
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.
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.
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.
This looks great! I will try it when I am able to work on the project. Should be today. Thanks sofar!
from googlmapper.
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.
Hi again,
No you'd have to pull in "cornford/googlmapper": "dev-develop" as your dependency to use this functionality.
from googlmapper.
Did you have any luck with this?
from googlmapper.
Yes I have. Used it yesterday with success. Thank you!
from googlmapper.
Okay, i'll get this versioned into master sometime today. Thanks for your help!
from googlmapper.
This has now been merged to master and version as 2.3.0.
from googlmapper.
Related Issues (20)
- Map Drag Event (Livewire) HOT 3
- Can you get lat/lng of clicked location? HOT 1
- Map not rendering when parent element is hidden HOT 1
- Map disappers when changing livewire model HOT 6
- gpx HOT 1
- Display KML/KMZ HOT 3
- Error Google Maps JavaScript API error: InvalidKeyMapError HOT 2
- Cornford\Googlmapper\Exceptions\MapperInstanceException No map found to add a polyline to. HOT 3
- Add new icon by click on the map view
- Drawing Layer (Library) HOT 1
- Laravel 9 support: illuminate/support v9.0? HOT 3
- Add listener 'click' on polyline ?
- DrawingManager Displayed twice based on React-18 upgrade HOT 1
- Re-rendering google
- eventClick on marker get Zoom
- Recenter Map With Livewire HOT 3
- labelClass doesnt work
- Bad Method Call Exception - Method Illuminate\Foundation\Application::share does not exist.
- Laravel 10 HOT 4
- Laravel 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlmapper.