Legacy
Mapbox.js is no longer in active development. To learn more about our newer mapping tools see Mapbox GL JS.
You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.
L.mapbox.shareControl(id|url, options)
Adds a "Share" button to the map, which can be used to share the map to Twitter or Facebook, or generate HTML for a map embed.
Extends: L.Control
Options | Value | Description |
---|---|---|
id or url optional | string | Either a
|
options | object | Options for L.Control Also accepts the following options:
|
Example:
var map = L.map('map', 'mapbox.streets')
.setView([37, -77], 5)
.addControl(L.mapbox.shareControl());
Returns:
Returns a L.mapbox.shareControl
object.