attribution control docs
This commit is contained in:
parent
71b31417fe
commit
ed57a989dc
@ -44,7 +44,7 @@
|
||||
<li><a href="#map-usage">Usage example</a></li>
|
||||
<li><a href="#map-constructor">Constructor</a></li>
|
||||
<li><a href="#map-options">Options</a></li>
|
||||
<li><a href="#map-interaction-handlers">Interaction handlers</a></li>
|
||||
<li><a href="#map-properties">Properties</a></li>
|
||||
<li><a class="nodocs" href="#map-events">Events</a></li>
|
||||
</ul>
|
||||
<h4>Map methods</h4>
|
||||
@ -87,7 +87,7 @@
|
||||
<h4>Controls</h4>
|
||||
<ul>
|
||||
<li><a href="#control-zoom">Zoom</a></li>
|
||||
<li><a class="nodocs" href="#control-attribution">Attribution</a></li>
|
||||
<li><a href="#control-attribution">Attribution</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span-3">
|
||||
@ -236,12 +236,16 @@ map.addLayer(cloudmade);</code></pre>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3 id="map-interaction-handlers">Interaction handlers</h3>
|
||||
<h3 id="map-properties">Properties</h3>
|
||||
|
||||
<p>Interaction handlers are properties of a map instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see <a href="#ihandler">IHandler</a> methods). Example:</p>
|
||||
<p>Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see <a href="#ihandler">IHandler</a> methods). Example:</p>
|
||||
|
||||
<pre><code class="javascript">map.doubleClickZoom.disable();</code></pre>
|
||||
|
||||
<p>You can also access default map controls like attribution control through map properties:</p>
|
||||
|
||||
<pre><code class="javascript">map.attributionControl.addAttribution("Earthquake data &copy; GeoNames");</code></pre>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
@ -273,6 +277,11 @@ map.addLayer(cloudmade);</code></pre>
|
||||
<td><a href="#ihandler">IHandler</a></td>
|
||||
<td>Shift-drag zoom handler.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>attributionControl</td>
|
||||
<td><a href="#control-attribution">Control.Attribution</a></td>
|
||||
<td>Attribution control.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@ -1362,6 +1371,49 @@ map.addLayer(polyline);</code></pre>
|
||||
<td>Creates a zoom control.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2 id="control-attribution">L.Control.Attribution</h2>
|
||||
|
||||
<p>The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its <code>attributionControl</code> option to <code>false</code>, and it fetches attribution texts from layers with <code>getAttribution</code> method automatically. Implements <a href="#icontrol">IControl</a> interface.</p>
|
||||
|
||||
<h3>Constructor</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Constructor</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>L.Control.Attribution()</code></td>
|
||||
<td>Creates an attribution control.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Methods</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th>Returns</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>setPrefix( <String> <i>prefix</i> )</code></td>
|
||||
<td>-</td>
|
||||
<td>Sets the string before the attributions ("Powered by Leaflet" by default).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>addAttribution( <String> <i>text</i> )</code></td>
|
||||
<td>-</td>
|
||||
<td>Adds an attribution text (e.g. "Vector data &copy; CloudMade").</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>removeAttribution( <String> <i>text</i> )</code></td>
|
||||
<td>-</td>
|
||||
<td>Removes an attribution text.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2 id="ihandler">IHandler</h2>
|
||||
|
Loading…
Reference in New Issue
Block a user