From 20915a83fa98233ce66b3d855dcc77322cd0c3cc Mon Sep 17 00:00:00 2001 From: Alexander Parshin Date: Wed, 10 Oct 2012 03:05:12 +0400 Subject: [PATCH 1/2] Allow HTML in Layer Names (issue #1009) --- dist/leaflet.css | 8 ++++---- src/control/Control.Layers.js | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/leaflet.css b/dist/leaflet.css index 18ca7a14..a9e44fd9 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -122,7 +122,7 @@ .leaflet-control-zoom a { background-color: rgba(255, 255, 255, 0.75); } -.leaflet-control-zoom a, .leaflet-control-layers a { +.leaflet-control-zoom a, .leaflet-control-layers-toggle { background-position: 50% 50%; background-repeat: no-repeat; display: block; @@ -156,12 +156,12 @@ -webkit-border-radius: 8px; border-radius: 8px; } -.leaflet-control-layers a { +.leaflet-control-layers-toggle { background-image: url(images/layers.png); width: 36px; height: 36px; } -.leaflet-touch .leaflet-control-layers a { +.leaflet-touch .leaflet-control-layers-toggle { width: 44px; height: 44px; } @@ -179,7 +179,7 @@ color: #333; background: #fff; } -.leaflet-control-layers input { +.leaflet-control-layers-selector { margin-top: 2px; position: relative; top: 1px; diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index b968b1aa..c8985b1f 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -136,7 +136,7 @@ L.Control.Layers = L.Control.extend({ // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe) _createRadioElement: function (name, checked) { - var radioHtml = ' Date: Fri, 12 Oct 2012 00:03:55 +0400 Subject: [PATCH 2/2] fix indent symbols --- src/control/Control.Layers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index c8985b1f..184c8290 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -156,7 +156,7 @@ L.Control.Layers = L.Control.extend({ if (obj.overlay) { input = document.createElement('input'); input.type = 'checkbox'; - input.className = 'leaflet-control-layers-selector'; + input.className = 'leaflet-control-layers-selector'; input.defaultChecked = checked; } else { input = this._createRadioElement('leaflet-base-layers', checked); @@ -166,8 +166,8 @@ L.Control.Layers = L.Control.extend({ L.DomEvent.on(input, 'click', this._onInputClick, this); - var name = document.createElement('span'); - name.innerHTML = ' ' + obj.name; + var name = document.createElement('span'); + name.innerHTML = ' ' + obj.name; label.appendChild(input); label.appendChild(name);