diff --git a/Leaflet.Control.Custom.js b/Leaflet.Control.Custom.js index 0f2589d..8120c75 100644 --- a/Leaflet.Control.Custom.js +++ b/Leaflet.Control.Custom.js @@ -56,6 +56,15 @@ L.DomEvent.off(this.container, event, this.options.events[event], this.container); } }, + setContent: function (content) { + if (!this.container) + { + return this; + } + + this.container.innerHTML = content; + return this; + } }); L.control.custom = function (options) { diff --git a/README.md b/README.md index 3f91b5f..f1891ab 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,10 @@ position | "topleft", "topright", "bottomleft", "bottomright" | "topright" | map | datas | Object | - | wrapper div element's data(s) [MDN HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset) | events | Object | - | wrapper div element's event(s) and its callbacks - +## Methods +Method | Description +:--- | :--- +setContent(string) | Replaces the control's content with `string` ## License