How to prevent double click zoom when user click on a marker
See original GitHub issueHey guys,
I have a map that display some image galleries cards.
I wan’t to prevent the user to zoom in the map when he double click on the gallery navigation (next, previous) but preserving the double click for zoom when its in on the the map.
disableDoubleClickZoom: true
is not an option. We need the double click zoom on map.
Some gifs explaining what I trying to do.
Expected double click zoom.
Unexpected double click zoom
I already have try some solutions.
Ref
and eventListener
on gallery arrow to stopPropagation
, default onClick stopPropagation
on arrow, event.nativeEvent.stopImmediatePropagation()
… but without success.
Any help will be very appreciate
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
How to disable double click zoom effect in standard map ...
1 Answer 1 · Record time on click & id of marker. · Whenever you get click event on marker. Check if ID...
Read more >How to prevent zoom-in when clicking in the Leaflet table ...
x, I'm finding that when I double-click within the table of contents window the map zooms in. You can test this in the...
Read more >Simple Click Events | Maps JavaScript API
This example demonstrates the use of event listeners. It. listens for the click event on a marker to zoom the map when the...
Read more >Disable all view navigation | Sample Code - ArcGIS Developers
Disable zooming via double-click ... The same function used to prevent zooming with the mouse-wheel gesture may be passed to the event listener...
Read more >Google Maps Events
Google Maps Events · Click The Marker to Zoom · Pan Back to Marker · Open an InfoWindow When Clicking on The Marker...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks to @alex-e-leon without that PR this workaround will never work 😉
Set
disableDoubleClickZoom: true
inoptions
props when you hover the marker.