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.

Double click on the legend propagates to the map in Chrome

See original GitHub issue

Google Chrome is now touch-enabled, so L.Browser.touch returns true, meaning line 91 is called instead of lines 93 & 94.

I’m guessing these lines are intended to correct the UX on mobile devices rather than Chrome?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eclectocratcommented, Aug 4, 2021

Kinda late but I added:

    // ... ~ line 240 in the .js
    input.layerId = L.Util.stamp(obj.layer);
    input.groupID = obj.group.id;
    L.DomEvent.on(input, 'click', this._onInputClick, this);

    // I added these lines to keep the control from acting wacky on Chrome
    var stop = L.DomEvent.stopPropagation;
    L.DomEvent.on(input, 'mousedown', stop)
              .on(input, 'touchstart', stop)
              .on(input, 'dblclick', stop)
              .on(input, 'mousewheel', stop)
              .on(input, 'MozMozMousePixelScroll', stop)
1reaction
karlitoscommented, Oct 25, 2017

My current workaround looks like:

var layerControl = L.control.groupedLayers(baseMaps, overlays).addTo(this.map);
L.DomEvent.disableClickPropagation(layerControl._container);
L.DomEvent.disableScrollPropagation(layerControl._container);

This solved the issue so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Map's Double Click Event Propagation - Stack Overflow
Here I bind an event handler to double clicking on the Google Map: var aListener = google.maps.event.addListener(map, 'dblclick', ...
Read more >
Events | Maps JavaScript API - Google Developers
User events (such as "click" mouse events) are propagated from the DOM to the Maps JavaScript API. These events are separate and distinct...
Read more >
Are map legends not clickable in the mobile app? - Google Help
When I use Google Maps in my browser, I can click on the map legends and it shows the location pinned and information....
Read more >
Google earth draw straight line between two points
Select Measure distance from the right-click options. Jul 20, 2016 · Google Maps Draw Route In this post we will develop an Android...
Read more >
Spectrum Spatial Analyst User Guide 22.1 - Precisely Help
Click or touch the Map Legend icon on the upper right side of the map to open the Legend panel. 3. From the...
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