--- layout: api title: "v1.6.1 API: L.mapbox.infoControl(options)" categories: api version: v1.6.1 permalink: /api/v1.6.1/l-mapbox-infocontrol ---

## L.mapbox.infoControl(options)

A map control that shows a toggleable info container. This is triggered by default and attribution is auto-detected from active layers and added to the info container.

Options | Value | Description
--- | --- | ---
options optional | object | An options object. Beyond the default options for map controls, this object has a two additional parameters: `editLink`: A boolean that adds an `Improve this map` link to your map allowing users to make edits to OpenStreetMap from the current map coordinates being viewed. `sanitizer`: A function that accepts a string, and returns a sanitized result for HTML display. The default will remove dangerous script content, and is recommended.

Example:

    var map = L.mapbox.map('map').setView([38, -77], 5);
    map.addControl(L.mapbox.infoControl());

Returns: a `L.mapbox.infoControl` object.

### infoControl.addInfo(info)

Adds an info string to infoControl.

Options | Value | Description
--- | --- | ---
info required | string | A string which may contain HTML. It will be sanitized by the infoControl's sanitizer option.

### infoControl.removeInfo(info)

Removes an info string from infoControl.

Options | Value | Description
--- | --- | ---
info required | string | Info to remove.