Simple Leaflet control to open a Boostrap modal
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE Initial commit Feb 15, 2016 Doc update re demo Feb 15, 2016
leaflet-bootstrapmodal.css Initial commit Feb 15, 2016
leaflet-bootstrapmodal.js Initial commit Feb 15, 2016


A simple Leaflet control to open a Bootstrap modal.

Modals are great for help panels, or for feedback forms, or for displaying a legend that doesn't need to take up screen space all the time. And if you want a Leaflet-styled button on your map, which would trigger this modal... here's the plugin for you.


For a quick start, see the example folder, or the live demo:

Assuming that you already have a Bootstrap modal set up on your page, and already have a Leaflet map running, the control runs like this:

new L.Control.BootstrapModal({
    modalId: 'modal_help',
    tooltip: "How to use this thing",
    glyph: 'question-sign'

Parameters are:

  • modalId -- The DOM ID of the modal, e.g. what you put inside the id="" part. Required

  • tooltip -- A tooltip to be displayed when the user hovers their mouse over the button. Optional

  • glyph -- Which of the Bootstrap Glyphicons to display in the button. See for the full list. Optional and defaults to a "i" icon.