question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to prevent double click zoom when user click on a marker

See original GitHub issue

Hey 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. zoomok

Unexpected double click zoom zoomnotok

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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

3reactions
istarkovcommented, Feb 14, 2017

Thanks to @alex-e-leon without that PR this workaround will never work 😉

1reaction
istarkovcommented, Feb 14, 2017

Set disableDoubleClickZoom: true in options props when you hover the marker.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found