commit ccd8a159bef494cacf02323aef7a55ed23dd1a96
parent 5f5edcc0b85ed51ca4640ab00df22f3c2ae38514
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Fri, 3 Nov 2017 12:14:31 +0300
[custom layers] fixed position for custom base layers
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lib/leaflet.control.layers.configure/index.js b/src/lib/leaflet.control.layers.configure/index.js
@@ -15,6 +15,11 @@ function enableConfig(control, layers) {
}
enableTopRow(control);
+ control.options = L.Util.extend({
+ customBaseLayersOrder: 999,
+ customOverlaysOrder: 10000
+ }, control.options);
+
L.Util.extend(control, {
_configEnabled: true,
_allLayersGroups: layers,
@@ -370,7 +375,7 @@ ${buttonsHtml}`;
},
- createCustomLayer: function(fieldValues, position, ignoreExists) {
+ createCustomLayer: function(fieldValues) {
const serialized = this.serializeCustomLayer(fieldValues);
const tileLayer = L.tileLayer(fieldValues.url, {
tms: fieldValues.tms,
@@ -390,7 +395,7 @@ ${buttonsHtml}`;
isCustom: true,
serialized: serialized,
layer: tileLayer,
- order: 10000,
+ order: fieldValues.isOverlay ? this.options.customOverlaysOrder : this.options.customBaseLayersOrder,
fieldValues: fieldValues,
enabled: true,
checked: ko.observable(true)