Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ka7eh committed Jul 19, 2018
1 parent c1307d1 commit c843e33
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
0.3.4 (2018-07-19)
* Bug fix: throw error if `addLegend` is called before control is added to the map

0.3.3 (2018-07-13)
* Add support for disabling visibility controls (see `options`)

Expand Down
2 changes: 1 addition & 1 deletion dist/L.Control.HtmlLegend.js

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

2 changes: 1 addition & 1 deletion dist/L.Control.HtmlLegend.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -332,6 +332,7 @@
visibleIcon: 'icon icon-eye',
hiddenIcon: 'icon icon-eye-slash'
})
map.addControl(htmlLegend1and2)

htmlLegend1and2.addLegend({
name: 'Layer 2',
Expand All @@ -346,7 +347,6 @@
}
}]
})
map.addControl(htmlLegend1and2)

var htmlLegend3 = L.control.htmllegend({
position: 'bottomright',
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "leaflet-html-legend",
"version": "0.3.3",
"version": "0.3.4",
"description": "Leaflet legend plugin using html elements",
"homepage": "http://github.com/consbio/Leaflet.HtmlLegend",
"author": {
Expand Down
2 changes: 2 additions & 0 deletions src/L.Control.HtmlLegend.js
Expand Up @@ -51,7 +51,9 @@ L.Control.HtmlLegend = L.Control.extend({
addLegend(legend) {
if (this._map) {
this._renderLegend(legend);
return this._lastId;
}
throw Error('Legend control must be added to the map first.')
},

removeLegend(itemIdx) {
Expand Down

0 comments on commit c843e33

Please sign in to comment.