Maps SDK for Web

Class L.MessageBox

Makes it easy to display a message notification over a map.

Constructor

L.MessageBox([options])

Parameters
Name Description Required Type/Values Default
options No Object None
options.closeable Show the close button No Boolean true
options.closeAfter Number of milliseconds after which the control will be automatically closed. If value is 0 it will not be closed automatically, which is the default behaviour. No Number 0
Example
var mBox = new L.MessageBox({
  content:'Hello world',
  closeAfter: 1000
});
mBox.addTo(map);

Methods

setContent(content): L.MessageBox Chainable

Sets the HTML content of the message box.

Parameters
Name Description Required Type/Values Default
content The text or HTMLElement to be a content of the message box Yes String | HTMLElement None
Returns