---
layout: api
title: "v2.1.7 JavaScript Library: L.mapbox.shareControl(id|url, options)"
categories: api
version: v2.1.7
permalink: /api/v2.1.7/l-mapbox-sharecontrol/
---
<h2 id="section-l-mapbox-sharecontrol">L.mapbox.shareControl(id|url, options)</h2>
<p>Adds a &quot;Share&quot; button to the map, which can be used to share the map to Twitter or Facebook, or generate HTML for a map embed.</p>
<p><span class='leaflet icon'><em>Extends</em>: <code><a href="/mapbox.js/api/v2.1.7/l-control">L.Control</a></c