wms docs, update geolocation docs

This commit is contained in:
Mourner 2011-05-19 17:17:38 +03:00
parent 8b9f456635
commit 16c1037c4d

View File

@ -65,6 +65,7 @@
<h4>Raster layers</h4>
<ul>
<li><a href="#tilelayer">TileLayer</a></li>
<li><a href="#tilelayer-wms">TileLayer.WMS</a></li>
<li><a href="#imageoverlay">ImageOverlay</a></li>
</ul>
<h4>Vector layers</h4>
@ -73,6 +74,7 @@
<li><a href="#polyline">Polyline</a></li>
<li><a href="#polygon">Polygon</a></li>
<li><a href="#circle">Circle</a></li>
<li><a href="#circlemarker">CircleMarker</a></li>
</ul>
</div>
<div class="span-3">
@ -89,22 +91,13 @@
<li><a href="#control-zoom">Zoom</a></li>
<li><a href="#control-attribution">Attribution</a></li>
</ul>
</div>
<div class="span-3">
<h4>Events</h4>
<ul>
<li><a href="#events">Events methods</a></li>
<li><a href="#event-objects">Event objects</a></li>
</ul>
<h4>Interfaces</h4>
<ul>
<li><a href="#ihandler">IHandler</a></li>
<li><a class="nodocs" href="#">ILayer</a></li>
<li><a class="nodocs" href="#">IControl</a></li>
<li><a class="nodocs" href="#">IProjection</a></li>
</ul>
</div>
<div class="span-3 last">
<div class="span-3">
<h4>Utility</h4>
<ul>
<li><a class="nodocs" href="#">Class</a></li>
@ -125,6 +118,15 @@
<li><a class="nodocs" href="#">Projection.Mercator</a></li>
</ul> -->
</div>
<div class="span-3 last">
<h4>Interfaces</h4>
<ul>
<li><a href="#ihandler">IHandler</a></li>
<li><a class="nodocs" href="#">ILayer</a></li>
<li><a class="nodocs" href="#">IControl</a></li>
<li><a class="nodocs" href="#">IProjection</a></li>
</ul>
</div>
</div>
<hr />
@ -367,6 +369,11 @@ map.addLayer(cloudmade);</code></pre>
<td><code><a href="#location-event">LocationEvent</a></code>
<td>Fired when geolocation (using <code>locate</code> or <code>locateAndSetView</code> method) went successfully.</td>
</tr>
<tr>
<td><code>locationerror</code></td>
<td><code><a href="#error-event">ErrorEvent</a></code>
<td>Fired when geolocation (using <code>locate</code> or <code>locateAndSetView</code> method) failed.</td>
</tr>
</table>
@ -399,17 +406,17 @@ map.addLayer(cloudmade);</code></pre>
<td>Decreases the zoom of the map by 1.</td>
</tr>
<tr id="map-fitbounds">
<td><code>fitBounds( &lt;LatLngBounds&gt; <i>bounds</i> )</code></td>
<td><code>fitBounds( &lt;LatLngBounds&gt;&nbsp;<i>bounds</i>&nbsp;)</code></td>
<td><code>this</code></td>
<td>Sets a map view that contains the given geographical bounds with the maximum zoom level possible.</td>
</tr>
<tr>
<td><code>panTo( &lt;<a href="#latlng">LatLng</a>&gt; <i>latlng</i> )</code></td>
<td><code>panTo( &lt;<a href="#latlng">LatLng</a>&gt;&nbsp;<i>latlng</i>&nbsp;)</code></td>
<td><code>this</code></td>
<td>Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.</td>
</tr>
<tr>
<td><code>panBy( &lt;<a href="#point">Point</a>&gt; <i>point</i> )</code></td>
<td><code>panBy( &lt;<a href="#point">Point</a>&gt;&nbsp;<i>point</i>&nbsp;)</code></td>
<td><code>this</code></td>
<td>Pans the map by a given number of pixels (animated).</td>
</tr>
@ -419,9 +426,18 @@ map.addLayer(cloudmade);</code></pre>
<td>Checks if the map container size changed and updates the map if so &mdash; call it after you've changed the map size dynamically.</td>
</tr>
<tr>
<td><code>locate( &lt;Boolean&gt;&nbsp;<i>noAutoFitBounds?</i>&nbsp;)</code></td>
<td><code>locate()</code></td>
<td><code>this</code></td>
<td>Tries to locate the user using Geolocation API and zooms the map if successful, firing <code>locationfound</code> (with location data) or <code>locationerror</code> event. Set <code>noAutoFitBounds</code> to <code>true</code> if you don't want the map view to be set automatically (<code>false</code> by default).</td>
<td>Tries to locate the user using Geolocation API, firing <code>locationfound</code> event with location data on success or <code>locationerror</code> event on failure.<!-- Usage example:
<pre><code class="javascript">map
.on('locationfound', function(e) { map.fitBounds(e.bounds); })
.on('locationerror', function(e) { alert(e.message); })
.locate();</code></pre> --></td>
</tr>
<tr>
<td><code>locateAndSetView( &lt;Number&gt;&nbsp;maxZoom&nbsp;)</code></td>
<td><code>this</code></td>
<td>The same as <code>locate</code> method, but it automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). You can optionally specify the maximum zoom of the view.</td>
</tr>
</table>
@ -938,6 +954,77 @@ map.openPopup(popup);</code></pre>
<h2 id="tilelayer-wms">L.TileLayer.WMS</h2>
<p>Used to display WMS services as tile layers on the map. Extends <a href="#tilelayer">TileLayer</a>, implements <a href="#ilayer">ILayer</a> interface.</p>
<h3>Usage example</h3>
<pre><code class="javascript">var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
layers: 'nexrad-n0r-900913',
format: 'image/png',
transparent: true,
attribution: "Weather data &copy; 2011 IEM Nexrad"
});</code></pre>
<h3>Constructor</h3>
<table>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
<tr>
<td><code>L.TileLayer.WMS( &lt;String&gt;&nbsp;<i>baseUrl</i>, &lt;<a href="#tilelayer-wms-options">TileLayer.WMS&nbsp;options</a>&gt;&nbsp;<i>options</i>&nbsp;)</code></td>
<td>Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.</td>
</tr>
</table>
<h3 id="tilelayer-wms-options">Options</h3>
<p>Includes all <a href="#tilelayer-options">TileLayer options</a> and additionally:</p>
<table>
<tr>
<th>Option</th>
<th>Type</th>
<th>Default value</th>
<th>Description</th>
</tr>
<tr>
<td><code>layers</code></td>
<td><code>String</code></td>
<td>-</td>
<td><b>(required)</b> Comma-separated list of WMS layers to show.</td>
</tr>
<tr>
<td><code>styles</code></td>
<td><code>String</code></td>
<td></td>
<td>Comma-separated list of WMS styles.</td>
</tr>
<tr>
<td><code>format</code></td>
<td><code>String</code></td>
<td><code>image/jpeg</code></td>
<td>WMS image format (use 'image/png' for layers with transparency).</td>
</tr>
<tr>
<td><code>transparent</code></td>
<td><code>Boolean</code></td>
<td><code>false</code></td>
<td>If true, the WMS service will return images with transparency.</td>
</tr>
<tr>
<td><code>version</code></td>
<td><code>String</code></td>
<td><code>1.1.1</code></td>
<td>Version of the WMS service to use.</td>
</tr>
</table>
<h2 id="imageoverlay">L.ImageOverlay</h2>
<p>Used to load and display a single image over specific bounds of the map, implements <a href="#ilayer">ILayer</a> interface.</p>
@ -1146,7 +1233,7 @@ map.addLayer(polyline);</code></pre>
<h2 id="circle">L.Circle</h2>
<p>A class for drawing circle overlays on a map. Extends Path. Use <a href="#map-addlayer">Map#addLayer</a> to add it to the map.</p>
<p>A class for drawing circle overlays on a map. Extends <a href="#path">Path</a>. Use <a href="#map-addlayer">Map#addLayer</a> to add it to the map.</p>
<h3>Constructor</h3>
@ -1157,11 +1244,28 @@ map.addLayer(polyline);</code></pre>
</tr>
<tr>
<td><code>L.Circle( &lt;<a href="#latlng">LatLng</a>&gt;&nbsp;<i>latlng</i>, &lt;Number&gt;&nbsp;<i>radius</i>, &lt;<a href="#path-options">Path&nbsp;options</a>&gt;&nbsp;<i>options?</i> )</code></td>
<td>Instantiates a polygon object given an geographical point, a radius in pixels and optionally an options object.</td>
<td>Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.</td>
</tr>
</table>
<h2 id="circlemarker">L.CircleMarker</h2>
<p>A circle of a fixed size with radius specified in pixels. Extends <a href="#circle">Circe</a>. Use <a href="#map-addlayer">Map#addLayer</a> to add it to the map.</p>
<h3>Constructor</h3>
<table>
<tr>
<th>Constructor</th>
<th>Description</th>
</tr>
<tr>
<td><code>L.CircleMarker( &lt;<a href="#latlng">LatLng</a>&gt;&nbsp;<i>latlng</i>, &lt;Number&gt;&nbsp;<i>radius</i>, &lt;<a href="#path-options">Path&nbsp;options</a>&gt;&nbsp;<i>options?</i> )</code></td>
<td>Instantiates a circle marker given a geographical point, a radius in pixels and optionally an options object.</td>
</tr>
</table>
<h2 id="latlng">L.LatLng</h2>
@ -1746,6 +1850,26 @@ var marker = new L.Marker(marker, {icon: icon});</code></pre>
</tr>
</table>
<h3 id="error-event">ErrorEvent</h3>
<table>
<tr>
<th>property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code>message</code></td>
<td><code>String</code></td>
<td>Error message.</td>
</tr>
<tr>
<td><code>code</code></td>
<td><code>Number</code></td>
<td>Error code (if applicable).</td>
</tr>
</table>
<h3 id="layer-event">LayerEvent</h3>
<table>