Skip to content

Commit

Permalink
Updated to work with Leaflet 1.4.0
Browse files Browse the repository at this point in the history
Merge pull request #14 from mpuputti/patch-1
  • Loading branch information
vogdb authored Aug 8, 2021
2 parents 90ce9d4 + 2f00271 commit f857b74
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 32 deletions.
24 changes: 0 additions & 24 deletions bower.json

This file was deleted.

4 changes: 2 additions & 2 deletions dist/leaflet.active-layers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet.active-layers",
"version": "0.3.0",
"version": "0.3.1",
"description": "A plugin for the Leaflet library. This plugin adds new L.Control.ActiveLayers with functionality to get currently active layers on the map.",
"repository": {
"type": "git",
Expand All @@ -14,7 +14,7 @@
}
],
"dependencies": {
"leaflet": "~0.7"
"leaflet": ">0.7"
},
"devDependencies": {
"grunt-contrib-watch": "~0.3.1",
Expand Down
13 changes: 9 additions & 4 deletions src/ActiveLayers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Created: vogdb Date: 5/4/13 Time: 1:54 PM
* Version: 0.3.0
* Version: 0.3.1
*/

L.Control.ActiveLayers = L.Control.Layers.extend({
Expand Down Expand Up @@ -104,9 +104,14 @@ L.Control.ActiveLayers = L.Control.Layers.extend({
},

_recountLayers: function () {
var i, input, obj,
inputs = this._form.getElementsByTagName('input'),
inputsLen = inputs.length;
var i, input, obj, inputs, inputsLen
if (this.hasOwnProperty('_section')) {
inputs = this._section.getElementsByTagName('input')
} else {
// Up until version 1.3.6, Leaflet used _form.
inputs = this._form.getElementsByTagName('input')
}
inputsLen = inputs.length;

for (i = 0; i < inputsLen; i++) {
input = inputs[i]
Expand Down

0 comments on commit f857b74

Please sign in to comment.