attribution control docs

This commit is contained in:
Mourner 2011-04-15 14:46:55 +03:00
parent 71b31417fe
commit ed57a989dc

View File

@ -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 &amp;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( &lt;String&gt;&nbsp;<i>prefix</i>&nbsp;)</code></td>
<td>-</td>
<td>Sets the string before the attributions ("Powered by Leaflet" by default).</td>
</tr>
<tr>
<td><code>addAttribution( &lt;String&gt;&nbsp;<i>text</i>&nbsp;)</code></td>
<td>-</td>
<td>Adds an attribution text (e.g. "Vector data &amp;copy; CloudMade").</td>
</tr>
<tr>
<td><code>removeAttribution( &lt;String&gt;&nbsp;<i>text</i>&nbsp;)</code></td>
<td>-</td>
<td>Removes an attribution text.</td>
</tr>
</table>
<h2 id="ihandler">IHandler</h2>