1L.Control.Messagebox = L.Control.extend({ 2 options: { 3 position: 'topright', 4 timeout: 3000 5 }, 6 7 onAdd: function (map) { 8 this._container = L.DomUtil.create('div', 'leaflet-control-messagebox'); 9 //L.DomEvent.disableClickPropagation(this._container); 10 return this._container; 11 }, 12 13 show: function (message, timeout) { 14 var elem = this._container; 15 elem.innerHTML = message; 16 elem.style.display = 'block'; 17 18 timeout = timeout || this.options.timeout; 19 20 if (typeof this.timeoutID == 'number') { 21 clearTimeout(this.timeoutID); 22 } 23 this.timeoutID = setTimeout(function () { 24 elem.style.display = 'none'; 25 }, timeout); 26 } 27}); 28 29L.Map.mergeOptions({ 30 messagebox: false 31}); 32 33L.Map.addInitHook(function () { 34 if (this.options.messagebox) { 35 this.messagebox = new L.Control.Messagebox(); 36 this.addControl(this.messagebox); 37 } 38}); 39 40L.control.messagebox = function (options) { 41 return new L.Control.Messagebox(options); 42};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.