commit 1996f6191cb469a77e00beb656f6a95bef946c1b
parent 9679d57d26d956c976d198bd06fdae793b19d622
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 10 Dec 2016 00:52:30 +0300
[configure layers] button with icon instead of text
Diffstat:
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/lib/leaflet.control.layers.configure/index.js b/src/lib/leaflet.control.layers.configure/index.js
@@ -13,7 +13,7 @@ function enableConfig(control, layers) {
enableTopRow(control);
L.Util.extend(control, {
- configEnabled: true,
+ _configEnabled: true,
_allLayersGroups: layers,
_allLayers: [].concat(...layers.map(group => group.layers)),
@@ -25,7 +25,7 @@ function enableConfig(control, layers) {
__injectConfigButton: function() {
const configButton = L.DomUtil.create('div', 'button-config');
- configButton.innerHTML = 'More layers';
+ configButton.title = 'Configure layers';
this._topRow.appendChild(configButton);
L.DomEvent.on(configButton, 'click', this._onConfigButtonClick, this);
},
diff --git a/src/lib/leaflet.control.layers.configure/settings.svg b/src/lib/leaflet.control.layers.configure/settings.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" ?><svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">
+ <path d="M0 0h48v48h-48z" fill="none"/>
+ <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97l-.75-5.3c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3c-1.22.51-2.35 1.17-3.38 1.97l-4.98-2.01c-.45-.17-.97 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31c-.08.64-.14 1.29-.14 1.95s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3c1.22-.51 2.35-1.17 3.38-1.97l4.98 2.01c.45.17.97 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zm-14.86 5.05c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z" fill="#707070"/></svg>
+\ No newline at end of file
diff --git a/src/lib/leaflet.control.layers.configure/style.css b/src/lib/leaflet.control.layers.configure/style.css
@@ -1,17 +1,20 @@
.leaflet-control-layers .button-config {
cursor: pointer;
- width: auto;
+ width: 18px;
+ height: 18px;
margin-right: auto;
- height: 18px;
+
border-radius: 4px;
border: 1px solid #ccc;
background-color: white;
- padding: 0 4px;
- font-weight: bold;
- color: #777777;
float: left;
+
+ background-image: url("settings.svg");
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ background-size: 16px 16px;
}
.leaflet-control-layers .button-config:hover {