From 8b742a024ec23c692c7d51187572b86b83de0d0c Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 25 Jun 2013 15:44:33 +1200 Subject: [PATCH] Don't add mouseover/out listeners to the layers control on android, otherwise your first touch will do mouseover, showing the list and click, clicking an item. Fixes #1694 --- src/control/Control.Layers.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index 5426134c..4a4d72bc 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -78,10 +78,11 @@ L.Control.Layers = L.Control.extend({ var form = this._form = L.DomUtil.create('form', className + '-list'); if (this.options.collapsed) { - L.DomEvent - .on(container, 'mouseover', this._expand, this) - .on(container, 'mouseout', this._collapse, this); - + if (!L.Browser.android) { + L.DomEvent + .on(container, 'mouseover', this._expand, this) + .on(container, 'mouseout', this._collapse, this); + } var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container); link.href = '#'; link.title = 'Layers';