You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.


Extends: L.Control

A map control that shows a toggleable info container. If set, 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 one additional parameter:
  • 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.


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

Returns: a L.mapbox.infoControl object.

Class: L.mapbox.InfoControl


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.


Removes an info string from infoControl.

Options Value Description
info required string Info to remove.