UNPKG

822 kBHTMLView Raw
1<!DOCTYPE html>
2<html>
3<head>
4 <title></title>
5 <meta charset="utf-8">
6
7 <link rel="stylesheet" href="../docs/docs/css/normalize.css" />
8 <link rel="stylesheet" href="../docs/docs/css/main.css" />
9 <link rel="stylesheet" href="../docs/docs/css/reference.css" />
10 <script src="../docs/docs/highlight/highlight.pack.js"></script>
11 <link rel="stylesheet" href="../docs/docs/highlight/styles/github-gist.css" />
12 <link rel="stylesheet" href="leaflet.css" />
13 <script src="leaflet.js"></script>
14</head>
15<body class='api-page'>
16 <div class='container'>
17
18 <!-- CUT HERE FOR docs/reference-*.html -->
19
20 <h2>Leaflet API reference</h2>
21 <div id="toc" class="clearfix">
22 <div class="toc-col map-col">
23 <h4>Map</h4>
24 <ul>
25 <li><a href="#map-example">Usage example</a></li>
26 <li><a href="#map-factory">Creation</a></li>
27 <li><a href="#map-option">Options</a></li>
28 <li><a href="#map-event">Events</a></li>
29 </ul>
30 <h4>Map Methods</h4>
31 <ul>
32 <li><a href="#map-methods-for-modifying-map-state">Modifying map state</a></li>
33 <li><a href="#map-methods-for-getting-map-state">Getting map state</a></li>
34 <li><a href="#map-methods-for-layers-and-controls">Layers and controls</a></li>
35 <li><a href="#map-conversion-methods">Conversion methods</a></li>
36 <li><a href="#map-other-methods">Other methods</a></li>
37 </ul>
38 <h4>Map Misc</h4>
39 <ul>
40 <li><a href="#map-property">Properties</a></li>
41 <li><a href="#map-pane">Panes</a></li>
42 </ul>
43 </div>
44 <div class="toc-col">
45 <h4>UI Layers</h4>
46 <ul>
47 <li><a href="#marker">Marker</a></li>
48 <li><a href="#popup">Popup</a></li>
49 <li><a href="#tooltip">Tooltip</a></li>
50 </ul>
51 <h4>Raster Layers</h4>
52 <ul>
53 <li><a href="#tilelayer">TileLayer</a></li>
54 <li><a href="#tilelayer-wms">TileLayer.WMS</a></li>
55 <li><a href="#imageoverlay">ImageOverlay</a></li>
56 <li><a href="#videooverlay">VideoOverlay</a></li>
57 </ul>
58 <h4>Vector Layers</h4>
59 <ul>
60 <li><a href="#path">Path</a></li>
61 <li><a href="#polyline">Polyline</a></li>
62 <li><a href="#polygon">Polygon</a></li>
63 <li><a href="#rectangle">Rectangle</a></li>
64 <li><a href="#circle">Circle</a></li>
65 <li><a href="#circlemarker">CircleMarker</a></li>
66 <li><a href="#svgoverlay">SVGOverlay</a></li>
67 <li><a href="#svg">SVG</a></li>
68 <li><a href="#canvas">Canvas</a></li>
69 </ul>
70 </div>
71 <div class="toc-col">
72 <h4>Other Layers</h4>
73 <ul>
74 <li><a href="#layergroup">LayerGroup</a></li>
75 <li><a href="#featuregroup">FeatureGroup</a></li>
76 <li><a href="#geojson">GeoJSON</a></li>
77 <li><a href="#gridlayer">GridLayer</a></li>
78 </ul>
79 <h4>Basic Types</h4>
80 <ul>
81 <li><a href="#latlng">LatLng</a></li>
82 <li><a href="#latlngbounds">LatLngBounds</a></li>
83 <li><a href="#point">Point</a></li>
84 <li><a href="#bounds">Bounds</a></li>
85 <li><a href="#icon">Icon</a></li>
86 <li><a href="#divicon">DivIcon</a></li>
87 </ul>
88 <h4>Controls</h4>
89 <ul>
90 <li><a href="#control-zoom">Zoom</a></li>
91 <li><a href="#control-attribution">Attribution</a></li>
92 <li><a href="#control-layers">Layers</a></li>
93 <li><a href="#control-scale">Scale</a></li>
94 </ul>
95 </div>
96 <div class="toc-col">
97<!-- <h4>Shared Methods</h4> -->
98<!-- <ul> -->
99<!-- <li><a href="#evented">Event</a></li> -->
100<!-- <li><a href="#layers">Layer</a></li> -->
101<!-- <li><a href="#popup">Popup</a></li> -->
102<!-- </ul> -->
103 <h4>Utility</h4>
104 <ul>
105 <li><a href="#browser">Browser</a></li>
106 <li><a href="#util">Util</a></li>
107 <li><a href="#transformation">Transformation</a></li>
108 <li><a href="#lineutil">LineUtil</a></li>
109 <li><a href="#polyutil">PolyUtil</a></li>
110 </ul>
111 <h4>DOM Utility</h4>
112 <ul>
113 <li><a href="#domevent">DomEvent</a></li>
114 <li><a href="#domutil">DomUtil</a></li>
115 <li><a href="#posanimation">PosAnimation</a></li>
116 <li><a href="#draggable">Draggable</a></li>
117 </ul>
118 </div>
119 <div class="toc-col last-col">
120 <h4>Base Classes</h4>
121 <ul>
122 <li><a href="#class">Class</a></li>
123 <li><a href="#evented">Evented</a></li>
124 <li><a href="#layer">Layer</a></li>
125 <li><a href="#interactive-layer">Interactive layer</a></li>
126 <li><a href="#control">Control</a></li>
127 <li><a href="#handler">Handler</a></li>
128 <!--<li><a class="nodocs" href="#">IFeature</a></li>-->
129 <li><a href="#projection">Projection</a></li>
130 <li><a href="#crs">CRS</a></li>
131 <li><a href="#renderer">Renderer</a></li>
132 </ul>
133
134 <h4>Misc</h4>
135 <ul>
136 <li><a href="#event-objects">Event objects</a></li>
137 <li><a href="#global-switches">global switches</a></li>
138 <li><a href="#noconflict">noConflict</a></li>
139 <li><a href="#version">version</a></li>
140 </ul>
141 </div>
142 </div>
143
144 <h2 id='map'>Map</h2><p>The central class of the API — it is used to create a map on a page and manipulate it.</p>
145
146<section>
147<h3 id='map-example'>Usage example</h3>
148
149<section >
150
151
152
153
154
155<pre><code class="lang-js">// initialize the map on the &quot;map&quot; div with a given center and zoom
156var map = L.map(&#39;map&#39;, {
157 center: [51.505, -0.09],
158 zoom: 13
159});
160</code></pre>
161
162
163
164</section>
165
166
167</section><section>
168<h3 id='map-factory'>Creation</h3>
169
170<section >
171
172
173
174
175<table><thead>
176 <tr>
177 <th>Factory</th>
178 <th>Description</th>
179 </tr>
180 </thead><tbody>
181 <tr id='map-l-map'>
182 <td><code><b>L.map</b>(<nobr>&lt;String&gt;</nobr> <i>id</i>, <nobr>&lt;Map options&gt;</nobr> <i>options?</i>)</code></td>
183 <td>Instantiates a map object given the DOM ID of a <code>&lt;div&gt;</code> element
184and optionally an object literal with <code>Map options</code>.</td>
185 </tr>
186 <tr id='map-l-map'>
187 <td><code><b>L.map</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;Map options&gt;</nobr> <i>options?</i>)</code></td>
188 <td>Instantiates a map object given an instance of a <code>&lt;div&gt;</code> HTML element
189and optionally an object literal with <code>Map options</code>.</td>
190 </tr>
191</tbody></table>
192
193</section>
194
195
196</section><section>
197<h3 id='map-option'>Options</h3>
198
199<section >
200
201
202
203
204<table><thead>
205 <tr>
206 <th>Option</th>
207 <th>Type</th>
208 <th>Default</th>
209 <th>Description</th>
210 </tr>
211 </thead><tbody>
212 <tr id='map-prefercanvas'>
213 <td><code><b>preferCanvas</b></code></td>
214 <td><code>Boolean</code></td>
215 <td><code>false</code></td>
216 <td>Whether <a href="#path"><code>Path</code></a>s should be rendered on a <a href="#canvas"><code>Canvas</code></a> renderer.
217By default, all <code>Path</code>s are rendered in a <a href="#svg"><code>SVG</code></a> renderer.</td>
218 </tr>
219</tbody></table>
220
221</section><section class='collapsable'>
222
223<h4 id='map-control-options'>Control options</h4>
224
225
226<table><thead>
227 <tr>
228 <th>Option</th>
229 <th>Type</th>
230 <th>Default</th>
231 <th>Description</th>
232 </tr>
233 </thead><tbody>
234 <tr id='map-attributioncontrol'>
235 <td><code><b>attributionControl</b></code></td>
236 <td><code>Boolean</code></td>
237 <td><code>true</code></td>
238 <td>Whether a <a href="#control-attribution">attribution control</a> is added to the map by default.</td>
239 </tr>
240 <tr id='map-zoomcontrol'>
241 <td><code><b>zoomControl</b></code></td>
242 <td><code>Boolean</code></td>
243 <td><code>true</code></td>
244 <td>Whether a <a href="#control-zoom">zoom control</a> is added to the map by default.</td>
245 </tr>
246</tbody></table>
247
248</section><section class='collapsable'>
249
250<h4 id='map-interaction-options'>Interaction Options</h4>
251
252
253<table><thead>
254 <tr>
255 <th>Option</th>
256 <th>Type</th>
257 <th>Default</th>
258 <th>Description</th>
259 </tr>
260 </thead><tbody>
261 <tr id='map-closepopuponclick'>
262 <td><code><b>closePopupOnClick</b></code></td>
263 <td><code>Boolean</code></td>
264 <td><code>true</code></td>
265 <td>Set it to <code>false</code> if you don&#39;t want popups to close when user clicks the map.</td>
266 </tr>
267 <tr id='map-zoomsnap'>
268 <td><code><b>zoomSnap</b></code></td>
269 <td><code>Number</code></td>
270 <td><code>1</code></td>
271 <td>Forces the map&#39;s zoom level to always be a multiple of this, particularly
272right after a <a href="#map-fitbounds"><code>fitBounds()</code></a> or a pinch-zoom.
273By default, the zoom level snaps to the nearest integer; lower values
274(e.g. <code>0.5</code> or <code>0.1</code>) allow for greater granularity. A value of <code>0</code>
275means the zoom level will not be snapped after <code>fitBounds</code> or a pinch-zoom.</td>
276 </tr>
277 <tr id='map-zoomdelta'>
278 <td><code><b>zoomDelta</b></code></td>
279 <td><code>Number</code></td>
280 <td><code>1</code></td>
281 <td>Controls how much the map&#39;s zoom level will change after a
282<a href="#map-zoomin"><code>zoomIn()</code></a>, <a href="#map-zoomout"><code>zoomOut()</code></a>, pressing <code>+</code>
283or <code>-</code> on the keyboard, or using the <a href="#control-zoom">zoom controls</a>.
284Values smaller than <code>1</code> (e.g. <code>0.5</code>) allow for greater granularity.</td>
285 </tr>
286 <tr id='map-trackresize'>
287 <td><code><b>trackResize</b></code></td>
288 <td><code>Boolean</code></td>
289 <td><code>true</code></td>
290 <td>Whether the map automatically handles browser window resize to update itself.</td>
291 </tr>
292 <tr id='map-boxzoom'>
293 <td><code><b>boxZoom</b></code></td>
294 <td><code>Boolean</code></td>
295 <td><code>true</code></td>
296 <td>Whether the map can be zoomed to a rectangular area specified by
297dragging the mouse while pressing the shift key.</td>
298 </tr>
299 <tr id='map-doubleclickzoom'>
300 <td><code><b>doubleClickZoom</b></code></td>
301 <td><code>Boolean|String</code></td>
302 <td><code>true</code></td>
303 <td>Whether the map can be zoomed in by double clicking on it and
304zoomed out by double clicking while holding shift. If passed
305<code>&#39;center&#39;</code>, double-click zoom will zoom to the center of the
306 view regardless of where the mouse was.</td>
307 </tr>
308 <tr id='map-dragging'>
309 <td><code><b>dragging</b></code></td>
310 <td><code>Boolean</code></td>
311 <td><code>true</code></td>
312 <td>Whether the map be draggable with mouse/touch or not.</td>
313 </tr>
314</tbody></table>
315
316</section><section class='collapsable'>
317
318<h4 id='map-map-state-options'>Map State Options</h4>
319
320
321<table><thead>
322 <tr>
323 <th>Option</th>
324 <th>Type</th>
325 <th>Default</th>
326 <th>Description</th>
327 </tr>
328 </thead><tbody>
329 <tr id='map-crs'>
330 <td><code><b>crs</b></code></td>
331 <td><code><a href='#crs'>CRS</a></code></td>
332 <td><code>L.CRS.EPSG3857</code></td>
333 <td>The <a href="#crs">Coordinate Reference System</a> to use. Don&#39;t change this if you&#39;re not
334sure what it means.</td>
335 </tr>
336 <tr id='map-center'>
337 <td><code><b>center</b></code></td>
338 <td><code><a href='#latlng'>LatLng</a></code></td>
339 <td><code>undefined</code></td>
340 <td>Initial geographic center of the map</td>
341 </tr>
342 <tr id='map-zoom'>
343 <td><code><b>zoom</b></code></td>
344 <td><code>Number</code></td>
345 <td><code>undefined</code></td>
346 <td>Initial map zoom level</td>
347 </tr>
348 <tr id='map-minzoom'>
349 <td><code><b>minZoom</b></code></td>
350 <td><code>Number</code></td>
351 <td><code>*</code></td>
352 <td>Minimum zoom level of the map.
353If not specified and at least one <a href="#gridlayer"><code>GridLayer</code></a> or <a href="#tilelayer"><code>TileLayer</code></a> is in the map,
354the lowest of their <code>minZoom</code> options will be used instead.</td>
355 </tr>
356 <tr id='map-maxzoom'>
357 <td><code><b>maxZoom</b></code></td>
358 <td><code>Number</code></td>
359 <td><code>*</code></td>
360 <td>Maximum zoom level of the map.
361If not specified and at least one <a href="#gridlayer"><code>GridLayer</code></a> or <a href="#tilelayer"><code>TileLayer</code></a> is in the map,
362the highest of their <code>maxZoom</code> options will be used instead.</td>
363 </tr>
364 <tr id='map-layers'>
365 <td><code><b>layers</b></code></td>
366 <td><code>Layer[]</code></td>
367 <td><code>[]</code></td>
368 <td>Array of layers that will be added to the map initially</td>
369 </tr>
370 <tr id='map-maxbounds'>
371 <td><code><b>maxBounds</b></code></td>
372 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
373 <td><code>null</code></td>
374 <td>When this option is set, the map restricts the view to the given
375geographical bounds, bouncing the user back if the user tries to pan
376outside the view. To set the restriction dynamically, use
377<a href="#map-setmaxbounds"><code>setMaxBounds</code></a> method.</td>
378 </tr>
379 <tr id='map-renderer'>
380 <td><code><b>renderer</b></code></td>
381 <td><code><a href='#renderer'>Renderer</a></code></td>
382 <td><code>*</code></td>
383 <td>The default method for drawing vector layers on the map. <a href="#svg"><code>L.SVG</code></a>
384or <a href="#canvas"><code>L.Canvas</code></a> by default depending on browser support.</td>
385 </tr>
386</tbody></table>
387
388</section><section class='collapsable'>
389
390<h4 id='map-animation-options'>Animation Options</h4>
391
392
393<table><thead>
394 <tr>
395 <th>Option</th>
396 <th>Type</th>
397 <th>Default</th>
398 <th>Description</th>
399 </tr>
400 </thead><tbody>
401 <tr id='map-zoomanimation'>
402 <td><code><b>zoomAnimation</b></code></td>
403 <td><code>Boolean</code></td>
404 <td><code>true</code></td>
405 <td>Whether the map zoom animation is enabled. By default it&#39;s enabled
406in all browsers that support CSS3 Transitions except Android.</td>
407 </tr>
408 <tr id='map-zoomanimationthreshold'>
409 <td><code><b>zoomAnimationThreshold</b></code></td>
410 <td><code>Number</code></td>
411 <td><code>4</code></td>
412 <td>Won&#39;t animate zoom if the zoom difference exceeds this value.</td>
413 </tr>
414 <tr id='map-fadeanimation'>
415 <td><code><b>fadeAnimation</b></code></td>
416 <td><code>Boolean</code></td>
417 <td><code>true</code></td>
418 <td>Whether the tile fade animation is enabled. By default it&#39;s enabled
419in all browsers that support CSS3 Transitions except Android.</td>
420 </tr>
421 <tr id='map-markerzoomanimation'>
422 <td><code><b>markerZoomAnimation</b></code></td>
423 <td><code>Boolean</code></td>
424 <td><code>true</code></td>
425 <td>Whether markers animate their zoom with the zoom animation, if disabled
426they will disappear for the length of the animation. By default it&#39;s
427enabled in all browsers that support CSS3 Transitions except Android.</td>
428 </tr>
429 <tr id='map-transform3dlimit'>
430 <td><code><b>transform3DLimit</b></code></td>
431 <td><code>Number</code></td>
432 <td><code>2^23</code></td>
433 <td>Defines the maximum size of a CSS translation transform. The default
434value should not be changed unless a web browser positions layers in
435the wrong place after doing a large <code>panBy</code>.</td>
436 </tr>
437</tbody></table>
438
439</section><section class='collapsable'>
440
441<h4 id='map-panning-inertia-options'>Panning Inertia Options</h4>
442
443
444<table><thead>
445 <tr>
446 <th>Option</th>
447 <th>Type</th>
448 <th>Default</th>
449 <th>Description</th>
450 </tr>
451 </thead><tbody>
452 <tr id='map-inertia'>
453 <td><code><b>inertia</b></code></td>
454 <td><code>Boolean</code></td>
455 <td><code>*</code></td>
456 <td>If enabled, panning of the map will have an inertia effect where
457the map builds momentum while dragging and continues moving in
458the same direction for some time. Feels especially nice on touch
459devices. Enabled by default unless running on old Android devices.</td>
460 </tr>
461 <tr id='map-inertiadeceleration'>
462 <td><code><b>inertiaDeceleration</b></code></td>
463 <td><code>Number</code></td>
464 <td><code>3000</code></td>
465 <td>The rate with which the inertial movement slows down, in pixels/second².</td>
466 </tr>
467 <tr id='map-inertiamaxspeed'>
468 <td><code><b>inertiaMaxSpeed</b></code></td>
469 <td><code>Number</code></td>
470 <td><code>Infinity</code></td>
471 <td>Max speed of the inertial movement, in pixels/second.</td>
472 </tr>
473 <tr id='map-easelinearity'>
474 <td><code><b>easeLinearity</b></code></td>
475 <td><code>Number</code></td>
476 <td><code>0.2</code></td>
477 <td></td>
478 </tr>
479 <tr id='map-worldcopyjump'>
480 <td><code><b>worldCopyJump</b></code></td>
481 <td><code>Boolean</code></td>
482 <td><code>false</code></td>
483 <td>With this option enabled, the map tracks when you pan to another &quot;copy&quot;
484of the world and seamlessly jumps to the original one so that all overlays
485like markers and vector layers are still visible.</td>
486 </tr>
487 <tr id='map-maxboundsviscosity'>
488 <td><code><b>maxBoundsViscosity</b></code></td>
489 <td><code>Number</code></td>
490 <td><code>0.0</code></td>
491 <td>If <code>maxBounds</code> is set, this option will control how solid the bounds
492are when dragging the map around. The default value of <code>0.0</code> allows the
493user to drag outside the bounds at normal speed, higher values will
494slow down map dragging outside bounds, and <code>1.0</code> makes the bounds fully
495solid, preventing the user from dragging outside the bounds.</td>
496 </tr>
497</tbody></table>
498
499</section><section class='collapsable'>
500
501<h4 id='map-keyboard-navigation-options'>Keyboard Navigation Options</h4>
502
503
504<table><thead>
505 <tr>
506 <th>Option</th>
507 <th>Type</th>
508 <th>Default</th>
509 <th>Description</th>
510 </tr>
511 </thead><tbody>
512 <tr id='map-keyboard'>
513 <td><code><b>keyboard</b></code></td>
514 <td><code>Boolean</code></td>
515 <td><code>true</code></td>
516 <td>Makes the map focusable and allows users to navigate the map with keyboard
517arrows and <code>+</code>/<code>-</code> keys.</td>
518 </tr>
519 <tr id='map-keyboardpandelta'>
520 <td><code><b>keyboardPanDelta</b></code></td>
521 <td><code>Number</code></td>
522 <td><code>80</code></td>
523 <td>Amount of pixels to pan when pressing an arrow key.</td>
524 </tr>
525</tbody></table>
526
527</section><section class='collapsable'>
528
529<h4 id='map-mouse-wheel-options'>Mouse wheel options</h4>
530
531
532<table><thead>
533 <tr>
534 <th>Option</th>
535 <th>Type</th>
536 <th>Default</th>
537 <th>Description</th>
538 </tr>
539 </thead><tbody>
540 <tr id='map-scrollwheelzoom'>
541 <td><code><b>scrollWheelZoom</b></code></td>
542 <td><code>Boolean|String</code></td>
543 <td><code>true</code></td>
544 <td>Whether the map can be zoomed by using the mouse wheel. If passed <code>&#39;center&#39;</code>,
545it will zoom to the center of the view regardless of where the mouse was.</td>
546 </tr>
547 <tr id='map-wheeldebouncetime'>
548 <td><code><b>wheelDebounceTime</b></code></td>
549 <td><code>Number</code></td>
550 <td><code>40</code></td>
551 <td>Limits the rate at which a wheel can fire (in milliseconds). By default
552user can&#39;t zoom via wheel more often than once per 40 ms.</td>
553 </tr>
554 <tr id='map-wheelpxperzoomlevel'>
555 <td><code><b>wheelPxPerZoomLevel</b></code></td>
556 <td><code>Number</code></td>
557 <td><code>60</code></td>
558 <td>How many scroll pixels (as reported by <a href="#domevent-getwheeldelta">L.DomEvent.getWheelDelta</a>)
559mean a change of one full zoom level. Smaller values will make wheel-zooming
560faster (and vice versa).</td>
561 </tr>
562</tbody></table>
563
564</section><section class='collapsable'>
565
566<h4 id='map-touch-interaction-options'>Touch interaction options</h4>
567
568
569<table><thead>
570 <tr>
571 <th>Option</th>
572 <th>Type</th>
573 <th>Default</th>
574 <th>Description</th>
575 </tr>
576 </thead><tbody>
577 <tr id='map-tap'>
578 <td><code><b>tap</b></code></td>
579 <td><code>Boolean</code></td>
580 <td><code>true</code></td>
581 <td>Enables mobile hacks for supporting instant taps (fixing 200ms click
582delay on iOS/Android) and touch holds (fired as <code>contextmenu</code> events).</td>
583 </tr>
584 <tr id='map-taptolerance'>
585 <td><code><b>tapTolerance</b></code></td>
586 <td><code>Number</code></td>
587 <td><code>15</code></td>
588 <td>The max number of pixels a user can shift his finger during touch
589for it to be considered a valid tap.</td>
590 </tr>
591 <tr id='map-touchzoom'>
592 <td><code><b>touchZoom</b></code></td>
593 <td><code>Boolean|String</code></td>
594 <td><code>*</code></td>
595 <td>Whether the map can be zoomed by touch-dragging with two fingers. If
596passed <code>&#39;center&#39;</code>, it will zoom to the center of the view regardless of
597where the touch events (fingers) were. Enabled for touch-capable web
598browsers except for old Androids.</td>
599 </tr>
600 <tr id='map-bounceatzoomlimits'>
601 <td><code><b>bounceAtZoomLimits</b></code></td>
602 <td><code>Boolean</code></td>
603 <td><code>true</code></td>
604 <td>Set it to false if you don&#39;t want the map to zoom beyond min/max zoom
605and then bounce back when pinch-zooming.</td>
606 </tr>
607</tbody></table>
608
609</section>
610
611
612</section><section>
613<h3 id='map-event'>Events</h3>
614
615<section class='collapsable'>
616
617<h4 id='map-layer-events'>Layer events</h4>
618
619
620<table><thead>
621 <tr>
622 <th>Event</th>
623 <th>Data</th>
624 <th>Description</th>
625 </tr>
626 </thead><tbody>
627 <tr id='map-baselayerchange'>
628 <td><code><b>baselayerchange</b></code></td>
629 <td><code><a href='#layerscontrolevent'>LayersControlEvent</a></code></td>
630 <td>Fired when the base layer is changed through the <a href="#control-layers">layers control</a>.</td>
631 </tr>
632 <tr id='map-overlayadd'>
633 <td><code><b>overlayadd</b></code></td>
634 <td><code><a href='#layerscontrolevent'>LayersControlEvent</a></code></td>
635 <td>Fired when an overlay is selected through the <a href="#control-layers">layers control</a>.</td>
636 </tr>
637 <tr id='map-overlayremove'>
638 <td><code><b>overlayremove</b></code></td>
639 <td><code><a href='#layerscontrolevent'>LayersControlEvent</a></code></td>
640 <td>Fired when an overlay is deselected through the <a href="#control-layers">layers control</a>.</td>
641 </tr>
642 <tr id='map-layeradd'>
643 <td><code><b>layeradd</b></code></td>
644 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
645 <td>Fired when a new layer is added to the map.</td>
646 </tr>
647 <tr id='map-layerremove'>
648 <td><code><b>layerremove</b></code></td>
649 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
650 <td>Fired when some layer is removed from the map</td>
651 </tr>
652</tbody></table>
653
654</section><section class='collapsable'>
655
656<h4 id='map-map-state-change-events'>Map state change events</h4>
657
658<div class='section-comments'></div>
659
660<table><thead>
661 <tr>
662 <th>Event</th>
663 <th>Data</th>
664 <th>Description</th>
665 </tr>
666 </thead><tbody>
667 <tr id='map-zoomlevelschange'>
668 <td><code><b>zoomlevelschange</b></code></td>
669 <td><code><a href='#event'>Event</a></code></td>
670 <td>Fired when the number of zoomlevels on the map is changed due
671to adding or removing a layer.</td>
672 </tr>
673 <tr id='map-resize'>
674 <td><code><b>resize</b></code></td>
675 <td><code><a href='#resizeevent'>ResizeEvent</a></code></td>
676 <td>Fired when the map is resized.</td>
677 </tr>
678 <tr id='map-unload'>
679 <td><code><b>unload</b></code></td>
680 <td><code><a href='#event'>Event</a></code></td>
681 <td>Fired when the map is destroyed with <a href="#map-remove">remove</a> method.</td>
682 </tr>
683 <tr id='map-viewreset'>
684 <td><code><b>viewreset</b></code></td>
685 <td><code><a href='#event'>Event</a></code></td>
686 <td>Fired when the map needs to redraw its content (this usually happens
687on map zoom or load). Very useful for creating custom overlays.</td>
688 </tr>
689 <tr id='map-load'>
690 <td><code><b>load</b></code></td>
691 <td><code><a href='#event'>Event</a></code></td>
692 <td>Fired when the map is initialized (when its center and zoom are set
693for the first time).</td>
694 </tr>
695 <tr id='map-zoomstart'>
696 <td><code><b>zoomstart</b></code></td>
697 <td><code><a href='#event'>Event</a></code></td>
698 <td>Fired when the map zoom is about to change (e.g. before zoom animation).</td>
699 </tr>
700 <tr id='map-movestart'>
701 <td><code><b>movestart</b></code></td>
702 <td><code><a href='#event'>Event</a></code></td>
703 <td>Fired when the view of the map starts changing (e.g. user starts dragging the map).</td>
704 </tr>
705 <tr id='map-zoom'>
706 <td><code><b>zoom</b></code></td>
707 <td><code><a href='#event'>Event</a></code></td>
708 <td>Fired repeatedly during any change in zoom level, including zoom
709and fly animations.</td>
710 </tr>
711 <tr id='map-move'>
712 <td><code><b>move</b></code></td>
713 <td><code><a href='#event'>Event</a></code></td>
714 <td>Fired repeatedly during any movement of the map, including pan and
715fly animations.</td>
716 </tr>
717 <tr id='map-zoomend'>
718 <td><code><b>zoomend</b></code></td>
719 <td><code><a href='#event'>Event</a></code></td>
720 <td>Fired when the map has changed, after any animations.</td>
721 </tr>
722 <tr id='map-moveend'>
723 <td><code><b>moveend</b></code></td>
724 <td><code><a href='#event'>Event</a></code></td>
725 <td>Fired when the center of the map stops changing (e.g. user stopped
726dragging the map).</td>
727 </tr>
728</tbody></table>
729
730</section><section class='collapsable'>
731
732<h4 id='map-popup-events'>Popup events</h4>
733
734
735<table><thead>
736 <tr>
737 <th>Event</th>
738 <th>Data</th>
739 <th>Description</th>
740 </tr>
741 </thead><tbody>
742 <tr id='map-popupopen'>
743 <td><code><b>popupopen</b></code></td>
744 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
745 <td>Fired when a popup is opened in the map</td>
746 </tr>
747 <tr id='map-popupclose'>
748 <td><code><b>popupclose</b></code></td>
749 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
750 <td>Fired when a popup in the map is closed</td>
751 </tr>
752 <tr id='map-autopanstart'>
753 <td><code><b>autopanstart</b></code></td>
754 <td><code><a href='#event'>Event</a></code></td>
755 <td>Fired when the map starts autopanning when opening a popup.</td>
756 </tr>
757</tbody></table>
758
759</section><section class='collapsable'>
760
761<h4 id='map-tooltip-events'>Tooltip events</h4>
762
763
764<table><thead>
765 <tr>
766 <th>Event</th>
767 <th>Data</th>
768 <th>Description</th>
769 </tr>
770 </thead><tbody>
771 <tr id='map-tooltipopen'>
772 <td><code><b>tooltipopen</b></code></td>
773 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
774 <td>Fired when a tooltip is opened in the map.</td>
775 </tr>
776 <tr id='map-tooltipclose'>
777 <td><code><b>tooltipclose</b></code></td>
778 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
779 <td>Fired when a tooltip in the map is closed.</td>
780 </tr>
781</tbody></table>
782
783</section><section class='collapsable'>
784
785<h4 id='map-location-events'>Location events</h4>
786
787
788<table><thead>
789 <tr>
790 <th>Event</th>
791 <th>Data</th>
792 <th>Description</th>
793 </tr>
794 </thead><tbody>
795 <tr id='map-locationerror'>
796 <td><code><b>locationerror</b></code></td>
797 <td><code><a href='#errorevent'>ErrorEvent</a></code></td>
798 <td>Fired when geolocation (using the <a href="#map-locate"><code>locate</code></a> method) failed.</td>
799 </tr>
800 <tr id='map-locationfound'>
801 <td><code><b>locationfound</b></code></td>
802 <td><code><a href='#locationevent'>LocationEvent</a></code></td>
803 <td>Fired when geolocation (using the <a href="#map-locate"><code>locate</code></a> method)
804went successfully.</td>
805 </tr>
806</tbody></table>
807
808</section><section class='collapsable'>
809
810<h4 id='map-interaction-events'>Interaction events</h4>
811
812
813<table><thead>
814 <tr>
815 <th>Event</th>
816 <th>Data</th>
817 <th>Description</th>
818 </tr>
819 </thead><tbody>
820 <tr id='map-click'>
821 <td><code><b>click</b></code></td>
822 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
823 <td>Fired when the user clicks (or taps) the map.</td>
824 </tr>
825 <tr id='map-dblclick'>
826 <td><code><b>dblclick</b></code></td>
827 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
828 <td>Fired when the user double-clicks (or double-taps) the map.</td>
829 </tr>
830 <tr id='map-mousedown'>
831 <td><code><b>mousedown</b></code></td>
832 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
833 <td>Fired when the user pushes the mouse button on the map.</td>
834 </tr>
835 <tr id='map-mouseup'>
836 <td><code><b>mouseup</b></code></td>
837 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
838 <td>Fired when the user releases the mouse button on the map.</td>
839 </tr>
840 <tr id='map-mouseover'>
841 <td><code><b>mouseover</b></code></td>
842 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
843 <td>Fired when the mouse enters the map.</td>
844 </tr>
845 <tr id='map-mouseout'>
846 <td><code><b>mouseout</b></code></td>
847 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
848 <td>Fired when the mouse leaves the map.</td>
849 </tr>
850 <tr id='map-mousemove'>
851 <td><code><b>mousemove</b></code></td>
852 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
853 <td>Fired while the mouse moves over the map.</td>
854 </tr>
855 <tr id='map-contextmenu'>
856 <td><code><b>contextmenu</b></code></td>
857 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
858 <td>Fired when the user pushes the right mouse button on the map, prevents
859default browser context menu from showing if there are listeners on
860this event. Also fired on mobile when the user holds a single touch
861for a second (also called long press).</td>
862 </tr>
863 <tr id='map-keypress'>
864 <td><code><b>keypress</b></code></td>
865 <td><code><a href='#keyboardevent'>KeyboardEvent</a></code></td>
866 <td>Fired when the user presses a key from the keyboard that produces a character value while the map is focused.</td>
867 </tr>
868 <tr id='map-keydown'>
869 <td><code><b>keydown</b></code></td>
870 <td><code><a href='#keyboardevent'>KeyboardEvent</a></code></td>
871 <td>Fired when the user presses a key from the keyboard while the map is focused. Unlike the <code>keypress</code> event,
872the <code>keydown</code> event is fired for keys that produce a character value and for keys
873that do not produce a character value.</td>
874 </tr>
875 <tr id='map-keyup'>
876 <td><code><b>keyup</b></code></td>
877 <td><code><a href='#keyboardevent'>KeyboardEvent</a></code></td>
878 <td>Fired when the user releases a key from the keyboard while the map is focused.</td>
879 </tr>
880 <tr id='map-preclick'>
881 <td><code><b>preclick</b></code></td>
882 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
883 <td>Fired before mouse click on the map (sometimes useful when you
884want something to happen on click before any existing click
885handlers start running).</td>
886 </tr>
887</tbody></table>
888
889</section><section class='collapsable'>
890
891<h4 id='map-other-events'>Other Events</h4>
892
893
894<table><thead>
895 <tr>
896 <th>Event</th>
897 <th>Data</th>
898 <th>Description</th>
899 </tr>
900 </thead><tbody>
901 <tr id='map-zoomanim'>
902 <td><code><b>zoomanim</b></code></td>
903 <td><code><a href='#zoomanimevent'>ZoomAnimEvent</a></code></td>
904 <td>Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.</td>
905 </tr>
906</tbody></table>
907
908</section>
909
910
911</section><section>
912<h3 id='map-method'>Methods</h3>
913
914<section >
915
916
917
918
919<table><thead>
920 <tr>
921 <th>Method</th>
922 <th>Returns</th>
923 <th>Description</th>
924 </tr>
925 </thead><tbody>
926 <tr id='map-getrenderer'>
927 <td><code><b>getRenderer</b>(<nobr>&lt;<a href='#path'>Path</a>&gt;</nobr> <i>layer</i>)</code></td>
928 <td><code><a href='#renderer'>Renderer</a></code></td>
929 <td><p>Returns the instance of <a href="#renderer"><code>Renderer</code></a> that should be used to render the given
930<a href="#path"><code>Path</code></a>. It will ensure that the <a href="#renderer"><code>renderer</code></a> options of the map and paths
931are respected, and that the renderers do exist on the map.</p>
932</td>
933 </tr>
934</tbody></table>
935
936</section><section class='collapsable'>
937
938<h4 id='map-methods-for-layers-and-controls'>Methods for Layers and Controls</h4>
939
940<div class='section-comments'></div>
941
942<table><thead>
943 <tr>
944 <th>Method</th>
945 <th>Returns</th>
946 <th>Description</th>
947 </tr>
948 </thead><tbody>
949 <tr id='map-addcontrol'>
950 <td><code><b>addControl</b>(<nobr>&lt;<a href='#control'>Control</a>&gt;</nobr> <i>control</i>)</code></td>
951 <td><code>this</code></td>
952 <td><p>Adds the given control to the map</p>
953</td>
954 </tr>
955 <tr id='map-removecontrol'>
956 <td><code><b>removeControl</b>(<nobr>&lt;<a href='#control'>Control</a>&gt;</nobr> <i>control</i>)</code></td>
957 <td><code>this</code></td>
958 <td><p>Removes the given control from the map</p>
959</td>
960 </tr>
961 <tr id='map-addlayer'>
962 <td><code><b>addLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
963 <td><code>this</code></td>
964 <td><p>Adds the given layer to the map</p>
965</td>
966 </tr>
967 <tr id='map-removelayer'>
968 <td><code><b>removeLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
969 <td><code>this</code></td>
970 <td><p>Removes the given layer from the map.</p>
971</td>
972 </tr>
973 <tr id='map-haslayer'>
974 <td><code><b>hasLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
975 <td><code>Boolean</code></td>
976 <td><p>Returns <code>true</code> if the given layer is currently added to the map</p>
977</td>
978 </tr>
979 <tr id='map-eachlayer'>
980 <td><code><b>eachLayer</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
981 <td><code>this</code></td>
982 <td><p>Iterates over the layers of the map, optionally specifying context of the iterator function.</p>
983<pre><code>map.eachLayer(function(layer){
984 layer.bindPopup(&#39;Hello&#39;);
985});
986</code></pre></td>
987 </tr>
988 <tr id='map-openpopup'>
989 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#popup'>Popup</a>&gt;</nobr> <i>popup</i>)</code></td>
990 <td><code>this</code></td>
991 <td><p>Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).</p>
992</td>
993 </tr>
994 <tr id='map-openpopup'>
995 <td><code><b>openPopup</b>(<nobr>&lt;String|HTMLElement&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
996 <td><code>this</code></td>
997 <td><p>Creates a popup with the specified content and options and opens it in the given point on a map.</p>
998</td>
999 </tr>
1000 <tr id='map-closepopup'>
1001 <td><code><b>closePopup</b>(<nobr>&lt;<a href='#popup'>Popup</a>&gt;</nobr> <i>popup?</i>)</code></td>
1002 <td><code>this</code></td>
1003 <td><p>Closes the popup previously opened with <a href="#map-openpopup">openPopup</a> (or the given one).</p>
1004</td>
1005 </tr>
1006 <tr id='map-opentooltip'>
1007 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#tooltip'>Tooltip</a>&gt;</nobr> <i>tooltip</i>)</code></td>
1008 <td><code>this</code></td>
1009 <td><p>Opens the specified tooltip.</p>
1010</td>
1011 </tr>
1012 <tr id='map-opentooltip'>
1013 <td><code><b>openTooltip</b>(<nobr>&lt;String|HTMLElement&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
1014 <td><code>this</code></td>
1015 <td><p>Creates a tooltip with the specified content and options and open it.</p>
1016</td>
1017 </tr>
1018 <tr id='map-closetooltip'>
1019 <td><code><b>closeTooltip</b>(<nobr>&lt;<a href='#tooltip'>Tooltip</a>&gt;</nobr> <i>tooltip?</i>)</code></td>
1020 <td><code>this</code></td>
1021 <td><p>Closes the tooltip given as parameter.</p>
1022</td>
1023 </tr>
1024</tbody></table>
1025
1026</section><section class='collapsable'>
1027
1028<h4 id='map-methods-for-modifying-map-state'>Methods for modifying map state</h4>
1029
1030
1031<table><thead>
1032 <tr>
1033 <th>Method</th>
1034 <th>Returns</th>
1035 <th>Description</th>
1036 </tr>
1037 </thead><tbody>
1038 <tr id='map-setview'>
1039 <td><code><b>setView</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>center</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>, <nobr>&lt;<a href='#zoom/pan-options'>Zoom/pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1040 <td><code>this</code></td>
1041 <td><p>Sets the view of the map (geographical center and zoom) with the given
1042animation options.</p>
1043</td>
1044 </tr>
1045 <tr id='map-setzoom'>
1046 <td><code><b>setZoom</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom</i>, <nobr>&lt;<a href='#zoom/pan-options'>Zoom/pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1047 <td><code>this</code></td>
1048 <td><p>Sets the zoom of the map.</p>
1049</td>
1050 </tr>
1051 <tr id='map-zoomin'>
1052 <td><code><b>zoomIn</b>(<nobr>&lt;Number&gt;</nobr> <i>delta?</i>, <nobr>&lt;<a href='#zoom-options'>Zoom options</a>&gt;</nobr> <i>options?</i>)</code></td>
1053 <td><code>this</code></td>
1054 <td><p>Increases the zoom of the map by <code>delta</code> (<a href="#map-zoomdelta"><code>zoomDelta</code></a> by default).</p>
1055</td>
1056 </tr>
1057 <tr id='map-zoomout'>
1058 <td><code><b>zoomOut</b>(<nobr>&lt;Number&gt;</nobr> <i>delta?</i>, <nobr>&lt;<a href='#zoom-options'>Zoom options</a>&gt;</nobr> <i>options?</i>)</code></td>
1059 <td><code>this</code></td>
1060 <td><p>Decreases the zoom of the map by <code>delta</code> (<a href="#map-zoomdelta"><code>zoomDelta</code></a> by default).</p>
1061</td>
1062 </tr>
1063 <tr id='map-setzoomaround'>
1064 <td><code><b>setZoomAround</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>, <nobr>&lt;<a href='#zoom-options'>Zoom options</a>&gt;</nobr> <i>options</i>)</code></td>
1065 <td><code>this</code></td>
1066 <td><p>Zooms the map while keeping a specified geographical point on the map
1067stationary (e.g. used internally for scroll zoom and double-click zoom).</p>
1068</td>
1069 </tr>
1070 <tr id='map-setzoomaround'>
1071 <td><code><b>setZoomAround</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>offset</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>, <nobr>&lt;<a href='#zoom-options'>Zoom options</a>&gt;</nobr> <i>options</i>)</code></td>
1072 <td><code>this</code></td>
1073 <td><p>Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.</p>
1074</td>
1075 </tr>
1076 <tr id='map-fitbounds'>
1077 <td><code><b>fitBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;<a href='#fitbounds-options'>fitBounds options</a>&gt;</nobr> <i>options?</i>)</code></td>
1078 <td><code>this</code></td>
1079 <td><p>Sets a map view that contains the given geographical bounds with the
1080maximum zoom level possible.</p>
1081</td>
1082 </tr>
1083 <tr id='map-fitworld'>
1084 <td><code><b>fitWorld</b>(<nobr>&lt;<a href='#fitbounds-options'>fitBounds options</a>&gt;</nobr> <i>options?</i>)</code></td>
1085 <td><code>this</code></td>
1086 <td><p>Sets a map view that mostly contains the whole world with the maximum
1087zoom level possible.</p>
1088</td>
1089 </tr>
1090 <tr id='map-panto'>
1091 <td><code><b>panTo</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#pan-options'>Pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1092 <td><code>this</code></td>
1093 <td><p>Pans the map to a given center.</p>
1094</td>
1095 </tr>
1096 <tr id='map-panby'>
1097 <td><code><b>panBy</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>offset</i>, <nobr>&lt;<a href='#pan-options'>Pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1098 <td><code>this</code></td>
1099 <td><p>Pans the map by a given number of pixels (animated).</p>
1100</td>
1101 </tr>
1102 <tr id='map-flyto'>
1103 <td><code><b>flyTo</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom?</i>, <nobr>&lt;<a href='#zoom/pan-options'>Zoom/pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1104 <td><code>this</code></td>
1105 <td><p>Sets the view of the map (geographical center and zoom) performing a smooth
1106pan-zoom animation.</p>
1107</td>
1108 </tr>
1109 <tr id='map-flytobounds'>
1110 <td><code><b>flyToBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;<a href='#fitbounds-options'>fitBounds options</a>&gt;</nobr> <i>options?</i>)</code></td>
1111 <td><code>this</code></td>
1112 <td><p>Sets the view of the map with a smooth animation like <a href="#map-flyto"><code>flyTo</code></a>,
1113but takes a bounds parameter like <a href="#map-fitbounds"><code>fitBounds</code></a>.</p>
1114</td>
1115 </tr>
1116 <tr id='map-setmaxbounds'>
1117 <td><code><b>setMaxBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
1118 <td><code>this</code></td>
1119 <td><p>Restricts the map view to the given bounds (see the <a href="#map-maxbounds">maxBounds</a> option).</p>
1120</td>
1121 </tr>
1122 <tr id='map-setminzoom'>
1123 <td><code><b>setMinZoom</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
1124 <td><code>this</code></td>
1125 <td><p>Sets the lower limit for the available zoom levels (see the <a href="#map-minzoom">minZoom</a> option).</p>
1126</td>
1127 </tr>
1128 <tr id='map-setmaxzoom'>
1129 <td><code><b>setMaxZoom</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
1130 <td><code>this</code></td>
1131 <td><p>Sets the upper limit for the available zoom levels (see the <a href="#map-maxzoom">maxZoom</a> option).</p>
1132</td>
1133 </tr>
1134 <tr id='map-paninsidebounds'>
1135 <td><code><b>panInsideBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;<a href='#pan-options'>Pan options</a>&gt;</nobr> <i>options?</i>)</code></td>
1136 <td><code>this</code></td>
1137 <td><p>Pans the map to the closest view that would lie inside the given bounds (if it&#39;s not already), controlling the animation using the options specific, if any.</p>
1138</td>
1139 </tr>
1140 <tr id='map-paninside'>
1141 <td><code><b>panInside</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;options&gt;</nobr> <i>options?</i>)</code></td>
1142 <td><code>this</code></td>
1143 <td><p>Pans the map the minimum amount to make the <a href="#latlng"><code>latlng</code></a> visible. Use
1144<code>padding</code>, <code>paddingTopLeft</code> and <code>paddingTopRight</code> options to fit
1145the display to more restricted bounds, like <a href="#map-fitbounds"><code>fitBounds</code></a>.
1146If <code>latlng</code> is already within the (optionally padded) display bounds,
1147the map will not be panned.</p>
1148</td>
1149 </tr>
1150 <tr id='map-invalidatesize'>
1151 <td><code><b>invalidateSize</b>(<nobr>&lt;<a href='#zoom/pan-options'>Zoom/pan options</a>&gt;</nobr> <i>options</i>)</code></td>
1152 <td><code>this</code></td>
1153 <td><p>Checks if the map container size changed and updates the map if so —
1154call it after you&#39;ve changed the map size dynamically, also animating
1155pan by default. If <code>options.pan</code> is <code>false</code>, panning will not occur.
1156If <code>options.debounceMoveend</code> is <code>true</code>, it will delay <code>moveend</code> event so
1157that it doesn&#39;t happen often even if the method is called many
1158times in a row.</p>
1159</td>
1160 </tr>
1161 <tr id='map-invalidatesize'>
1162 <td><code><b>invalidateSize</b>(<nobr>&lt;Boolean&gt;</nobr> <i>animate</i>)</code></td>
1163 <td><code>this</code></td>
1164 <td><p>Checks if the map container size changed and updates the map if so —
1165call it after you&#39;ve changed the map size dynamically, also animating
1166pan by default.</p>
1167</td>
1168 </tr>
1169 <tr id='map-stop'>
1170 <td><code><b>stop</b>()</code></td>
1171 <td><code>this</code></td>
1172 <td><p>Stops the currently running <code>panTo</code> or <code>flyTo</code> animation, if any.</p>
1173</td>
1174 </tr>
1175</tbody></table>
1176
1177</section><section class='collapsable'>
1178
1179<h4 id='map-geolocation-methods'>Geolocation methods</h4>
1180
1181
1182<table><thead>
1183 <tr>
1184 <th>Method</th>
1185 <th>Returns</th>
1186 <th>Description</th>
1187 </tr>
1188 </thead><tbody>
1189 <tr id='map-locate'>
1190 <td><code><b>locate</b>(<nobr>&lt;<a href='#locate-options'>Locate options</a>&gt;</nobr> <i>options?</i>)</code></td>
1191 <td><code>this</code></td>
1192 <td><p>Tries to locate the user using the Geolocation API, firing a <a href="#map-locationfound"><code>locationfound</code></a>
1193event with location data on success or a <a href="#map-locationerror"><code>locationerror</code></a> event on failure,
1194and optionally sets the map view to the user&#39;s location with respect to
1195detection accuracy (or to the world view if geolocation failed).
1196Note that, if your page doesn&#39;t use HTTPS, this method will fail in
1197modern browsers (<a href="https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins">Chrome 50 and newer</a>)
1198See <a href="#locate-options"><code>Locate options</code></a> for more details.</p>
1199</td>
1200 </tr>
1201 <tr id='map-stoplocate'>
1202 <td><code><b>stopLocate</b>()</code></td>
1203 <td><code>this</code></td>
1204 <td><p>Stops watching location previously initiated by <code>map.locate({watch: true})</code>
1205and aborts resetting the map view if map.locate was called with
1206<code>{setView: true}</code>.</p>
1207</td>
1208 </tr>
1209</tbody></table>
1210
1211</section><section class='collapsable'>
1212
1213<h4 id='map-other-methods'>Other Methods</h4>
1214
1215
1216<table><thead>
1217 <tr>
1218 <th>Method</th>
1219 <th>Returns</th>
1220 <th>Description</th>
1221 </tr>
1222 </thead><tbody>
1223 <tr id='map-addhandler'>
1224 <td><code><b>addHandler</b>(<nobr>&lt;String&gt;</nobr> <i>name</i>, <nobr>&lt;Function&gt;</nobr> <i>HandlerClass</i>)</code></td>
1225 <td><code>this</code></td>
1226 <td><p>Adds a new <a href="#handler"><code>Handler</code></a> to the map, given its name and constructor function.</p>
1227</td>
1228 </tr>
1229 <tr id='map-remove'>
1230 <td><code><b>remove</b>()</code></td>
1231 <td><code>this</code></td>
1232 <td><p>Destroys the map and clears all related event listeners.</p>
1233</td>
1234 </tr>
1235 <tr id='map-createpane'>
1236 <td><code><b>createPane</b>(<nobr>&lt;String&gt;</nobr> <i>name</i>, <nobr>&lt;HTMLElement&gt;</nobr> <i>container?</i>)</code></td>
1237 <td><code>HTMLElement</code></td>
1238 <td><p>Creates a new <a href="#map-pane">map pane</a> with the given name if it doesn&#39;t exist already,
1239then returns it. The pane is created as a child of <code>container</code>, or
1240as a child of the main map pane if not set.</p>
1241</td>
1242 </tr>
1243 <tr id='map-getpane'>
1244 <td><code><b>getPane</b>(<nobr>&lt;String|HTMLElement&gt;</nobr> <i>pane</i>)</code></td>
1245 <td><code>HTMLElement</code></td>
1246 <td><p>Returns a <a href="#map-pane">map pane</a>, given its name or its HTML element (its identity).</p>
1247</td>
1248 </tr>
1249 <tr id='map-getpanes'>
1250 <td><code><b>getPanes</b>()</code></td>
1251 <td><code>Object</code></td>
1252 <td><p>Returns a plain object containing the names of all <a href="#map-pane">panes</a> as keys and
1253the panes as values.</p>
1254</td>
1255 </tr>
1256 <tr id='map-getcontainer'>
1257 <td><code><b>getContainer</b>()</code></td>
1258 <td><code>HTMLElement</code></td>
1259 <td><p>Returns the HTML element that contains the map.</p>
1260</td>
1261 </tr>
1262 <tr id='map-whenready'>
1263 <td><code><b>whenReady</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
1264 <td><code>this</code></td>
1265 <td><p>Runs the given function <code>fn</code> when the map gets initialized with
1266a view (center and zoom) and at least one layer, or immediately
1267if it&#39;s already initialized, optionally passing a function context.</p>
1268</td>
1269 </tr>
1270</tbody></table>
1271
1272</section><section class='collapsable'>
1273
1274<h4 id='map-methods-for-getting-map-state'>Methods for Getting Map State</h4>
1275
1276
1277<table><thead>
1278 <tr>
1279 <th>Method</th>
1280 <th>Returns</th>
1281 <th>Description</th>
1282 </tr>
1283 </thead><tbody>
1284 <tr id='map-getcenter'>
1285 <td><code><b>getCenter</b>()</code></td>
1286 <td><code><a href='#latlng'>LatLng</a></code></td>
1287 <td><p>Returns the geographical center of the map view</p>
1288</td>
1289 </tr>
1290 <tr id='map-getzoom'>
1291 <td><code><b>getZoom</b>()</code></td>
1292 <td><code>Number</code></td>
1293 <td><p>Returns the current zoom level of the map view</p>
1294</td>
1295 </tr>
1296 <tr id='map-getbounds'>
1297 <td><code><b>getBounds</b>()</code></td>
1298 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
1299 <td><p>Returns the geographical bounds visible in the current map view</p>
1300</td>
1301 </tr>
1302 <tr id='map-getminzoom'>
1303 <td><code><b>getMinZoom</b>()</code></td>
1304 <td><code>Number</code></td>
1305 <td><p>Returns the minimum zoom level of the map (if set in the <code>minZoom</code> option of the map or of any layers), or <code>0</code> by default.</p>
1306</td>
1307 </tr>
1308 <tr id='map-getmaxzoom'>
1309 <td><code><b>getMaxZoom</b>()</code></td>
1310 <td><code>Number</code></td>
1311 <td><p>Returns the maximum zoom level of the map (if set in the <code>maxZoom</code> option of the map or of any layers).</p>
1312</td>
1313 </tr>
1314 <tr id='map-getboundszoom'>
1315 <td><code><b>getBoundsZoom</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;Boolean&gt;</nobr> <i>inside?</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>padding?</i>)</code></td>
1316 <td><code>Number</code></td>
1317 <td><p>Returns the maximum zoom level on which the given bounds fit to the map
1318view in its entirety. If <code>inside</code> (optional) is set to <code>true</code>, the method
1319instead returns the minimum zoom level on which the map view fits into
1320the given bounds in its entirety.</p>
1321</td>
1322 </tr>
1323 <tr id='map-getsize'>
1324 <td><code><b>getSize</b>()</code></td>
1325 <td><code><a href='#point'>Point</a></code></td>
1326 <td><p>Returns the current size of the map container (in pixels).</p>
1327</td>
1328 </tr>
1329 <tr id='map-getpixelbounds'>
1330 <td><code><b>getPixelBounds</b>()</code></td>
1331 <td><code><a href='#bounds'>Bounds</a></code></td>
1332 <td><p>Returns the bounds of the current map view in projected pixel
1333coordinates (sometimes useful in layer and overlay implementations).</p>
1334</td>
1335 </tr>
1336 <tr id='map-getpixelorigin'>
1337 <td><code><b>getPixelOrigin</b>()</code></td>
1338 <td><code><a href='#point'>Point</a></code></td>
1339 <td><p>Returns the projected pixel coordinates of the top left point of
1340the map layer (useful in custom layer and overlay implementations).</p>
1341</td>
1342 </tr>
1343 <tr id='map-getpixelworldbounds'>
1344 <td><code><b>getPixelWorldBounds</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom?</i>)</code></td>
1345 <td><code><a href='#bounds'>Bounds</a></code></td>
1346 <td><p>Returns the world&#39;s bounds in pixel coordinates for zoom level <code>zoom</code>.
1347If <code>zoom</code> is omitted, the map&#39;s current zoom level is used.</p>
1348</td>
1349 </tr>
1350</tbody></table>
1351
1352</section><section class='collapsable'>
1353
1354<h4 id='map-conversion-methods'>Conversion Methods</h4>
1355
1356
1357<table><thead>
1358 <tr>
1359 <th>Method</th>
1360 <th>Returns</th>
1361 <th>Description</th>
1362 </tr>
1363 </thead><tbody>
1364 <tr id='map-getzoomscale'>
1365 <td><code><b>getZoomScale</b>(<nobr>&lt;Number&gt;</nobr> <i>toZoom</i>, <nobr>&lt;Number&gt;</nobr> <i>fromZoom</i>)</code></td>
1366 <td><code>Number</code></td>
1367 <td><p>Returns the scale factor to be applied to a map transition from zoom level
1368<code>fromZoom</code> to <code>toZoom</code>. Used internally to help with zoom animations.</p>
1369</td>
1370 </tr>
1371 <tr id='map-getscalezoom'>
1372 <td><code><b>getScaleZoom</b>(<nobr>&lt;Number&gt;</nobr> <i>scale</i>, <nobr>&lt;Number&gt;</nobr> <i>fromZoom</i>)</code></td>
1373 <td><code>Number</code></td>
1374 <td><p>Returns the zoom level that the map would end up at, if it is at <code>fromZoom</code>
1375level and everything is scaled by a factor of <code>scale</code>. Inverse of
1376<a href="#map-getZoomScale"><code>getZoomScale</code></a>.</p>
1377</td>
1378 </tr>
1379 <tr id='map-project'>
1380 <td><code><b>project</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
1381 <td><code><a href='#point'>Point</a></code></td>
1382 <td><p>Projects a geographical coordinate <a href="#latlng"><code>LatLng</code></a> according to the projection
1383of the map&#39;s CRS, then scales it according to <code>zoom</code> and the CRS&#39;s
1384<a href="#transformation"><code>Transformation</code></a>. The result is pixel coordinate relative to
1385the CRS origin.</p>
1386</td>
1387 </tr>
1388 <tr id='map-unproject'>
1389 <td><code><b>unproject</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
1390 <td><code><a href='#latlng'>LatLng</a></code></td>
1391 <td><p>Inverse of <a href="#map-project"><code>project</code></a>.</p>
1392</td>
1393 </tr>
1394 <tr id='map-layerpointtolatlng'>
1395 <td><code><b>layerPointToLatLng</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
1396 <td><code><a href='#latlng'>LatLng</a></code></td>
1397 <td><p>Given a pixel coordinate relative to the <a href="#map-getpixelorigin">origin pixel</a>,
1398returns the corresponding geographical coordinate (for the current zoom level).</p>
1399</td>
1400 </tr>
1401 <tr id='map-latlngtolayerpoint'>
1402 <td><code><b>latLngToLayerPoint</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
1403 <td><code><a href='#point'>Point</a></code></td>
1404 <td><p>Given a geographical coordinate, returns the corresponding pixel coordinate
1405relative to the <a href="#map-getpixelorigin">origin pixel</a>.</p>
1406</td>
1407 </tr>
1408 <tr id='map-wraplatlng'>
1409 <td><code><b>wrapLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
1410 <td><code><a href='#latlng'>LatLng</a></code></td>
1411 <td><p>Returns a <a href="#latlng"><code>LatLng</code></a> where <code>lat</code> and <code>lng</code> has been wrapped according to the
1412map&#39;s CRS&#39;s <code>wrapLat</code> and <code>wrapLng</code> properties, if they are outside the
1413CRS&#39;s bounds.
1414By default this means longitude is wrapped around the dateline so its
1415value is between -180 and +180 degrees.</p>
1416</td>
1417 </tr>
1418 <tr id='map-wraplatlngbounds'>
1419 <td><code><b>wrapLatLngBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
1420 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
1421 <td><p>Returns a <a href="#latlngbounds"><code>LatLngBounds</code></a> with the same size as the given one, ensuring that
1422its center is within the CRS&#39;s bounds.
1423By default this means the center longitude is wrapped around the dateline so its
1424value is between -180 and +180 degrees, and the majority of the bounds
1425overlaps the CRS&#39;s bounds.</p>
1426</td>
1427 </tr>
1428 <tr id='map-distance'>
1429 <td><code><b>distance</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng1</i>, <nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng2</i>)</code></td>
1430 <td><code>Number</code></td>
1431 <td><p>Returns the distance between two geographical coordinates according to
1432the map&#39;s CRS. By default this measures distance in meters.</p>
1433</td>
1434 </tr>
1435 <tr id='map-containerpointtolayerpoint'>
1436 <td><code><b>containerPointToLayerPoint</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
1437 <td><code><a href='#point'>Point</a></code></td>
1438 <td><p>Given a pixel coordinate relative to the map container, returns the corresponding
1439pixel coordinate relative to the <a href="#map-getpixelorigin">origin pixel</a>.</p>
1440</td>
1441 </tr>
1442 <tr id='map-layerpointtocontainerpoint'>
1443 <td><code><b>layerPointToContainerPoint</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
1444 <td><code><a href='#point'>Point</a></code></td>
1445 <td><p>Given a pixel coordinate relative to the <a href="#map-getpixelorigin">origin pixel</a>,
1446returns the corresponding pixel coordinate relative to the map container.</p>
1447</td>
1448 </tr>
1449 <tr id='map-containerpointtolatlng'>
1450 <td><code><b>containerPointToLatLng</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
1451 <td><code><a href='#latlng'>LatLng</a></code></td>
1452 <td><p>Given a pixel coordinate relative to the map container, returns
1453the corresponding geographical coordinate (for the current zoom level).</p>
1454</td>
1455 </tr>
1456 <tr id='map-latlngtocontainerpoint'>
1457 <td><code><b>latLngToContainerPoint</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
1458 <td><code><a href='#point'>Point</a></code></td>
1459 <td><p>Given a geographical coordinate, returns the corresponding pixel coordinate
1460relative to the map container.</p>
1461</td>
1462 </tr>
1463 <tr id='map-mouseeventtocontainerpoint'>
1464 <td><code><b>mouseEventToContainerPoint</b>(<nobr>&lt;<a href='#mouseevent'>MouseEvent</a>&gt;</nobr> <i>ev</i>)</code></td>
1465 <td><code><a href='#point'>Point</a></code></td>
1466 <td><p>Given a MouseEvent object, returns the pixel coordinate relative to the
1467map container where the event took place.</p>
1468</td>
1469 </tr>
1470 <tr id='map-mouseeventtolayerpoint'>
1471 <td><code><b>mouseEventToLayerPoint</b>(<nobr>&lt;<a href='#mouseevent'>MouseEvent</a>&gt;</nobr> <i>ev</i>)</code></td>
1472 <td><code><a href='#point'>Point</a></code></td>
1473 <td><p>Given a MouseEvent object, returns the pixel coordinate relative to
1474the <a href="#map-getpixelorigin">origin pixel</a> where the event took place.</p>
1475</td>
1476 </tr>
1477 <tr id='map-mouseeventtolatlng'>
1478 <td><code><b>mouseEventToLatLng</b>(<nobr>&lt;<a href='#mouseevent'>MouseEvent</a>&gt;</nobr> <i>ev</i>)</code></td>
1479 <td><code><a href='#latlng'>LatLng</a></code></td>
1480 <td><p>Given a MouseEvent object, returns geographical coordinate where the
1481event took place.</p>
1482</td>
1483 </tr>
1484</tbody></table>
1485
1486</section>
1487
1488
1489<div class='accordion'>
1490 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
1491 <div class='accordion-overflow'>
1492 <div class='accordion-content'><section >
1493
1494
1495
1496
1497<table><thead>
1498 <tr>
1499 <th>Method</th>
1500 <th>Returns</th>
1501 <th>Description</th>
1502 </tr>
1503 </thead><tbody>
1504 <tr id='map-on'>
1505 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
1506 <td><code>this</code></td>
1507 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
1508</td>
1509 </tr>
1510 <tr id='map-on'>
1511 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
1512 <td><code>this</code></td>
1513 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
1514</td>
1515 </tr>
1516 <tr id='map-off'>
1517 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
1518 <td><code>this</code></td>
1519 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
1520</td>
1521 </tr>
1522 <tr id='map-off'>
1523 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
1524 <td><code>this</code></td>
1525 <td><p>Removes a set of type/listener pairs.</p>
1526</td>
1527 </tr>
1528 <tr id='map-off'>
1529 <td><code><b>off</b>()</code></td>
1530 <td><code>this</code></td>
1531 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
1532</td>
1533 </tr>
1534 <tr id='map-fire'>
1535 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
1536 <td><code>this</code></td>
1537 <td><p>Fires an event of the specified type. You can optionally provide an data
1538object — the first argument of the listener function will contain its
1539properties. The event can optionally be propagated to event parents.</p>
1540</td>
1541 </tr>
1542 <tr id='map-listens'>
1543 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
1544 <td><code>Boolean</code></td>
1545 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
1546</td>
1547 </tr>
1548 <tr id='map-once'>
1549 <td><code><b>once</b>(<i></i>)</code></td>
1550 <td><code>this</code></td>
1551 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
1552</td>
1553 </tr>
1554 <tr id='map-addeventparent'>
1555 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
1556 <td><code>this</code></td>
1557 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
1558</td>
1559 </tr>
1560 <tr id='map-removeeventparent'>
1561 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
1562 <td><code>this</code></td>
1563 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
1564</td>
1565 </tr>
1566 <tr id='map-addeventlistener'>
1567 <td><code><b>addEventListener</b>(<i></i>)</code></td>
1568 <td><code>this</code></td>
1569 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
1570</td>
1571 </tr>
1572 <tr id='map-removeeventlistener'>
1573 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
1574 <td><code>this</code></td>
1575 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
1576</td>
1577 </tr>
1578 <tr id='map-clearalleventlisteners'>
1579 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
1580 <td><code>this</code></td>
1581 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
1582</td>
1583 </tr>
1584 <tr id='map-addonetimeeventlistener'>
1585 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
1586 <td><code>this</code></td>
1587 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
1588</td>
1589 </tr>
1590 <tr id='map-fireevent'>
1591 <td><code><b>fireEvent</b>(<i></i>)</code></td>
1592 <td><code>this</code></td>
1593 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
1594</td>
1595 </tr>
1596 <tr id='map-haseventlisteners'>
1597 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
1598 <td><code>Boolean</code></td>
1599 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
1600</td>
1601 </tr>
1602</tbody></table>
1603
1604</section></div>
1605 </div>
1606</div>
1607
1608</section><section>
1609<h3 id='map-property'>Properties</h3>
1610
1611<section class='collapsable'>
1612
1613<h4 id='map-controls'>Controls</h4>
1614
1615
1616<table><thead>
1617 <tr>
1618 <th>Property</th>
1619 <th>Type</th>
1620 <th>Description</th>
1621 </tr>
1622 </thead><tbody>
1623 <tr id='map-zoomcontrol'>
1624 <td><code><b>zoomControl</b></code></td>
1625 <td><code><a href='#control-zoom'>Control.Zoom</a></code></td>
1626 <td>The default zoom control (only available if the
1627<a href="#map-zoomcontrol"><code>zoomControl</code> option</a> was <code>true</code> when creating the map).</td>
1628 </tr>
1629</tbody></table>
1630
1631</section><section class='collapsable'>
1632
1633<h4 id='map-handlers'>Handlers</h4>
1634
1635
1636<table><thead>
1637 <tr>
1638 <th>Property</th>
1639 <th>Type</th>
1640 <th>Description</th>
1641 </tr>
1642 </thead><tbody>
1643 <tr id='map-boxzoom'>
1644 <td><code><b>boxZoom</b></code></td>
1645 <td><code><a href='#handler'>Handler</a></code></td>
1646 <td>Box (shift-drag with mouse) zoom handler.</td>
1647 </tr>
1648 <tr id='map-doubleclickzoom'>
1649 <td><code><b>doubleClickZoom</b></code></td>
1650 <td><code><a href='#handler'>Handler</a></code></td>
1651 <td>Double click zoom handler.</td>
1652 </tr>
1653 <tr id='map-dragging'>
1654 <td><code><b>dragging</b></code></td>
1655 <td><code><a href='#handler'>Handler</a></code></td>
1656 <td>Map dragging handler (by both mouse and touch).</td>
1657 </tr>
1658 <tr id='map-keyboard'>
1659 <td><code><b>keyboard</b></code></td>
1660 <td><code><a href='#handler'>Handler</a></code></td>
1661 <td>Keyboard navigation handler.</td>
1662 </tr>
1663 <tr id='map-scrollwheelzoom'>
1664 <td><code><b>scrollWheelZoom</b></code></td>
1665 <td><code><a href='#handler'>Handler</a></code></td>
1666 <td>Scroll wheel zoom handler.</td>
1667 </tr>
1668 <tr id='map-tap'>
1669 <td><code><b>tap</b></code></td>
1670 <td><code><a href='#handler'>Handler</a></code></td>
1671 <td>Mobile touch hacks (quick tap and touch hold) handler.</td>
1672 </tr>
1673 <tr id='map-touchzoom'>
1674 <td><code><b>touchZoom</b></code></td>
1675 <td><code><a href='#handler'>Handler</a></code></td>
1676 <td>Touch zoom handler.</td>
1677 </tr>
1678</tbody></table>
1679
1680</section>
1681
1682
1683</section><section>
1684<h3 id='map-pane'>Map panes</h3>
1685
1686<section >
1687
1688
1689
1690<div class='section-comments'>Panes are DOM elements used to control the ordering of layers on the map. You
1691can access panes with <a href="#map-getpane"><code>map.getPane</code></a> or
1692<a href="#map-getpanes"><code>map.getPanes</code></a> methods. New panes can be created with the
1693<a href="#map-createpane"><code>map.createPane</code></a> method.
1694Every map has the following default panes that differ only in zIndex.</div>
1695
1696<table><thead>
1697 <tr>
1698 <th>Pane</th>
1699 <th>Type</th>
1700 <th>Z-index</th>
1701 <th>Description</th>
1702 </tr>
1703 </thead><tbody>
1704 <tr id='map-mappane'>
1705 <td><code><b>mapPane</b></code></td>
1706 <td><code>HTMLElement</code></td>
1707 <td><code>&#x27;auto&#x27;</code></td>
1708 <td>Pane that contains all other map panes</td>
1709 </tr>
1710 <tr id='map-tilepane'>
1711 <td><code><b>tilePane</b></code></td>
1712 <td><code>HTMLElement</code></td>
1713 <td><code>200</code></td>
1714 <td>Pane for <a href="#gridlayer"><code>GridLayer</code></a>s and <a href="#tilelayer"><code>TileLayer</code></a>s</td>
1715 </tr>
1716 <tr id='map-overlaypane'>
1717 <td><code><b>overlayPane</b></code></td>
1718 <td><code>HTMLElement</code></td>
1719 <td><code>400</code></td>
1720 <td>Pane for overlay shadows (e.g. <a href="#marker"><code>Marker</code></a> shadows)</td>
1721 </tr>
1722 <tr id='map-shadowpane'>
1723 <td><code><b>shadowPane</b></code></td>
1724 <td><code>HTMLElement</code></td>
1725 <td><code>500</code></td>
1726 <td>Pane for vectors (<a href="#path"><code>Path</code></a>s, like <a href="#polyline"><code>Polyline</code></a>s and <a href="#polygon"><code>Polygon</code></a>s), <a href="#imageoverlay"><code>ImageOverlay</code></a>s and <a href="#videooverlay"><code>VideoOverlay</code></a>s</td>
1727 </tr>
1728 <tr id='map-markerpane'>
1729 <td><code><b>markerPane</b></code></td>
1730 <td><code>HTMLElement</code></td>
1731 <td><code>600</code></td>
1732 <td>Pane for <a href="#icon"><code>Icon</code></a>s of <a href="#marker"><code>Marker</code></a>s</td>
1733 </tr>
1734 <tr id='map-tooltippane'>
1735 <td><code><b>tooltipPane</b></code></td>
1736 <td><code>HTMLElement</code></td>
1737 <td><code>650</code></td>
1738 <td>Pane for <a href="#tooltip"><code>Tooltip</code></a>s.</td>
1739 </tr>
1740 <tr id='map-popuppane'>
1741 <td><code><b>popupPane</b></code></td>
1742 <td><code>HTMLElement</code></td>
1743 <td><code>700</code></td>
1744 <td>Pane for <a href="#popup"><code>Popup</code></a>s.</td>
1745 </tr>
1746</tbody></table>
1747
1748</section>
1749
1750
1751</section><span id='locate-options'></span>
1752
1753<section>
1754<h3 id='locate-options-option'>Locate options</h3>
1755
1756<section >
1757
1758
1759
1760<div class='section-comments'>Some of the geolocation methods for <a href="#map"><code>Map</code></a> take in an <code>options</code> parameter. This
1761is a plain javascript object with the following optional components:</div>
1762
1763<table><thead>
1764 <tr>
1765 <th>Option</th>
1766 <th>Type</th>
1767 <th>Default</th>
1768 <th>Description</th>
1769 </tr>
1770 </thead><tbody>
1771 <tr id='locate-options-watch'>
1772 <td><code><b>watch</b></code></td>
1773 <td><code>Boolean</code></td>
1774 <td><code>false</code></td>
1775 <td>If <code>true</code>, starts continuous watching of location changes (instead of detecting it
1776once) using W3C <code>watchPosition</code> method. You can later stop watching using
1777<code>map.stopLocate()</code> method.</td>
1778 </tr>
1779 <tr id='locate-options-setview'>
1780 <td><code><b>setView</b></code></td>
1781 <td><code>Boolean</code></td>
1782 <td><code>false</code></td>
1783 <td>If <code>true</code>, automatically sets the map view to the user location with respect to
1784detection accuracy, or to world view if geolocation failed.</td>
1785 </tr>
1786 <tr id='locate-options-maxzoom'>
1787 <td><code><b>maxZoom</b></code></td>
1788 <td><code>Number</code></td>
1789 <td><code>Infinity</code></td>
1790 <td>The maximum zoom for automatic view setting when using <code>setView</code> option.</td>
1791 </tr>
1792 <tr id='locate-options-timeout'>
1793 <td><code><b>timeout</b></code></td>
1794 <td><code>Number</code></td>
1795 <td><code>10000</code></td>
1796 <td>Number of milliseconds to wait for a response from geolocation before firing a
1797<code>locationerror</code> event.</td>
1798 </tr>
1799 <tr id='locate-options-maximumage'>
1800 <td><code><b>maximumAge</b></code></td>
1801 <td><code>Number</code></td>
1802 <td><code>0</code></td>
1803 <td>Maximum age of detected location. If less than this amount of milliseconds
1804passed since last geolocation response, <code>locate</code> will return a cached location.</td>
1805 </tr>
1806 <tr id='locate-options-enablehighaccuracy'>
1807 <td><code><b>enableHighAccuracy</b></code></td>
1808 <td><code>Boolean</code></td>
1809 <td><code>false</code></td>
1810 <td>Enables high accuracy, see <a href="http://dev.w3.org/geo/api/spec-source.html#high-accuracy">description in the W3C spec</a>.</td>
1811 </tr>
1812</tbody></table>
1813
1814</section>
1815
1816
1817</section><span id='zoom-options'></span>
1818
1819<section>
1820<h3 id='zoom-options-option'>Zoom options</h3>
1821
1822<section >
1823
1824
1825
1826<div class='section-comments'>Some of the <a href="#map"><code>Map</code></a> methods which modify the zoom level take in an <code>options</code>
1827parameter. This is a plain javascript object with the following optional
1828components:</div>
1829
1830<table><thead>
1831 <tr>
1832 <th>Option</th>
1833 <th>Type</th>
1834 <th>Default</th>
1835 <th>Description</th>
1836 </tr>
1837 </thead><tbody>
1838 <tr id='zoom-options-animate'>
1839 <td><code><b>animate</b></code></td>
1840 <td><code>Boolean</code></td>
1841 <td><code></code></td>
1842 <td>If not specified, zoom animation will happen if the zoom origin is inside the
1843current view. If <code>true</code>, the map will attempt animating zoom disregarding where
1844zoom origin is. Setting <code>false</code> will make it always reset the view completely
1845without animation.</td>
1846 </tr>
1847</tbody></table>
1848
1849</section>
1850
1851
1852</section><span id='pan-options'></span>
1853
1854<section>
1855<h3 id='pan-options-option'>Pan options</h3>
1856
1857<section >
1858
1859
1860
1861<div class='section-comments'>Some of the <a href="#map"><code>Map</code></a> methods which modify the center of the map take in an <code>options</code>
1862parameter. This is a plain javascript object with the following optional
1863components:</div>
1864
1865<table><thead>
1866 <tr>
1867 <th>Option</th>
1868 <th>Type</th>
1869 <th>Default</th>
1870 <th>Description</th>
1871 </tr>
1872 </thead><tbody>
1873 <tr id='pan-options-animate'>
1874 <td><code><b>animate</b></code></td>
1875 <td><code>Boolean</code></td>
1876 <td><code></code></td>
1877 <td>If <code>true</code>, panning will always be animated if possible. If <code>false</code>, it will
1878not animate panning, either resetting the map view if panning more than a
1879screen away, or just setting a new offset for the map pane (except for <code>panBy</code>
1880which always does the latter).</td>
1881 </tr>
1882 <tr id='pan-options-duration'>
1883 <td><code><b>duration</b></code></td>
1884 <td><code>Number</code></td>
1885 <td><code>0.25</code></td>
1886 <td>Duration of animated panning, in seconds.</td>
1887 </tr>
1888 <tr id='pan-options-easelinearity'>
1889 <td><code><b>easeLinearity</b></code></td>
1890 <td><code>Number</code></td>
1891 <td><code>0.25</code></td>
1892 <td>The curvature factor of panning animation easing (third parameter of the
1893<a href="http://cubic-bezier.com/">Cubic Bezier curve</a>). 1.0 means linear animation,
1894and the smaller this number, the more bowed the curve.</td>
1895 </tr>
1896 <tr id='pan-options-nomovestart'>
1897 <td><code><b>noMoveStart</b></code></td>
1898 <td><code>Boolean</code></td>
1899 <td><code>false</code></td>
1900 <td>If <code>true</code>, panning won&#39;t fire <code>movestart</code> event on start (used internally for
1901panning inertia).</td>
1902 </tr>
1903</tbody></table>
1904
1905</section>
1906
1907
1908</section><span id='zoom/pan-options'></span>
1909
1910<section>
1911<h3 id=''>Zoom/pan options</h3>
1912
1913
1914
1915
1916<div class='accordion'>
1917 <label><span class='expander'></span> Options inherited from <a href='#zoom-options'>Zoom options</a></label>
1918 <div class='accordion-overflow'>
1919 <div class='accordion-content'><section >
1920
1921
1922
1923
1924<table><thead>
1925 <tr>
1926 <th>Option</th>
1927 <th>Type</th>
1928 <th>Default</th>
1929 <th>Description</th>
1930 </tr>
1931 </thead><tbody>
1932 <tr id='zoom/pan-options-animate'>
1933 <td><code><b>animate</b></code></td>
1934 <td><code>Boolean</code></td>
1935 <td><code></code></td>
1936 <td>If not specified, zoom animation will happen if the zoom origin is inside the
1937current view. If <code>true</code>, the map will attempt animating zoom disregarding where
1938zoom origin is. Setting <code>false</code> will make it always reset the view completely
1939without animation.</td>
1940 </tr>
1941</tbody></table>
1942
1943</section></div>
1944 </div>
1945</div>
1946
1947<div class='accordion'>
1948 <label><span class='expander'></span> Options inherited from <a href='#pan-options'>Pan options</a></label>
1949 <div class='accordion-overflow'>
1950 <div class='accordion-content'><section >
1951
1952
1953
1954
1955<table><thead>
1956 <tr>
1957 <th>Option</th>
1958 <th>Type</th>
1959 <th>Default</th>
1960 <th>Description</th>
1961 </tr>
1962 </thead><tbody>
1963 <tr id='zoom/pan-options-duration'>
1964 <td><code><b>duration</b></code></td>
1965 <td><code>Number</code></td>
1966 <td><code>0.25</code></td>
1967 <td>Duration of animated panning, in seconds.</td>
1968 </tr>
1969 <tr id='zoom/pan-options-easelinearity'>
1970 <td><code><b>easeLinearity</b></code></td>
1971 <td><code>Number</code></td>
1972 <td><code>0.25</code></td>
1973 <td>The curvature factor of panning animation easing (third parameter of the
1974<a href="http://cubic-bezier.com/">Cubic Bezier curve</a>). 1.0 means linear animation,
1975and the smaller this number, the more bowed the curve.</td>
1976 </tr>
1977 <tr id='zoom/pan-options-nomovestart'>
1978 <td><code><b>noMoveStart</b></code></td>
1979 <td><code>Boolean</code></td>
1980 <td><code>false</code></td>
1981 <td>If <code>true</code>, panning won&#39;t fire <code>movestart</code> event on start (used internally for
1982panning inertia).</td>
1983 </tr>
1984</tbody></table>
1985
1986</section></div>
1987 </div>
1988</div>
1989
1990</section><span id='fitbounds-options'></span>
1991
1992<section>
1993<h3 id='fitbounds-options-option'>FitBounds options</h3>
1994
1995<section >
1996
1997
1998
1999
2000<table><thead>
2001 <tr>
2002 <th>Option</th>
2003 <th>Type</th>
2004 <th>Default</th>
2005 <th>Description</th>
2006 </tr>
2007 </thead><tbody>
2008 <tr id='fitbounds-options-paddingtopleft'>
2009 <td><code><b>paddingTopLeft</b></code></td>
2010 <td><code><a href='#point'>Point</a></code></td>
2011 <td><code>[0, 0]</code></td>
2012 <td>Sets the amount of padding in the top left corner of a map container that
2013shouldn&#39;t be accounted for when setting the view to fit bounds. Useful if you
2014have some control overlays on the map like a sidebar and you don&#39;t want them
2015to obscure objects you&#39;re zooming to.</td>
2016 </tr>
2017 <tr id='fitbounds-options-paddingbottomright'>
2018 <td><code><b>paddingBottomRight</b></code></td>
2019 <td><code><a href='#point'>Point</a></code></td>
2020 <td><code>[0, 0]</code></td>
2021 <td>The same for the bottom right corner of the map.</td>
2022 </tr>
2023 <tr id='fitbounds-options-padding'>
2024 <td><code><b>padding</b></code></td>
2025 <td><code><a href='#point'>Point</a></code></td>
2026 <td><code>[0, 0]</code></td>
2027 <td>Equivalent of setting both top left and bottom right padding to the same value.</td>
2028 </tr>
2029 <tr id='fitbounds-options-maxzoom'>
2030 <td><code><b>maxZoom</b></code></td>
2031 <td><code>Number</code></td>
2032 <td><code>null</code></td>
2033 <td>The maximum possible zoom to use.</td>
2034 </tr>
2035</tbody></table>
2036
2037</section>
2038
2039
2040<div class='accordion'>
2041 <label><span class='expander'></span> Options inherited from <a href='#zoom-options'>Zoom options</a></label>
2042 <div class='accordion-overflow'>
2043 <div class='accordion-content'><section >
2044
2045
2046
2047
2048<table><thead>
2049 <tr>
2050 <th>Option</th>
2051 <th>Type</th>
2052 <th>Default</th>
2053 <th>Description</th>
2054 </tr>
2055 </thead><tbody>
2056 <tr id='fitbounds-options-animate'>
2057 <td><code><b>animate</b></code></td>
2058 <td><code>Boolean</code></td>
2059 <td><code></code></td>
2060 <td>If not specified, zoom animation will happen if the zoom origin is inside the
2061current view. If <code>true</code>, the map will attempt animating zoom disregarding where
2062zoom origin is. Setting <code>false</code> will make it always reset the view completely
2063without animation.</td>
2064 </tr>
2065</tbody></table>
2066
2067</section></div>
2068 </div>
2069</div>
2070
2071<div class='accordion'>
2072 <label><span class='expander'></span> Options inherited from <a href='#pan-options'>Pan options</a></label>
2073 <div class='accordion-overflow'>
2074 <div class='accordion-content'><section >
2075
2076
2077
2078
2079<table><thead>
2080 <tr>
2081 <th>Option</th>
2082 <th>Type</th>
2083 <th>Default</th>
2084 <th>Description</th>
2085 </tr>
2086 </thead><tbody>
2087 <tr id='fitbounds-options-duration'>
2088 <td><code><b>duration</b></code></td>
2089 <td><code>Number</code></td>
2090 <td><code>0.25</code></td>
2091 <td>Duration of animated panning, in seconds.</td>
2092 </tr>
2093 <tr id='fitbounds-options-easelinearity'>
2094 <td><code><b>easeLinearity</b></code></td>
2095 <td><code>Number</code></td>
2096 <td><code>0.25</code></td>
2097 <td>The curvature factor of panning animation easing (third parameter of the
2098<a href="http://cubic-bezier.com/">Cubic Bezier curve</a>). 1.0 means linear animation,
2099and the smaller this number, the more bowed the curve.</td>
2100 </tr>
2101 <tr id='fitbounds-options-nomovestart'>
2102 <td><code><b>noMoveStart</b></code></td>
2103 <td><code>Boolean</code></td>
2104 <td><code>false</code></td>
2105 <td>If <code>true</code>, panning won&#39;t fire <code>movestart</code> event on start (used internally for
2106panning inertia).</td>
2107 </tr>
2108</tbody></table>
2109
2110</section></div>
2111 </div>
2112</div>
2113
2114</section><h2 id='marker'>Marker</h2><p>L.Marker is used to display clickable/draggable icons on the map. Extends <a href="#layer"><code>Layer</code></a>.</p>
2115
2116<section>
2117<h3 id='marker-example'>Usage example</h3>
2118
2119<section >
2120
2121
2122
2123
2124
2125<pre><code class="lang-js">L.marker([50.5, 30.5]).addTo(map);
2126</code></pre>
2127
2128
2129
2130</section>
2131
2132
2133</section><section>
2134<h3 id='marker-factory'>Creation</h3>
2135
2136<section >
2137
2138
2139
2140
2141<table><thead>
2142 <tr>
2143 <th>Factory</th>
2144 <th>Description</th>
2145 </tr>
2146 </thead><tbody>
2147 <tr id='marker-l-marker'>
2148 <td><code><b>L.marker</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#marker-option'>Marker options</a>&gt;</nobr> <i>options?</i>)</code></td>
2149 <td>Instantiates a Marker object given a geographical point and optionally an options object.</td>
2150 </tr>
2151</tbody></table>
2152
2153</section>
2154
2155
2156</section><section>
2157<h3 id='marker-option'>Options</h3>
2158
2159<section >
2160
2161
2162
2163
2164<table><thead>
2165 <tr>
2166 <th>Option</th>
2167 <th>Type</th>
2168 <th>Default</th>
2169 <th>Description</th>
2170 </tr>
2171 </thead><tbody>
2172 <tr id='marker-icon'>
2173 <td><code><b>icon</b></code></td>
2174 <td><code><a href='#icon'>Icon</a></code></td>
2175 <td><code>*</code></td>
2176 <td>Icon instance to use for rendering the marker.
2177See <a href="#icon">Icon documentation</a> for details on how to customize the marker icon.
2178If not specified, a common instance of <a href="#icon-default"><code>L.Icon.Default</code></a> is used.</td>
2179 </tr>
2180 <tr id='marker-keyboard'>
2181 <td><code><b>keyboard</b></code></td>
2182 <td><code>Boolean</code></td>
2183 <td><code>true</code></td>
2184 <td>Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.</td>
2185 </tr>
2186 <tr id='marker-title'>
2187 <td><code><b>title</b></code></td>
2188 <td><code>String</code></td>
2189 <td><code>&#x27;&#x27;</code></td>
2190 <td>Text for the browser tooltip that appear on marker hover (no tooltip by default).</td>
2191 </tr>
2192 <tr id='marker-alt'>
2193 <td><code><b>alt</b></code></td>
2194 <td><code>String</code></td>
2195 <td><code>&#x27;&#x27;</code></td>
2196 <td>Text for the <code>alt</code> attribute of the icon image (useful for accessibility).</td>
2197 </tr>
2198 <tr id='marker-zindexoffset'>
2199 <td><code><b>zIndexOffset</b></code></td>
2200 <td><code>Number</code></td>
2201 <td><code>0</code></td>
2202 <td>By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like <code>1000</code> (or high negative value, respectively).</td>
2203 </tr>
2204 <tr id='marker-opacity'>
2205 <td><code><b>opacity</b></code></td>
2206 <td><code>Number</code></td>
2207 <td><code>1.0</code></td>
2208 <td>The opacity of the marker.</td>
2209 </tr>
2210 <tr id='marker-riseonhover'>
2211 <td><code><b>riseOnHover</b></code></td>
2212 <td><code>Boolean</code></td>
2213 <td><code>false</code></td>
2214 <td>If <code>true</code>, the marker will get on top of others when you hover the mouse over it.</td>
2215 </tr>
2216 <tr id='marker-riseoffset'>
2217 <td><code><b>riseOffset</b></code></td>
2218 <td><code>Number</code></td>
2219 <td><code>250</code></td>
2220 <td>The z-index offset used for the <code>riseOnHover</code> feature.</td>
2221 </tr>
2222 <tr id='marker-pane'>
2223 <td><code><b>pane</b></code></td>
2224 <td><code>String</code></td>
2225 <td><code>&#x27;markerPane&#x27;</code></td>
2226 <td><code>Map pane</code> where the markers icon will be added.</td>
2227 </tr>
2228 <tr id='marker-shadowpane'>
2229 <td><code><b>shadowPane</b></code></td>
2230 <td><code>String</code></td>
2231 <td><code>&#x27;shadowPane&#x27;</code></td>
2232 <td><code>Map pane</code> where the markers shadow will be added.</td>
2233 </tr>
2234 <tr id='marker-bubblingmouseevents'>
2235 <td><code><b>bubblingMouseEvents</b></code></td>
2236 <td><code>Boolean</code></td>
2237 <td><code>false</code></td>
2238 <td>When <code>true</code>, a mouse event on this marker will trigger the same event on the map
2239(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
2240 </tr>
2241</tbody></table>
2242
2243</section><section class='collapsable'>
2244
2245<h4 id='marker-draggable-marker-options'>Draggable marker options</h4>
2246
2247
2248<table><thead>
2249 <tr>
2250 <th>Option</th>
2251 <th>Type</th>
2252 <th>Default</th>
2253 <th>Description</th>
2254 </tr>
2255 </thead><tbody>
2256 <tr id='marker-draggable'>
2257 <td><code><b>draggable</b></code></td>
2258 <td><code>Boolean</code></td>
2259 <td><code>false</code></td>
2260 <td>Whether the marker is draggable with mouse/touch or not.</td>
2261 </tr>
2262 <tr id='marker-autopan'>
2263 <td><code><b>autoPan</b></code></td>
2264 <td><code>Boolean</code></td>
2265 <td><code>false</code></td>
2266 <td>Whether to pan the map when dragging this marker near its edge or not.</td>
2267 </tr>
2268 <tr id='marker-autopanpadding'>
2269 <td><code><b>autoPanPadding</b></code></td>
2270 <td><code><a href='#point'>Point</a></code></td>
2271 <td><code>Point(50, 50)</code></td>
2272 <td>Distance (in pixels to the left/right and to the top/bottom) of the
2273map edge to start panning the map.</td>
2274 </tr>
2275 <tr id='marker-autopanspeed'>
2276 <td><code><b>autoPanSpeed</b></code></td>
2277 <td><code>Number</code></td>
2278 <td><code>10</code></td>
2279 <td>Number of pixels the map should pan by.</td>
2280 </tr>
2281</tbody></table>
2282
2283</section>
2284
2285
2286<div class='accordion'>
2287 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
2288 <div class='accordion-overflow'>
2289 <div class='accordion-content'><section >
2290
2291
2292
2293
2294<table><thead>
2295 <tr>
2296 <th>Option</th>
2297 <th>Type</th>
2298 <th>Default</th>
2299 <th>Description</th>
2300 </tr>
2301 </thead><tbody>
2302 <tr id='marker-interactive'>
2303 <td><code><b>interactive</b></code></td>
2304 <td><code>Boolean</code></td>
2305 <td><code>true</code></td>
2306 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
2307 </tr>
2308</tbody></table>
2309
2310</section></div>
2311 </div>
2312</div>
2313
2314<div class='accordion'>
2315 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
2316 <div class='accordion-overflow'>
2317 <div class='accordion-content'><section >
2318
2319
2320
2321
2322<table><thead>
2323 <tr>
2324 <th>Option</th>
2325 <th>Type</th>
2326 <th>Default</th>
2327 <th>Description</th>
2328 </tr>
2329 </thead><tbody>
2330 <tr id='marker-attribution'>
2331 <td><code><b>attribution</b></code></td>
2332 <td><code>String</code></td>
2333 <td><code>null</code></td>
2334 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
2335 </tr>
2336</tbody></table>
2337
2338</section></div>
2339 </div>
2340</div>
2341
2342</section><section>
2343<h3 id='marker-event'>Events</h3>
2344
2345<section >
2346
2347
2348
2349
2350<table><thead>
2351 <tr>
2352 <th>Event</th>
2353 <th>Data</th>
2354 <th>Description</th>
2355 </tr>
2356 </thead><tbody>
2357 <tr id='marker-move'>
2358 <td><code><b>move</b></code></td>
2359 <td><code><a href='#event'>Event</a></code></td>
2360 <td>Fired when the marker is moved via <a href="#marker-setlatlng"><code>setLatLng</code></a> or by <a href="#marker-dragging">dragging</a>. Old and new coordinates are included in event arguments as <code>oldLatLng</code>, <a href="#latlng"><code>latlng</code></a>.</td>
2361 </tr>
2362</tbody></table>
2363
2364</section><section class='collapsable'>
2365
2366<h4 id='marker-dragging-events'>Dragging events</h4>
2367
2368
2369<table><thead>
2370 <tr>
2371 <th>Event</th>
2372 <th>Data</th>
2373 <th>Description</th>
2374 </tr>
2375 </thead><tbody>
2376 <tr id='marker-dragstart'>
2377 <td><code><b>dragstart</b></code></td>
2378 <td><code><a href='#event'>Event</a></code></td>
2379 <td>Fired when the user starts dragging the marker.</td>
2380 </tr>
2381 <tr id='marker-movestart'>
2382 <td><code><b>movestart</b></code></td>
2383 <td><code><a href='#event'>Event</a></code></td>
2384 <td>Fired when the marker starts moving (because of dragging).</td>
2385 </tr>
2386 <tr id='marker-drag'>
2387 <td><code><b>drag</b></code></td>
2388 <td><code><a href='#event'>Event</a></code></td>
2389 <td>Fired repeatedly while the user drags the marker.</td>
2390 </tr>
2391 <tr id='marker-dragend'>
2392 <td><code><b>dragend</b></code></td>
2393 <td><code><a href='#dragendevent'>DragEndEvent</a></code></td>
2394 <td>Fired when the user stops dragging the marker.</td>
2395 </tr>
2396 <tr id='marker-moveend'>
2397 <td><code><b>moveend</b></code></td>
2398 <td><code><a href='#event'>Event</a></code></td>
2399 <td>Fired when the marker stops moving (because of dragging).</td>
2400 </tr>
2401</tbody></table>
2402
2403</section>
2404
2405
2406<div class='accordion'>
2407 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
2408 <div class='accordion-overflow'>
2409 <div class='accordion-content'><section >
2410
2411
2412
2413
2414<table><thead>
2415 <tr>
2416 <th>Event</th>
2417 <th>Data</th>
2418 <th>Description</th>
2419 </tr>
2420 </thead><tbody>
2421 <tr id='marker-click'>
2422 <td><code><b>click</b></code></td>
2423 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2424 <td>Fired when the user clicks (or taps) the layer.</td>
2425 </tr>
2426 <tr id='marker-dblclick'>
2427 <td><code><b>dblclick</b></code></td>
2428 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2429 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
2430 </tr>
2431 <tr id='marker-mousedown'>
2432 <td><code><b>mousedown</b></code></td>
2433 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2434 <td>Fired when the user pushes the mouse button on the layer.</td>
2435 </tr>
2436 <tr id='marker-mouseup'>
2437 <td><code><b>mouseup</b></code></td>
2438 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2439 <td>Fired when the user releases the mouse button pushed on the layer.</td>
2440 </tr>
2441 <tr id='marker-mouseover'>
2442 <td><code><b>mouseover</b></code></td>
2443 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2444 <td>Fired when the mouse enters the layer.</td>
2445 </tr>
2446 <tr id='marker-mouseout'>
2447 <td><code><b>mouseout</b></code></td>
2448 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2449 <td>Fired when the mouse leaves the layer.</td>
2450 </tr>
2451 <tr id='marker-contextmenu'>
2452 <td><code><b>contextmenu</b></code></td>
2453 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
2454 <td>Fired when the user right-clicks on the layer, prevents
2455default browser context menu from showing if there are listeners on
2456this event. Also fired on mobile when the user holds a single touch
2457for a second (also called long press).</td>
2458 </tr>
2459</tbody></table>
2460
2461</section></div>
2462 </div>
2463</div>
2464
2465<div class='accordion'>
2466 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
2467 <div class='accordion-overflow'>
2468 <div class='accordion-content'><section >
2469
2470
2471
2472
2473<table><thead>
2474 <tr>
2475 <th>Event</th>
2476 <th>Data</th>
2477 <th>Description</th>
2478 </tr>
2479 </thead><tbody>
2480 <tr id='marker-add'>
2481 <td><code><b>add</b></code></td>
2482 <td><code><a href='#event'>Event</a></code></td>
2483 <td>Fired after the layer is added to a map</td>
2484 </tr>
2485 <tr id='marker-remove'>
2486 <td><code><b>remove</b></code></td>
2487 <td><code><a href='#event'>Event</a></code></td>
2488 <td>Fired after the layer is removed from a map</td>
2489 </tr>
2490</tbody></table>
2491
2492</section></div>
2493 </div>
2494</div>
2495
2496<div class='accordion'>
2497 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
2498 <div class='accordion-overflow'>
2499 <div class='accordion-content'><section >
2500
2501
2502
2503
2504<table><thead>
2505 <tr>
2506 <th>Event</th>
2507 <th>Data</th>
2508 <th>Description</th>
2509 </tr>
2510 </thead><tbody>
2511 <tr id='marker-popupopen'>
2512 <td><code><b>popupopen</b></code></td>
2513 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
2514 <td>Fired when a popup bound to this layer is opened</td>
2515 </tr>
2516 <tr id='marker-popupclose'>
2517 <td><code><b>popupclose</b></code></td>
2518 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
2519 <td>Fired when a popup bound to this layer is closed</td>
2520 </tr>
2521</tbody></table>
2522
2523</section></div>
2524 </div>
2525</div>
2526
2527<div class='accordion'>
2528 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
2529 <div class='accordion-overflow'>
2530 <div class='accordion-content'><section >
2531
2532
2533
2534
2535<table><thead>
2536 <tr>
2537 <th>Event</th>
2538 <th>Data</th>
2539 <th>Description</th>
2540 </tr>
2541 </thead><tbody>
2542 <tr id='marker-tooltipopen'>
2543 <td><code><b>tooltipopen</b></code></td>
2544 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
2545 <td>Fired when a tooltip bound to this layer is opened.</td>
2546 </tr>
2547 <tr id='marker-tooltipclose'>
2548 <td><code><b>tooltipclose</b></code></td>
2549 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
2550 <td>Fired when a tooltip bound to this layer is closed.</td>
2551 </tr>
2552</tbody></table>
2553
2554</section></div>
2555 </div>
2556</div>
2557
2558</section><section>
2559<h3 id='marker-method'>Methods</h3>
2560
2561<section >
2562
2563
2564
2565<div class='section-comments'>In addition to <a href="#layer">shared layer methods</a> like <code>addTo()</code> and <code>remove()</code> and <a href="#popup">popup methods</a> like bindPopup() you can also use the following methods:</div>
2566
2567<table><thead>
2568 <tr>
2569 <th>Method</th>
2570 <th>Returns</th>
2571 <th>Description</th>
2572 </tr>
2573 </thead><tbody>
2574 <tr id='marker-getlatlng'>
2575 <td><code><b>getLatLng</b>()</code></td>
2576 <td><code><a href='#latlng'>LatLng</a></code></td>
2577 <td><p>Returns the current geographical position of the marker.</p>
2578</td>
2579 </tr>
2580 <tr id='marker-setlatlng'>
2581 <td><code><b>setLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
2582 <td><code>this</code></td>
2583 <td><p>Changes the marker position to the given point.</p>
2584</td>
2585 </tr>
2586 <tr id='marker-setzindexoffset'>
2587 <td><code><b>setZIndexOffset</b>(<nobr>&lt;Number&gt;</nobr> <i>offset</i>)</code></td>
2588 <td><code>this</code></td>
2589 <td><p>Changes the <a href="#marker-zindexoffset">zIndex offset</a> of the marker.</p>
2590</td>
2591 </tr>
2592 <tr id='marker-geticon'>
2593 <td><code><b>getIcon</b>()</code></td>
2594 <td><code><a href='#icon'>Icon</a></code></td>
2595 <td><p>Returns the current icon used by the marker</p>
2596</td>
2597 </tr>
2598 <tr id='marker-seticon'>
2599 <td><code><b>setIcon</b>(<nobr>&lt;<a href='#icon'>Icon</a>&gt;</nobr> <i>icon</i>)</code></td>
2600 <td><code>this</code></td>
2601 <td><p>Changes the marker icon.</p>
2602</td>
2603 </tr>
2604 <tr id='marker-setopacity'>
2605 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
2606 <td><code>this</code></td>
2607 <td><p>Changes the opacity of the marker.</p>
2608</td>
2609 </tr>
2610</tbody></table>
2611
2612</section><section class='collapsable'>
2613
2614<h4 id='marker-other-methods'>Other methods</h4>
2615
2616
2617<table><thead>
2618 <tr>
2619 <th>Method</th>
2620 <th>Returns</th>
2621 <th>Description</th>
2622 </tr>
2623 </thead><tbody>
2624 <tr id='marker-togeojson'>
2625 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
2626 <td><code>Object</code></td>
2627 <td><p><code>precision</code> is the number of decimal places for coordinates.
2628The default value is 6 places.
2629Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the marker (as a GeoJSON <a href="#point"><code>Point</code></a> Feature).</p>
2630</td>
2631 </tr>
2632</tbody></table>
2633
2634</section>
2635
2636
2637<div class='accordion'>
2638 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
2639 <div class='accordion-overflow'>
2640 <div class='accordion-content'><section >
2641
2642
2643
2644
2645<table><thead>
2646 <tr>
2647 <th>Method</th>
2648 <th>Returns</th>
2649 <th>Description</th>
2650 </tr>
2651 </thead><tbody>
2652 <tr id='marker-addto'>
2653 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
2654 <td><code>this</code></td>
2655 <td><p>Adds the layer to the given map or layer group.</p>
2656</td>
2657 </tr>
2658 <tr id='marker-remove'>
2659 <td><code><b>remove</b>()</code></td>
2660 <td><code>this</code></td>
2661 <td><p>Removes the layer from the map it is currently active on.</p>
2662</td>
2663 </tr>
2664 <tr id='marker-removefrom'>
2665 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
2666 <td><code>this</code></td>
2667 <td><p>Removes the layer from the given map</p>
2668</td>
2669 </tr>
2670 <tr id='marker-removefrom'>
2671 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
2672 <td><code>this</code></td>
2673 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
2674</td>
2675 </tr>
2676 <tr id='marker-getpane'>
2677 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
2678 <td><code>HTMLElement</code></td>
2679 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
2680</td>
2681 </tr>
2682 <tr id='marker-getattribution'>
2683 <td><code><b>getAttribution</b>()</code></td>
2684 <td><code>String</code></td>
2685 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
2686</td>
2687 </tr>
2688</tbody></table>
2689
2690</section></div>
2691 </div>
2692</div>
2693
2694<div class='accordion'>
2695 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
2696 <div class='accordion-overflow'>
2697 <div class='accordion-content'><section >
2698
2699
2700
2701
2702<table><thead>
2703 <tr>
2704 <th>Method</th>
2705 <th>Returns</th>
2706 <th>Description</th>
2707 </tr>
2708 </thead><tbody>
2709 <tr id='marker-bindpopup'>
2710 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
2711 <td><code>this</code></td>
2712 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
2713necessary event listeners. If a <code>Function</code> is passed it will receive
2714the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
2715</td>
2716 </tr>
2717 <tr id='marker-unbindpopup'>
2718 <td><code><b>unbindPopup</b>()</code></td>
2719 <td><code>this</code></td>
2720 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
2721</td>
2722 </tr>
2723 <tr id='marker-openpopup'>
2724 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
2725 <td><code>this</code></td>
2726 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
2727</td>
2728 </tr>
2729 <tr id='marker-closepopup'>
2730 <td><code><b>closePopup</b>()</code></td>
2731 <td><code>this</code></td>
2732 <td><p>Closes the popup bound to this layer if it is open.</p>
2733</td>
2734 </tr>
2735 <tr id='marker-togglepopup'>
2736 <td><code><b>togglePopup</b>()</code></td>
2737 <td><code>this</code></td>
2738 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
2739</td>
2740 </tr>
2741 <tr id='marker-ispopupopen'>
2742 <td><code><b>isPopupOpen</b>()</code></td>
2743 <td><code>boolean</code></td>
2744 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
2745</td>
2746 </tr>
2747 <tr id='marker-setpopupcontent'>
2748 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
2749 <td><code>this</code></td>
2750 <td><p>Sets the content of the popup bound to this layer.</p>
2751</td>
2752 </tr>
2753 <tr id='marker-getpopup'>
2754 <td><code><b>getPopup</b>()</code></td>
2755 <td><code><a href='#popup'>Popup</a></code></td>
2756 <td><p>Returns the popup bound to this layer.</p>
2757</td>
2758 </tr>
2759</tbody></table>
2760
2761</section></div>
2762 </div>
2763</div>
2764
2765<div class='accordion'>
2766 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
2767 <div class='accordion-overflow'>
2768 <div class='accordion-content'><section >
2769
2770
2771
2772
2773<table><thead>
2774 <tr>
2775 <th>Method</th>
2776 <th>Returns</th>
2777 <th>Description</th>
2778 </tr>
2779 </thead><tbody>
2780 <tr id='marker-bindtooltip'>
2781 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
2782 <td><code>this</code></td>
2783 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
2784necessary event listeners. If a <code>Function</code> is passed it will receive
2785the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
2786</td>
2787 </tr>
2788 <tr id='marker-unbindtooltip'>
2789 <td><code><b>unbindTooltip</b>()</code></td>
2790 <td><code>this</code></td>
2791 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
2792</td>
2793 </tr>
2794 <tr id='marker-opentooltip'>
2795 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
2796 <td><code>this</code></td>
2797 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
2798</td>
2799 </tr>
2800 <tr id='marker-closetooltip'>
2801 <td><code><b>closeTooltip</b>()</code></td>
2802 <td><code>this</code></td>
2803 <td><p>Closes the tooltip bound to this layer if it is open.</p>
2804</td>
2805 </tr>
2806 <tr id='marker-toggletooltip'>
2807 <td><code><b>toggleTooltip</b>()</code></td>
2808 <td><code>this</code></td>
2809 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
2810</td>
2811 </tr>
2812 <tr id='marker-istooltipopen'>
2813 <td><code><b>isTooltipOpen</b>()</code></td>
2814 <td><code>boolean</code></td>
2815 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
2816</td>
2817 </tr>
2818 <tr id='marker-settooltipcontent'>
2819 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
2820 <td><code>this</code></td>
2821 <td><p>Sets the content of the tooltip bound to this layer.</p>
2822</td>
2823 </tr>
2824 <tr id='marker-gettooltip'>
2825 <td><code><b>getTooltip</b>()</code></td>
2826 <td><code><a href='#tooltip'>Tooltip</a></code></td>
2827 <td><p>Returns the tooltip bound to this layer.</p>
2828</td>
2829 </tr>
2830</tbody></table>
2831
2832</section></div>
2833 </div>
2834</div>
2835
2836<div class='accordion'>
2837 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
2838 <div class='accordion-overflow'>
2839 <div class='accordion-content'><section >
2840
2841
2842
2843
2844<table><thead>
2845 <tr>
2846 <th>Method</th>
2847 <th>Returns</th>
2848 <th>Description</th>
2849 </tr>
2850 </thead><tbody>
2851 <tr id='marker-on'>
2852 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
2853 <td><code>this</code></td>
2854 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
2855</td>
2856 </tr>
2857 <tr id='marker-on'>
2858 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
2859 <td><code>this</code></td>
2860 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
2861</td>
2862 </tr>
2863 <tr id='marker-off'>
2864 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
2865 <td><code>this</code></td>
2866 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
2867</td>
2868 </tr>
2869 <tr id='marker-off'>
2870 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
2871 <td><code>this</code></td>
2872 <td><p>Removes a set of type/listener pairs.</p>
2873</td>
2874 </tr>
2875 <tr id='marker-off'>
2876 <td><code><b>off</b>()</code></td>
2877 <td><code>this</code></td>
2878 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
2879</td>
2880 </tr>
2881 <tr id='marker-fire'>
2882 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
2883 <td><code>this</code></td>
2884 <td><p>Fires an event of the specified type. You can optionally provide an data
2885object — the first argument of the listener function will contain its
2886properties. The event can optionally be propagated to event parents.</p>
2887</td>
2888 </tr>
2889 <tr id='marker-listens'>
2890 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
2891 <td><code>Boolean</code></td>
2892 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
2893</td>
2894 </tr>
2895 <tr id='marker-once'>
2896 <td><code><b>once</b>(<i></i>)</code></td>
2897 <td><code>this</code></td>
2898 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
2899</td>
2900 </tr>
2901 <tr id='marker-addeventparent'>
2902 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
2903 <td><code>this</code></td>
2904 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
2905</td>
2906 </tr>
2907 <tr id='marker-removeeventparent'>
2908 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
2909 <td><code>this</code></td>
2910 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
2911</td>
2912 </tr>
2913 <tr id='marker-addeventlistener'>
2914 <td><code><b>addEventListener</b>(<i></i>)</code></td>
2915 <td><code>this</code></td>
2916 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
2917</td>
2918 </tr>
2919 <tr id='marker-removeeventlistener'>
2920 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
2921 <td><code>this</code></td>
2922 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
2923</td>
2924 </tr>
2925 <tr id='marker-clearalleventlisteners'>
2926 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
2927 <td><code>this</code></td>
2928 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
2929</td>
2930 </tr>
2931 <tr id='marker-addonetimeeventlistener'>
2932 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
2933 <td><code>this</code></td>
2934 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
2935</td>
2936 </tr>
2937 <tr id='marker-fireevent'>
2938 <td><code><b>fireEvent</b>(<i></i>)</code></td>
2939 <td><code>this</code></td>
2940 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
2941</td>
2942 </tr>
2943 <tr id='marker-haseventlisteners'>
2944 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
2945 <td><code>Boolean</code></td>
2946 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
2947</td>
2948 </tr>
2949</tbody></table>
2950
2951</section></div>
2952 </div>
2953</div>
2954
2955</section><section>
2956<h3 id='marker-property'>Properties</h3>
2957
2958<section class='collapsable'>
2959
2960<h4 id='marker-interaction-handlers'>Interaction handlers</h4>
2961
2962<div class='section-comments'>Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see <a href="#handler"><code>Handler</code></a> methods). Example:
2963<pre><code class="lang-js">marker.dragging.disable();
2964</code></pre></div>
2965
2966<table><thead>
2967 <tr>
2968 <th>Property</th>
2969 <th>Type</th>
2970 <th>Description</th>
2971 </tr>
2972 </thead><tbody>
2973 <tr id='marker-dragging'>
2974 <td><code><b>dragging</b></code></td>
2975 <td><code><a href='#handler'>Handler</a></code></td>
2976 <td>Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set <a href="#marker-draggable"><code>marker.options.draggable</code></a>).</td>
2977 </tr>
2978</tbody></table>
2979
2980</section>
2981
2982
2983</section><h2 id='popup'>Popup</h2><p>Used to open popups in certain places of the map. Use <a href="#map-openpopup">Map.openPopup</a> to
2984open popups while making sure that only one popup is open at one time
2985(recommended for usability), or use <a href="#map-addlayer">Map.addLayer</a> to open as many as you want.</p>
2986
2987<section>
2988<h3 id='popup-example'>Usage example</h3>
2989
2990<section >
2991
2992
2993
2994
2995
2996<p>If you want to just bind a popup to marker click and then open it, it&#39;s really easy:</p>
2997<pre><code class="lang-js">marker.bindPopup(popupContent).openPopup();
2998</code></pre>
2999<p>Path overlays like polylines also have a <code>bindPopup</code> method.
3000Here&#39;s a more complicated way to open a popup on a map:</p>
3001<pre><code class="lang-js">var popup = L.popup()
3002 .setLatLng(latlng)
3003 .setContent(&#39;&lt;p&gt;Hello world!&lt;br /&gt;This is a nice popup.&lt;/p&gt;&#39;)
3004 .openOn(map);
3005</code></pre>
3006
3007
3008
3009</section>
3010
3011
3012</section><section>
3013<h3 id='popup-factory'>Creation</h3>
3014
3015<section >
3016
3017
3018
3019
3020<table><thead>
3021 <tr>
3022 <th>Factory</th>
3023 <th>Description</th>
3024 </tr>
3025 </thead><tbody>
3026 <tr id='popup-l-popup'>
3027 <td><code><b>L.popup</b>(<nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>, <nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>source?</i>)</code></td>
3028 <td>Instantiates a <a href="#popup"><code>Popup</code></a> object given an optional <code>options</code> object that describes its appearance and location and an optional <code>source</code> object that is used to tag the popup with a reference to the Layer to which it refers.</td>
3029 </tr>
3030</tbody></table>
3031
3032</section>
3033
3034
3035</section><section>
3036<h3 id='popup-option'>Options</h3>
3037
3038<section >
3039
3040
3041
3042
3043<table><thead>
3044 <tr>
3045 <th>Option</th>
3046 <th>Type</th>
3047 <th>Default</th>
3048 <th>Description</th>
3049 </tr>
3050 </thead><tbody>
3051 <tr id='popup-maxwidth'>
3052 <td><code><b>maxWidth</b></code></td>
3053 <td><code>Number</code></td>
3054 <td><code>300</code></td>
3055 <td>Max width of the popup, in pixels.</td>
3056 </tr>
3057 <tr id='popup-minwidth'>
3058 <td><code><b>minWidth</b></code></td>
3059 <td><code>Number</code></td>
3060 <td><code>50</code></td>
3061 <td>Min width of the popup, in pixels.</td>
3062 </tr>
3063 <tr id='popup-maxheight'>
3064 <td><code><b>maxHeight</b></code></td>
3065 <td><code>Number</code></td>
3066 <td><code>null</code></td>
3067 <td>If set, creates a scrollable container of the given height
3068inside a popup if its content exceeds it.</td>
3069 </tr>
3070 <tr id='popup-autopan'>
3071 <td><code><b>autoPan</b></code></td>
3072 <td><code>Boolean</code></td>
3073 <td><code>true</code></td>
3074 <td>Set it to <code>false</code> if you don&#39;t want the map to do panning animation
3075to fit the opened popup.</td>
3076 </tr>
3077 <tr id='popup-autopanpaddingtopleft'>
3078 <td><code><b>autoPanPaddingTopLeft</b></code></td>
3079 <td><code><a href='#point'>Point</a></code></td>
3080 <td><code>null</code></td>
3081 <td>The margin between the popup and the top left corner of the map
3082view after autopanning was performed.</td>
3083 </tr>
3084 <tr id='popup-autopanpaddingbottomright'>
3085 <td><code><b>autoPanPaddingBottomRight</b></code></td>
3086 <td><code><a href='#point'>Point</a></code></td>
3087 <td><code>null</code></td>
3088 <td>The margin between the popup and the bottom right corner of the map
3089view after autopanning was performed.</td>
3090 </tr>
3091 <tr id='popup-autopanpadding'>
3092 <td><code><b>autoPanPadding</b></code></td>
3093 <td><code><a href='#point'>Point</a></code></td>
3094 <td><code>Point(5, 5)</code></td>
3095 <td>Equivalent of setting both top left and bottom right autopan padding to the same value.</td>
3096 </tr>
3097 <tr id='popup-keepinview'>
3098 <td><code><b>keepInView</b></code></td>
3099 <td><code>Boolean</code></td>
3100 <td><code>false</code></td>
3101 <td>Set it to <code>true</code> if you want to prevent users from panning the popup
3102off of the screen while it is open.</td>
3103 </tr>
3104 <tr id='popup-closebutton'>
3105 <td><code><b>closeButton</b></code></td>
3106 <td><code>Boolean</code></td>
3107 <td><code>true</code></td>
3108 <td>Controls the presence of a close button in the popup.</td>
3109 </tr>
3110 <tr id='popup-autoclose'>
3111 <td><code><b>autoClose</b></code></td>
3112 <td><code>Boolean</code></td>
3113 <td><code>true</code></td>
3114 <td>Set it to <code>false</code> if you want to override the default behavior of
3115the popup closing when another popup is opened.</td>
3116 </tr>
3117 <tr id='popup-closeonescapekey'>
3118 <td><code><b>closeOnEscapeKey</b></code></td>
3119 <td><code>Boolean</code></td>
3120 <td><code>true</code></td>
3121 <td>Set it to <code>false</code> if you want to override the default behavior of
3122the ESC key for closing of the popup.</td>
3123 </tr>
3124 <tr id='popup-closeonclick'>
3125 <td><code><b>closeOnClick</b></code></td>
3126 <td><code>Boolean</code></td>
3127 <td><code>*</code></td>
3128 <td>Set it if you want to override the default behavior of the popup closing when user clicks
3129on the map. Defaults to the map&#39;s <a href="#map-closepopuponclick"><code>closePopupOnClick</code></a> option.</td>
3130 </tr>
3131 <tr id='popup-classname'>
3132 <td><code><b>className</b></code></td>
3133 <td><code>String</code></td>
3134 <td><code>&#x27;&#x27;</code></td>
3135 <td>A custom CSS class name to assign to the popup.</td>
3136 </tr>
3137</tbody></table>
3138
3139</section>
3140
3141
3142<div class='accordion'>
3143 <label><span class='expander'></span> Options inherited from <a href='#divoverlay'>DivOverlay</a></label>
3144 <div class='accordion-overflow'>
3145 <div class='accordion-content'><section >
3146
3147
3148
3149
3150<table><thead>
3151 <tr>
3152 <th>Option</th>
3153 <th>Type</th>
3154 <th>Default</th>
3155 <th>Description</th>
3156 </tr>
3157 </thead><tbody>
3158 <tr id='popup-offset'>
3159 <td><code><b>offset</b></code></td>
3160 <td><code><a href='#point'>Point</a></code></td>
3161 <td><code>Point(0, 7)</code></td>
3162 <td>The offset of the popup position. Useful to control the anchor
3163of the popup when opening it on some overlays.</td>
3164 </tr>
3165 <tr id='popup-pane'>
3166 <td><code><b>pane</b></code></td>
3167 <td><code>String</code></td>
3168 <td><code>&#x27;popupPane&#x27;</code></td>
3169 <td><code>Map pane</code> where the popup will be added.</td>
3170 </tr>
3171</tbody></table>
3172
3173</section></div>
3174 </div>
3175</div>
3176
3177<div class='accordion'>
3178 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
3179 <div class='accordion-overflow'>
3180 <div class='accordion-content'><section >
3181
3182
3183
3184
3185<table><thead>
3186 <tr>
3187 <th>Option</th>
3188 <th>Type</th>
3189 <th>Default</th>
3190 <th>Description</th>
3191 </tr>
3192 </thead><tbody>
3193 <tr id='popup-attribution'>
3194 <td><code><b>attribution</b></code></td>
3195 <td><code>String</code></td>
3196 <td><code>null</code></td>
3197 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
3198 </tr>
3199</tbody></table>
3200
3201</section></div>
3202 </div>
3203</div>
3204
3205</section><section>
3206<h3 id=''>Events</h3>
3207
3208
3209
3210
3211<div class='accordion'>
3212 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
3213 <div class='accordion-overflow'>
3214 <div class='accordion-content'><section >
3215
3216
3217
3218
3219<table><thead>
3220 <tr>
3221 <th>Event</th>
3222 <th>Data</th>
3223 <th>Description</th>
3224 </tr>
3225 </thead><tbody>
3226 <tr id='popup-add'>
3227 <td><code><b>add</b></code></td>
3228 <td><code><a href='#event'>Event</a></code></td>
3229 <td>Fired after the layer is added to a map</td>
3230 </tr>
3231 <tr id='popup-remove'>
3232 <td><code><b>remove</b></code></td>
3233 <td><code><a href='#event'>Event</a></code></td>
3234 <td>Fired after the layer is removed from a map</td>
3235 </tr>
3236</tbody></table>
3237
3238</section></div>
3239 </div>
3240</div>
3241
3242<div class='accordion'>
3243 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
3244 <div class='accordion-overflow'>
3245 <div class='accordion-content'><section >
3246
3247
3248
3249
3250<table><thead>
3251 <tr>
3252 <th>Event</th>
3253 <th>Data</th>
3254 <th>Description</th>
3255 </tr>
3256 </thead><tbody>
3257 <tr id='popup-popupopen'>
3258 <td><code><b>popupopen</b></code></td>
3259 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
3260 <td>Fired when a popup bound to this layer is opened</td>
3261 </tr>
3262 <tr id='popup-popupclose'>
3263 <td><code><b>popupclose</b></code></td>
3264 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
3265 <td>Fired when a popup bound to this layer is closed</td>
3266 </tr>
3267</tbody></table>
3268
3269</section></div>
3270 </div>
3271</div>
3272
3273<div class='accordion'>
3274 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
3275 <div class='accordion-overflow'>
3276 <div class='accordion-content'><section >
3277
3278
3279
3280
3281<table><thead>
3282 <tr>
3283 <th>Event</th>
3284 <th>Data</th>
3285 <th>Description</th>
3286 </tr>
3287 </thead><tbody>
3288 <tr id='popup-tooltipopen'>
3289 <td><code><b>tooltipopen</b></code></td>
3290 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
3291 <td>Fired when a tooltip bound to this layer is opened.</td>
3292 </tr>
3293 <tr id='popup-tooltipclose'>
3294 <td><code><b>tooltipclose</b></code></td>
3295 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
3296 <td>Fired when a tooltip bound to this layer is closed.</td>
3297 </tr>
3298</tbody></table>
3299
3300</section></div>
3301 </div>
3302</div>
3303
3304</section><section>
3305<h3 id='popup-method'>Methods</h3>
3306
3307<section >
3308
3309
3310
3311
3312<table><thead>
3313 <tr>
3314 <th>Method</th>
3315 <th>Returns</th>
3316 <th>Description</th>
3317 </tr>
3318 </thead><tbody>
3319 <tr id='popup-getlatlng'>
3320 <td><code><b>getLatLng</b>()</code></td>
3321 <td><code><a href='#latlng'>LatLng</a></code></td>
3322 <td><p>Returns the geographical point of popup.</p>
3323</td>
3324 </tr>
3325 <tr id='popup-setlatlng'>
3326 <td><code><b>setLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
3327 <td><code>this</code></td>
3328 <td><p>Sets the geographical point where the popup will open.</p>
3329</td>
3330 </tr>
3331 <tr id='popup-getcontent'>
3332 <td><code><b>getContent</b>()</code></td>
3333 <td><code>String|HTMLElement</code></td>
3334 <td><p>Returns the content of the popup.</p>
3335</td>
3336 </tr>
3337 <tr id='popup-setcontent'>
3338 <td><code><b>setContent</b>(<nobr>&lt;String|HTMLElement|Function&gt;</nobr> <i>htmlContent</i>)</code></td>
3339 <td><code>this</code></td>
3340 <td><p>Sets the HTML content of the popup. If a function is passed the source layer will be passed to the function. The function should return a <code>String</code> or <code>HTMLElement</code> to be used in the popup.</p>
3341</td>
3342 </tr>
3343 <tr id='popup-getelement'>
3344 <td><code><b>getElement</b>()</code></td>
3345 <td><code>String|HTMLElement</code></td>
3346 <td><p>Returns the HTML container of the popup.</p>
3347</td>
3348 </tr>
3349 <tr id='popup-update'>
3350 <td><code><b>update</b>()</code></td>
3351 <td><code>null</code></td>
3352 <td><p>Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.</p>
3353</td>
3354 </tr>
3355 <tr id='popup-isopen'>
3356 <td><code><b>isOpen</b>()</code></td>
3357 <td><code>Boolean</code></td>
3358 <td><p>Returns <code>true</code> when the popup is visible on the map.</p>
3359</td>
3360 </tr>
3361 <tr id='popup-bringtofront'>
3362 <td><code><b>bringToFront</b>()</code></td>
3363 <td><code>this</code></td>
3364 <td><p>Brings this popup in front of other popups (in the same map pane).</p>
3365</td>
3366 </tr>
3367 <tr id='popup-bringtoback'>
3368 <td><code><b>bringToBack</b>()</code></td>
3369 <td><code>this</code></td>
3370 <td><p>Brings this popup to the back of other popups (in the same map pane).</p>
3371</td>
3372 </tr>
3373 <tr id='popup-openon'>
3374 <td><code><b>openOn</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
3375 <td><code>this</code></td>
3376 <td><p>Adds the popup to the map and closes the previous one. The same as <code>map.openPopup(popup)</code>.</p>
3377</td>
3378 </tr>
3379</tbody></table>
3380
3381</section>
3382
3383
3384<div class='accordion'>
3385 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
3386 <div class='accordion-overflow'>
3387 <div class='accordion-content'><section >
3388
3389
3390
3391
3392<table><thead>
3393 <tr>
3394 <th>Method</th>
3395 <th>Returns</th>
3396 <th>Description</th>
3397 </tr>
3398 </thead><tbody>
3399 <tr id='popup-addto'>
3400 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
3401 <td><code>this</code></td>
3402 <td><p>Adds the layer to the given map or layer group.</p>
3403</td>
3404 </tr>
3405 <tr id='popup-remove'>
3406 <td><code><b>remove</b>()</code></td>
3407 <td><code>this</code></td>
3408 <td><p>Removes the layer from the map it is currently active on.</p>
3409</td>
3410 </tr>
3411 <tr id='popup-removefrom'>
3412 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
3413 <td><code>this</code></td>
3414 <td><p>Removes the layer from the given map</p>
3415</td>
3416 </tr>
3417 <tr id='popup-removefrom'>
3418 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
3419 <td><code>this</code></td>
3420 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
3421</td>
3422 </tr>
3423 <tr id='popup-getpane'>
3424 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
3425 <td><code>HTMLElement</code></td>
3426 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
3427</td>
3428 </tr>
3429 <tr id='popup-getattribution'>
3430 <td><code><b>getAttribution</b>()</code></td>
3431 <td><code>String</code></td>
3432 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
3433</td>
3434 </tr>
3435</tbody></table>
3436
3437</section></div>
3438 </div>
3439</div>
3440
3441<div class='accordion'>
3442 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
3443 <div class='accordion-overflow'>
3444 <div class='accordion-content'><section >
3445
3446
3447
3448
3449<table><thead>
3450 <tr>
3451 <th>Method</th>
3452 <th>Returns</th>
3453 <th>Description</th>
3454 </tr>
3455 </thead><tbody>
3456 <tr id='popup-bindpopup'>
3457 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
3458 <td><code>this</code></td>
3459 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
3460necessary event listeners. If a <code>Function</code> is passed it will receive
3461the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
3462</td>
3463 </tr>
3464 <tr id='popup-unbindpopup'>
3465 <td><code><b>unbindPopup</b>()</code></td>
3466 <td><code>this</code></td>
3467 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
3468</td>
3469 </tr>
3470 <tr id='popup-openpopup'>
3471 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
3472 <td><code>this</code></td>
3473 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
3474</td>
3475 </tr>
3476 <tr id='popup-closepopup'>
3477 <td><code><b>closePopup</b>()</code></td>
3478 <td><code>this</code></td>
3479 <td><p>Closes the popup bound to this layer if it is open.</p>
3480</td>
3481 </tr>
3482 <tr id='popup-togglepopup'>
3483 <td><code><b>togglePopup</b>()</code></td>
3484 <td><code>this</code></td>
3485 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
3486</td>
3487 </tr>
3488 <tr id='popup-ispopupopen'>
3489 <td><code><b>isPopupOpen</b>()</code></td>
3490 <td><code>boolean</code></td>
3491 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
3492</td>
3493 </tr>
3494 <tr id='popup-setpopupcontent'>
3495 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
3496 <td><code>this</code></td>
3497 <td><p>Sets the content of the popup bound to this layer.</p>
3498</td>
3499 </tr>
3500 <tr id='popup-getpopup'>
3501 <td><code><b>getPopup</b>()</code></td>
3502 <td><code><a href='#popup'>Popup</a></code></td>
3503 <td><p>Returns the popup bound to this layer.</p>
3504</td>
3505 </tr>
3506</tbody></table>
3507
3508</section></div>
3509 </div>
3510</div>
3511
3512<div class='accordion'>
3513 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
3514 <div class='accordion-overflow'>
3515 <div class='accordion-content'><section >
3516
3517
3518
3519
3520<table><thead>
3521 <tr>
3522 <th>Method</th>
3523 <th>Returns</th>
3524 <th>Description</th>
3525 </tr>
3526 </thead><tbody>
3527 <tr id='popup-bindtooltip'>
3528 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
3529 <td><code>this</code></td>
3530 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
3531necessary event listeners. If a <code>Function</code> is passed it will receive
3532the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
3533</td>
3534 </tr>
3535 <tr id='popup-unbindtooltip'>
3536 <td><code><b>unbindTooltip</b>()</code></td>
3537 <td><code>this</code></td>
3538 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
3539</td>
3540 </tr>
3541 <tr id='popup-opentooltip'>
3542 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
3543 <td><code>this</code></td>
3544 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
3545</td>
3546 </tr>
3547 <tr id='popup-closetooltip'>
3548 <td><code><b>closeTooltip</b>()</code></td>
3549 <td><code>this</code></td>
3550 <td><p>Closes the tooltip bound to this layer if it is open.</p>
3551</td>
3552 </tr>
3553 <tr id='popup-toggletooltip'>
3554 <td><code><b>toggleTooltip</b>()</code></td>
3555 <td><code>this</code></td>
3556 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
3557</td>
3558 </tr>
3559 <tr id='popup-istooltipopen'>
3560 <td><code><b>isTooltipOpen</b>()</code></td>
3561 <td><code>boolean</code></td>
3562 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
3563</td>
3564 </tr>
3565 <tr id='popup-settooltipcontent'>
3566 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
3567 <td><code>this</code></td>
3568 <td><p>Sets the content of the tooltip bound to this layer.</p>
3569</td>
3570 </tr>
3571 <tr id='popup-gettooltip'>
3572 <td><code><b>getTooltip</b>()</code></td>
3573 <td><code><a href='#tooltip'>Tooltip</a></code></td>
3574 <td><p>Returns the tooltip bound to this layer.</p>
3575</td>
3576 </tr>
3577</tbody></table>
3578
3579</section></div>
3580 </div>
3581</div>
3582
3583<div class='accordion'>
3584 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
3585 <div class='accordion-overflow'>
3586 <div class='accordion-content'><section >
3587
3588
3589
3590
3591<table><thead>
3592 <tr>
3593 <th>Method</th>
3594 <th>Returns</th>
3595 <th>Description</th>
3596 </tr>
3597 </thead><tbody>
3598 <tr id='popup-on'>
3599 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
3600 <td><code>this</code></td>
3601 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
3602</td>
3603 </tr>
3604 <tr id='popup-on'>
3605 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
3606 <td><code>this</code></td>
3607 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
3608</td>
3609 </tr>
3610 <tr id='popup-off'>
3611 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
3612 <td><code>this</code></td>
3613 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
3614</td>
3615 </tr>
3616 <tr id='popup-off'>
3617 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
3618 <td><code>this</code></td>
3619 <td><p>Removes a set of type/listener pairs.</p>
3620</td>
3621 </tr>
3622 <tr id='popup-off'>
3623 <td><code><b>off</b>()</code></td>
3624 <td><code>this</code></td>
3625 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
3626</td>
3627 </tr>
3628 <tr id='popup-fire'>
3629 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
3630 <td><code>this</code></td>
3631 <td><p>Fires an event of the specified type. You can optionally provide an data
3632object — the first argument of the listener function will contain its
3633properties. The event can optionally be propagated to event parents.</p>
3634</td>
3635 </tr>
3636 <tr id='popup-listens'>
3637 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
3638 <td><code>Boolean</code></td>
3639 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
3640</td>
3641 </tr>
3642 <tr id='popup-once'>
3643 <td><code><b>once</b>(<i></i>)</code></td>
3644 <td><code>this</code></td>
3645 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
3646</td>
3647 </tr>
3648 <tr id='popup-addeventparent'>
3649 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
3650 <td><code>this</code></td>
3651 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
3652</td>
3653 </tr>
3654 <tr id='popup-removeeventparent'>
3655 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
3656 <td><code>this</code></td>
3657 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
3658</td>
3659 </tr>
3660 <tr id='popup-addeventlistener'>
3661 <td><code><b>addEventListener</b>(<i></i>)</code></td>
3662 <td><code>this</code></td>
3663 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
3664</td>
3665 </tr>
3666 <tr id='popup-removeeventlistener'>
3667 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
3668 <td><code>this</code></td>
3669 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
3670</td>
3671 </tr>
3672 <tr id='popup-clearalleventlisteners'>
3673 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
3674 <td><code>this</code></td>
3675 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
3676</td>
3677 </tr>
3678 <tr id='popup-addonetimeeventlistener'>
3679 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
3680 <td><code>this</code></td>
3681 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
3682</td>
3683 </tr>
3684 <tr id='popup-fireevent'>
3685 <td><code><b>fireEvent</b>(<i></i>)</code></td>
3686 <td><code>this</code></td>
3687 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
3688</td>
3689 </tr>
3690 <tr id='popup-haseventlisteners'>
3691 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
3692 <td><code>Boolean</code></td>
3693 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
3694</td>
3695 </tr>
3696</tbody></table>
3697
3698</section></div>
3699 </div>
3700</div>
3701
3702</section><h2 id='tooltip'>Tooltip</h2><p>Used to display small texts on top of map layers.</p>
3703
3704<section>
3705<h3 id='tooltip-example'>Usage example</h3>
3706
3707<section >
3708
3709
3710
3711
3712
3713<pre><code class="lang-js">marker.bindTooltip(&quot;my tooltip text&quot;).openTooltip();
3714</code></pre>
3715<p>Note about tooltip offset. Leaflet takes two options in consideration
3716for computing tooltip offsetting:</p>
3717<ul>
3718<li>the <code>offset</code> Tooltip option: it defaults to [0, 0], and it&#39;s specific to one tooltip.
3719Add a positive x offset to move the tooltip to the right, and a positive y offset to
3720move it to the bottom. Negatives will move to the left and top.</li>
3721<li>the <code>tooltipAnchor</code> Icon option: this will only be considered for Marker. You
3722should adapt this value if you use a custom icon.</li>
3723</ul>
3724
3725
3726
3727</section>
3728
3729
3730</section><section>
3731<h3 id='tooltip-factory'>Creation</h3>
3732
3733<section >
3734
3735
3736
3737
3738<table><thead>
3739 <tr>
3740 <th>Factory</th>
3741 <th>Description</th>
3742 </tr>
3743 </thead><tbody>
3744 <tr id='tooltip-l-tooltip'>
3745 <td><code><b>L.tooltip</b>(<nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>, <nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>source?</i>)</code></td>
3746 <td>Instantiates a Tooltip object given an optional <code>options</code> object that describes its appearance and location and an optional <code>source</code> object that is used to tag the tooltip with a reference to the Layer to which it refers.</td>
3747 </tr>
3748</tbody></table>
3749
3750</section>
3751
3752
3753</section><section>
3754<h3 id='tooltip-option'>Options</h3>
3755
3756<section >
3757
3758
3759
3760
3761<table><thead>
3762 <tr>
3763 <th>Option</th>
3764 <th>Type</th>
3765 <th>Default</th>
3766 <th>Description</th>
3767 </tr>
3768 </thead><tbody>
3769 <tr id='tooltip-pane'>
3770 <td><code><b>pane</b></code></td>
3771 <td><code>String</code></td>
3772 <td><code>&#x27;tooltipPane&#x27;</code></td>
3773 <td><code>Map pane</code> where the tooltip will be added.</td>
3774 </tr>
3775 <tr id='tooltip-offset'>
3776 <td><code><b>offset</b></code></td>
3777 <td><code><a href='#point'>Point</a></code></td>
3778 <td><code>Point(0, 0)</code></td>
3779 <td>Optional offset of the tooltip position.</td>
3780 </tr>
3781 <tr id='tooltip-direction'>
3782 <td><code><b>direction</b></code></td>
3783 <td><code>String</code></td>
3784 <td><code>&#x27;auto&#x27;</code></td>
3785 <td>Direction where to open the tooltip. Possible values are: <code>right</code>, <code>left</code>,
3786<code>top</code>, <code>bottom</code>, <code>center</code>, <code>auto</code>.
3787<code>auto</code> will dynamically switch between <code>right</code> and <code>left</code> according to the tooltip
3788position on the map.</td>
3789 </tr>
3790 <tr id='tooltip-permanent'>
3791 <td><code><b>permanent</b></code></td>
3792 <td><code>Boolean</code></td>
3793 <td><code>false</code></td>
3794 <td>Whether to open the tooltip permanently or only on mouseover.</td>
3795 </tr>
3796 <tr id='tooltip-sticky'>
3797 <td><code><b>sticky</b></code></td>
3798 <td><code>Boolean</code></td>
3799 <td><code>false</code></td>
3800 <td>If true, the tooltip will follow the mouse instead of being fixed at the feature center.</td>
3801 </tr>
3802 <tr id='tooltip-interactive'>
3803 <td><code><b>interactive</b></code></td>
3804 <td><code>Boolean</code></td>
3805 <td><code>false</code></td>
3806 <td>If true, the tooltip will listen to the feature events.</td>
3807 </tr>
3808 <tr id='tooltip-opacity'>
3809 <td><code><b>opacity</b></code></td>
3810 <td><code>Number</code></td>
3811 <td><code>0.9</code></td>
3812 <td>Tooltip container opacity.</td>
3813 </tr>
3814</tbody></table>
3815
3816</section>
3817
3818
3819<div class='accordion'>
3820 <label><span class='expander'></span> Options inherited from <a href='#divoverlay'>DivOverlay</a></label>
3821 <div class='accordion-overflow'>
3822 <div class='accordion-content'><section >
3823
3824
3825
3826
3827<table><thead>
3828 <tr>
3829 <th>Option</th>
3830 <th>Type</th>
3831 <th>Default</th>
3832 <th>Description</th>
3833 </tr>
3834 </thead><tbody>
3835 <tr id='tooltip-classname'>
3836 <td><code><b>className</b></code></td>
3837 <td><code>String</code></td>
3838 <td><code>&#x27;&#x27;</code></td>
3839 <td>A custom CSS class name to assign to the popup.</td>
3840 </tr>
3841</tbody></table>
3842
3843</section></div>
3844 </div>
3845</div>
3846
3847<div class='accordion'>
3848 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
3849 <div class='accordion-overflow'>
3850 <div class='accordion-content'><section >
3851
3852
3853
3854
3855<table><thead>
3856 <tr>
3857 <th>Option</th>
3858 <th>Type</th>
3859 <th>Default</th>
3860 <th>Description</th>
3861 </tr>
3862 </thead><tbody>
3863 <tr id='tooltip-attribution'>
3864 <td><code><b>attribution</b></code></td>
3865 <td><code>String</code></td>
3866 <td><code>null</code></td>
3867 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
3868 </tr>
3869</tbody></table>
3870
3871</section></div>
3872 </div>
3873</div>
3874
3875</section><section>
3876<h3 id=''>Events</h3>
3877
3878
3879
3880
3881<div class='accordion'>
3882 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
3883 <div class='accordion-overflow'>
3884 <div class='accordion-content'><section >
3885
3886
3887
3888
3889<table><thead>
3890 <tr>
3891 <th>Event</th>
3892 <th>Data</th>
3893 <th>Description</th>
3894 </tr>
3895 </thead><tbody>
3896 <tr id='tooltip-add'>
3897 <td><code><b>add</b></code></td>
3898 <td><code><a href='#event'>Event</a></code></td>
3899 <td>Fired after the layer is added to a map</td>
3900 </tr>
3901 <tr id='tooltip-remove'>
3902 <td><code><b>remove</b></code></td>
3903 <td><code><a href='#event'>Event</a></code></td>
3904 <td>Fired after the layer is removed from a map</td>
3905 </tr>
3906</tbody></table>
3907
3908</section></div>
3909 </div>
3910</div>
3911
3912<div class='accordion'>
3913 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
3914 <div class='accordion-overflow'>
3915 <div class='accordion-content'><section >
3916
3917
3918
3919
3920<table><thead>
3921 <tr>
3922 <th>Event</th>
3923 <th>Data</th>
3924 <th>Description</th>
3925 </tr>
3926 </thead><tbody>
3927 <tr id='tooltip-popupopen'>
3928 <td><code><b>popupopen</b></code></td>
3929 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
3930 <td>Fired when a popup bound to this layer is opened</td>
3931 </tr>
3932 <tr id='tooltip-popupclose'>
3933 <td><code><b>popupclose</b></code></td>
3934 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
3935 <td>Fired when a popup bound to this layer is closed</td>
3936 </tr>
3937</tbody></table>
3938
3939</section></div>
3940 </div>
3941</div>
3942
3943<div class='accordion'>
3944 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
3945 <div class='accordion-overflow'>
3946 <div class='accordion-content'><section >
3947
3948
3949
3950
3951<table><thead>
3952 <tr>
3953 <th>Event</th>
3954 <th>Data</th>
3955 <th>Description</th>
3956 </tr>
3957 </thead><tbody>
3958 <tr id='tooltip-tooltipopen'>
3959 <td><code><b>tooltipopen</b></code></td>
3960 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
3961 <td>Fired when a tooltip bound to this layer is opened.</td>
3962 </tr>
3963 <tr id='tooltip-tooltipclose'>
3964 <td><code><b>tooltipclose</b></code></td>
3965 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
3966 <td>Fired when a tooltip bound to this layer is closed.</td>
3967 </tr>
3968</tbody></table>
3969
3970</section></div>
3971 </div>
3972</div>
3973
3974</section><section>
3975<h3 id=''>Methods</h3>
3976
3977
3978
3979
3980<div class='accordion'>
3981 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
3982 <div class='accordion-overflow'>
3983 <div class='accordion-content'><section >
3984
3985
3986
3987
3988<table><thead>
3989 <tr>
3990 <th>Method</th>
3991 <th>Returns</th>
3992 <th>Description</th>
3993 </tr>
3994 </thead><tbody>
3995 <tr id='tooltip-addto'>
3996 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
3997 <td><code>this</code></td>
3998 <td><p>Adds the layer to the given map or layer group.</p>
3999</td>
4000 </tr>
4001 <tr id='tooltip-remove'>
4002 <td><code><b>remove</b>()</code></td>
4003 <td><code>this</code></td>
4004 <td><p>Removes the layer from the map it is currently active on.</p>
4005</td>
4006 </tr>
4007 <tr id='tooltip-removefrom'>
4008 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
4009 <td><code>this</code></td>
4010 <td><p>Removes the layer from the given map</p>
4011</td>
4012 </tr>
4013 <tr id='tooltip-removefrom'>
4014 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
4015 <td><code>this</code></td>
4016 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
4017</td>
4018 </tr>
4019 <tr id='tooltip-getpane'>
4020 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
4021 <td><code>HTMLElement</code></td>
4022 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
4023</td>
4024 </tr>
4025 <tr id='tooltip-getattribution'>
4026 <td><code><b>getAttribution</b>()</code></td>
4027 <td><code>String</code></td>
4028 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
4029</td>
4030 </tr>
4031</tbody></table>
4032
4033</section></div>
4034 </div>
4035</div>
4036
4037<div class='accordion'>
4038 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
4039 <div class='accordion-overflow'>
4040 <div class='accordion-content'><section >
4041
4042
4043
4044
4045<table><thead>
4046 <tr>
4047 <th>Method</th>
4048 <th>Returns</th>
4049 <th>Description</th>
4050 </tr>
4051 </thead><tbody>
4052 <tr id='tooltip-bindpopup'>
4053 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
4054 <td><code>this</code></td>
4055 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
4056necessary event listeners. If a <code>Function</code> is passed it will receive
4057the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
4058</td>
4059 </tr>
4060 <tr id='tooltip-unbindpopup'>
4061 <td><code><b>unbindPopup</b>()</code></td>
4062 <td><code>this</code></td>
4063 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
4064</td>
4065 </tr>
4066 <tr id='tooltip-openpopup'>
4067 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
4068 <td><code>this</code></td>
4069 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
4070</td>
4071 </tr>
4072 <tr id='tooltip-closepopup'>
4073 <td><code><b>closePopup</b>()</code></td>
4074 <td><code>this</code></td>
4075 <td><p>Closes the popup bound to this layer if it is open.</p>
4076</td>
4077 </tr>
4078 <tr id='tooltip-togglepopup'>
4079 <td><code><b>togglePopup</b>()</code></td>
4080 <td><code>this</code></td>
4081 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
4082</td>
4083 </tr>
4084 <tr id='tooltip-ispopupopen'>
4085 <td><code><b>isPopupOpen</b>()</code></td>
4086 <td><code>boolean</code></td>
4087 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
4088</td>
4089 </tr>
4090 <tr id='tooltip-setpopupcontent'>
4091 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
4092 <td><code>this</code></td>
4093 <td><p>Sets the content of the popup bound to this layer.</p>
4094</td>
4095 </tr>
4096 <tr id='tooltip-getpopup'>
4097 <td><code><b>getPopup</b>()</code></td>
4098 <td><code><a href='#popup'>Popup</a></code></td>
4099 <td><p>Returns the popup bound to this layer.</p>
4100</td>
4101 </tr>
4102</tbody></table>
4103
4104</section></div>
4105 </div>
4106</div>
4107
4108<div class='accordion'>
4109 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
4110 <div class='accordion-overflow'>
4111 <div class='accordion-content'><section >
4112
4113
4114
4115
4116<table><thead>
4117 <tr>
4118 <th>Method</th>
4119 <th>Returns</th>
4120 <th>Description</th>
4121 </tr>
4122 </thead><tbody>
4123 <tr id='tooltip-bindtooltip'>
4124 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
4125 <td><code>this</code></td>
4126 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
4127necessary event listeners. If a <code>Function</code> is passed it will receive
4128the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
4129</td>
4130 </tr>
4131 <tr id='tooltip-unbindtooltip'>
4132 <td><code><b>unbindTooltip</b>()</code></td>
4133 <td><code>this</code></td>
4134 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
4135</td>
4136 </tr>
4137 <tr id='tooltip-opentooltip'>
4138 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
4139 <td><code>this</code></td>
4140 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
4141</td>
4142 </tr>
4143 <tr id='tooltip-closetooltip'>
4144 <td><code><b>closeTooltip</b>()</code></td>
4145 <td><code>this</code></td>
4146 <td><p>Closes the tooltip bound to this layer if it is open.</p>
4147</td>
4148 </tr>
4149 <tr id='tooltip-toggletooltip'>
4150 <td><code><b>toggleTooltip</b>()</code></td>
4151 <td><code>this</code></td>
4152 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
4153</td>
4154 </tr>
4155 <tr id='tooltip-istooltipopen'>
4156 <td><code><b>isTooltipOpen</b>()</code></td>
4157 <td><code>boolean</code></td>
4158 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
4159</td>
4160 </tr>
4161 <tr id='tooltip-settooltipcontent'>
4162 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
4163 <td><code>this</code></td>
4164 <td><p>Sets the content of the tooltip bound to this layer.</p>
4165</td>
4166 </tr>
4167 <tr id='tooltip-gettooltip'>
4168 <td><code><b>getTooltip</b>()</code></td>
4169 <td><code><a href='#tooltip'>Tooltip</a></code></td>
4170 <td><p>Returns the tooltip bound to this layer.</p>
4171</td>
4172 </tr>
4173</tbody></table>
4174
4175</section></div>
4176 </div>
4177</div>
4178
4179<div class='accordion'>
4180 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
4181 <div class='accordion-overflow'>
4182 <div class='accordion-content'><section >
4183
4184
4185
4186
4187<table><thead>
4188 <tr>
4189 <th>Method</th>
4190 <th>Returns</th>
4191 <th>Description</th>
4192 </tr>
4193 </thead><tbody>
4194 <tr id='tooltip-on'>
4195 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
4196 <td><code>this</code></td>
4197 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
4198</td>
4199 </tr>
4200 <tr id='tooltip-on'>
4201 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
4202 <td><code>this</code></td>
4203 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
4204</td>
4205 </tr>
4206 <tr id='tooltip-off'>
4207 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
4208 <td><code>this</code></td>
4209 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
4210</td>
4211 </tr>
4212 <tr id='tooltip-off'>
4213 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
4214 <td><code>this</code></td>
4215 <td><p>Removes a set of type/listener pairs.</p>
4216</td>
4217 </tr>
4218 <tr id='tooltip-off'>
4219 <td><code><b>off</b>()</code></td>
4220 <td><code>this</code></td>
4221 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
4222</td>
4223 </tr>
4224 <tr id='tooltip-fire'>
4225 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
4226 <td><code>this</code></td>
4227 <td><p>Fires an event of the specified type. You can optionally provide an data
4228object — the first argument of the listener function will contain its
4229properties. The event can optionally be propagated to event parents.</p>
4230</td>
4231 </tr>
4232 <tr id='tooltip-listens'>
4233 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
4234 <td><code>Boolean</code></td>
4235 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
4236</td>
4237 </tr>
4238 <tr id='tooltip-once'>
4239 <td><code><b>once</b>(<i></i>)</code></td>
4240 <td><code>this</code></td>
4241 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
4242</td>
4243 </tr>
4244 <tr id='tooltip-addeventparent'>
4245 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
4246 <td><code>this</code></td>
4247 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
4248</td>
4249 </tr>
4250 <tr id='tooltip-removeeventparent'>
4251 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
4252 <td><code>this</code></td>
4253 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
4254</td>
4255 </tr>
4256 <tr id='tooltip-addeventlistener'>
4257 <td><code><b>addEventListener</b>(<i></i>)</code></td>
4258 <td><code>this</code></td>
4259 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
4260</td>
4261 </tr>
4262 <tr id='tooltip-removeeventlistener'>
4263 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
4264 <td><code>this</code></td>
4265 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
4266</td>
4267 </tr>
4268 <tr id='tooltip-clearalleventlisteners'>
4269 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
4270 <td><code>this</code></td>
4271 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
4272</td>
4273 </tr>
4274 <tr id='tooltip-addonetimeeventlistener'>
4275 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
4276 <td><code>this</code></td>
4277 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
4278</td>
4279 </tr>
4280 <tr id='tooltip-fireevent'>
4281 <td><code><b>fireEvent</b>(<i></i>)</code></td>
4282 <td><code>this</code></td>
4283 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
4284</td>
4285 </tr>
4286 <tr id='tooltip-haseventlisteners'>
4287 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
4288 <td><code>Boolean</code></td>
4289 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
4290</td>
4291 </tr>
4292</tbody></table>
4293
4294</section></div>
4295 </div>
4296</div>
4297
4298</section><h2 id='tilelayer'>TileLayer</h2><p>Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under <a href="#layer"><code>Layer</code></a>. Extends <a href="#gridlayer"><code>GridLayer</code></a>.</p>
4299
4300<section>
4301<h3 id='tilelayer-example'>Usage example</h3>
4302
4303<section >
4304
4305
4306
4307
4308
4309<pre><code class="lang-js">L.tileLayer(&#39;https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}&#39;, {foo: &#39;bar&#39;, attribution: &#39;Map data &amp;copy; &lt;a href=&quot;https://www.openstreetmap.org/&quot;&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/2.0/&quot;&gt;CC-BY-SA&lt;/a&gt;&#39;}).addTo(map);
4310</code></pre>
4311
4312
4313
4314</section><section >
4315
4316<h4 id='tilelayer-url-template'>URL template</h4>
4317
4318
4319
4320<p>A string of the following form:</p>
4321<pre><code>&#39;http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png&#39;
4322</code></pre><p><code>{s}</code> means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; <code>a</code>, <code>b</code> or <code>c</code> by default, can be omitted), <code>{z}</code> — zoom level, <code>{x}</code> and <code>{y}</code> — tile coordinates. <code>{r}</code> can be used to add &quot;&commat;2x&quot; to the URL to load retina tiles.
4323You can use custom keys in the template, which will be <a href="#util-template">evaluated</a> from TileLayer options, like this:</p>
4324<pre><code>L.tileLayer(&#39;http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png&#39;, {foo: &#39;bar&#39;});
4325</code></pre>
4326
4327
4328</section>
4329
4330
4331</section><section>
4332<h3 id='tilelayer-factory'>Creation</h3>
4333
4334<section class='collapsable'>
4335
4336<h4 id='tilelayer-extension-methods'>Extension methods</h4>
4337
4338
4339<table><thead>
4340 <tr>
4341 <th>Factory</th>
4342 <th>Description</th>
4343 </tr>
4344 </thead><tbody>
4345 <tr id='tilelayer-l-tilelayer'>
4346 <td><code><b>L.tilelayer</b>(<nobr>&lt;String&gt;</nobr> <i>urlTemplate</i>, <nobr>&lt;<a href='#tilelayer-option'>TileLayer options</a>&gt;</nobr> <i>options?</i>)</code></td>
4347 <td>Instantiates a tile layer object given a <code>URL template</code> and optionally an options object.</td>
4348 </tr>
4349</tbody></table>
4350
4351</section>
4352
4353
4354</section><section>
4355<h3 id='tilelayer-option'>Options</h3>
4356
4357<section >
4358
4359
4360
4361
4362<table><thead>
4363 <tr>
4364 <th>Option</th>
4365 <th>Type</th>
4366 <th>Default</th>
4367 <th>Description</th>
4368 </tr>
4369 </thead><tbody>
4370 <tr id='tilelayer-minzoom'>
4371 <td><code><b>minZoom</b></code></td>
4372 <td><code>Number</code></td>
4373 <td><code>0</code></td>
4374 <td>The minimum zoom level down to which this layer will be displayed (inclusive).</td>
4375 </tr>
4376 <tr id='tilelayer-maxzoom'>
4377 <td><code><b>maxZoom</b></code></td>
4378 <td><code>Number</code></td>
4379 <td><code>18</code></td>
4380 <td>The maximum zoom level up to which this layer will be displayed (inclusive).</td>
4381 </tr>
4382 <tr id='tilelayer-subdomains'>
4383 <td><code><b>subdomains</b></code></td>
4384 <td><code>String|String[]</code></td>
4385 <td><code>&#x27;abc&#x27;</code></td>
4386 <td>Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.</td>
4387 </tr>
4388 <tr id='tilelayer-errortileurl'>
4389 <td><code><b>errorTileUrl</b></code></td>
4390 <td><code>String</code></td>
4391 <td><code>&#x27;&#x27;</code></td>
4392 <td>URL to the tile image to show in place of the tile that failed to load.</td>
4393 </tr>
4394 <tr id='tilelayer-zoomoffset'>
4395 <td><code><b>zoomOffset</b></code></td>
4396 <td><code>Number</code></td>
4397 <td><code>0</code></td>
4398 <td>The zoom number used in tile URLs will be offset with this value.</td>
4399 </tr>
4400 <tr id='tilelayer-tms'>
4401 <td><code><b>tms</b></code></td>
4402 <td><code>Boolean</code></td>
4403 <td><code>false</code></td>
4404 <td>If <code>true</code>, inverses Y axis numbering for tiles (turn this on for <a href="https://en.wikipedia.org/wiki/Tile_Map_Service">TMS</a> services).</td>
4405 </tr>
4406 <tr id='tilelayer-zoomreverse'>
4407 <td><code><b>zoomReverse</b></code></td>
4408 <td><code>Boolean</code></td>
4409 <td><code>false</code></td>
4410 <td>If set to true, the zoom number used in tile URLs will be reversed (<code>maxZoom - zoom</code> instead of <code>zoom</code>)</td>
4411 </tr>
4412 <tr id='tilelayer-detectretina'>
4413 <td><code><b>detectRetina</b></code></td>
4414 <td><code>Boolean</code></td>
4415 <td><code>false</code></td>
4416 <td>If <code>true</code> and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.</td>
4417 </tr>
4418 <tr id='tilelayer-crossorigin'>
4419 <td><code><b>crossOrigin</b></code></td>
4420 <td><code>Boolean|String</code></td>
4421 <td><code>false</code></td>
4422 <td>Whether the crossOrigin attribute will be added to the tiles.
4423If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
4424Refer to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes">CORS Settings</a> for valid String values.</td>
4425 </tr>
4426</tbody></table>
4427
4428</section>
4429
4430
4431<div class='accordion'>
4432 <label><span class='expander'></span> Options inherited from <a href='#gridlayer'>GridLayer</a></label>
4433 <div class='accordion-overflow'>
4434 <div class='accordion-content'><section >
4435
4436
4437
4438
4439<table><thead>
4440 <tr>
4441 <th>Option</th>
4442 <th>Type</th>
4443 <th>Default</th>
4444 <th>Description</th>
4445 </tr>
4446 </thead><tbody>
4447 <tr id='tilelayer-tilesize'>
4448 <td><code><b>tileSize</b></code></td>
4449 <td><code>Number|Point</code></td>
4450 <td><code>256</code></td>
4451 <td>Width and height of tiles in the grid. Use a number if width and height are equal, or <code>L.point(width, height)</code> otherwise.</td>
4452 </tr>
4453 <tr id='tilelayer-opacity'>
4454 <td><code><b>opacity</b></code></td>
4455 <td><code>Number</code></td>
4456 <td><code>1.0</code></td>
4457 <td>Opacity of the tiles. Can be used in the <code>createTile()</code> function.</td>
4458 </tr>
4459 <tr id='tilelayer-updatewhenidle'>
4460 <td><code><b>updateWhenIdle</b></code></td>
4461 <td><code>Boolean</code></td>
4462 <td><code>(depends)</code></td>
4463 <td>Load new tiles only when panning ends.
4464<code>true</code> by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
4465<code>false</code> otherwise in order to display new tiles <em>during</em> panning, since it is easy to pan outside the
4466<a href="#gridlayer-keepbuffer"><code>keepBuffer</code></a> option in desktop browsers.</td>
4467 </tr>
4468 <tr id='tilelayer-updatewhenzooming'>
4469 <td><code><b>updateWhenZooming</b></code></td>
4470 <td><code>Boolean</code></td>
4471 <td><code>true</code></td>
4472 <td>By default, a smooth zoom animation (during a <a href="#map-touchzoom">touch zoom</a> or a <a href="#map-flyto"><code>flyTo()</code></a>) will update grid layers every integer zoom level. Setting this option to <code>false</code> will update the grid layer only when the smooth animation ends.</td>
4473 </tr>
4474 <tr id='tilelayer-updateinterval'>
4475 <td><code><b>updateInterval</b></code></td>
4476 <td><code>Number</code></td>
4477 <td><code>200</code></td>
4478 <td>Tiles will not update more than once every <code>updateInterval</code> milliseconds when panning.</td>
4479 </tr>
4480 <tr id='tilelayer-zindex'>
4481 <td><code><b>zIndex</b></code></td>
4482 <td><code>Number</code></td>
4483 <td><code>1</code></td>
4484 <td>The explicit zIndex of the tile layer.</td>
4485 </tr>
4486 <tr id='tilelayer-bounds'>
4487 <td><code><b>bounds</b></code></td>
4488 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
4489 <td><code>undefined</code></td>
4490 <td>If set, tiles will only be loaded inside the set <a href="#latlngbounds"><code>LatLngBounds</code></a>.</td>
4491 </tr>
4492 <tr id='tilelayer-maxnativezoom'>
4493 <td><code><b>maxNativeZoom</b></code></td>
4494 <td><code>Number</code></td>
4495 <td><code>undefined</code></td>
4496 <td>Maximum zoom number the tile source has available. If it is specified,
4497the tiles on all zoom levels higher than <code>maxNativeZoom</code> will be loaded
4498from <code>maxNativeZoom</code> level and auto-scaled.</td>
4499 </tr>
4500 <tr id='tilelayer-minnativezoom'>
4501 <td><code><b>minNativeZoom</b></code></td>
4502 <td><code>Number</code></td>
4503 <td><code>undefined</code></td>
4504 <td>Minimum zoom number the tile source has available. If it is specified,
4505the tiles on all zoom levels lower than <code>minNativeZoom</code> will be loaded
4506from <code>minNativeZoom</code> level and auto-scaled.</td>
4507 </tr>
4508 <tr id='tilelayer-nowrap'>
4509 <td><code><b>noWrap</b></code></td>
4510 <td><code>Boolean</code></td>
4511 <td><code>false</code></td>
4512 <td>Whether the layer is wrapped around the antimeridian. If <code>true</code>, the
4513GridLayer will only be displayed once at low zoom levels. Has no
4514effect when the <a href="#map-crs">map CRS</a> doesn&#39;t wrap around. Can be used
4515in combination with <a href="#gridlayer-bounds"><a href="#bounds"><code>bounds</code></a></a> to prevent requesting
4516tiles outside the CRS limits.</td>
4517 </tr>
4518 <tr id='tilelayer-pane'>
4519 <td><code><b>pane</b></code></td>
4520 <td><code>String</code></td>
4521 <td><code>&#x27;tilePane&#x27;</code></td>
4522 <td><code>Map pane</code> where the grid layer will be added.</td>
4523 </tr>
4524 <tr id='tilelayer-classname'>
4525 <td><code><b>className</b></code></td>
4526 <td><code>String</code></td>
4527 <td><code>&#x27;&#x27;</code></td>
4528 <td>A custom class name to assign to the tile layer. Empty by default.</td>
4529 </tr>
4530 <tr id='tilelayer-keepbuffer'>
4531 <td><code><b>keepBuffer</b></code></td>
4532 <td><code>Number</code></td>
4533 <td><code>2</code></td>
4534 <td>When panning the map, keep this many rows and columns of tiles before unloading them.</td>
4535 </tr>
4536</tbody></table>
4537
4538</section></div>
4539 </div>
4540</div>
4541
4542<div class='accordion'>
4543 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
4544 <div class='accordion-overflow'>
4545 <div class='accordion-content'><section >
4546
4547
4548
4549
4550<table><thead>
4551 <tr>
4552 <th>Option</th>
4553 <th>Type</th>
4554 <th>Default</th>
4555 <th>Description</th>
4556 </tr>
4557 </thead><tbody>
4558 <tr id='tilelayer-attribution'>
4559 <td><code><b>attribution</b></code></td>
4560 <td><code>String</code></td>
4561 <td><code>null</code></td>
4562 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
4563 </tr>
4564</tbody></table>
4565
4566</section></div>
4567 </div>
4568</div>
4569
4570</section><section>
4571<h3 id=''>Events</h3>
4572
4573
4574
4575
4576<div class='accordion'>
4577 <label><span class='expander'></span> Events inherited from <a href='#gridlayer'>GridLayer</a></label>
4578 <div class='accordion-overflow'>
4579 <div class='accordion-content'><section >
4580
4581
4582
4583
4584<table><thead>
4585 <tr>
4586 <th>Event</th>
4587 <th>Data</th>
4588 <th>Description</th>
4589 </tr>
4590 </thead><tbody>
4591 <tr id='tilelayer-loading'>
4592 <td><code><b>loading</b></code></td>
4593 <td><code><a href='#event'>Event</a></code></td>
4594 <td>Fired when the grid layer starts loading tiles.</td>
4595 </tr>
4596 <tr id='tilelayer-tileunload'>
4597 <td><code><b>tileunload</b></code></td>
4598 <td><code><a href='#tileevent'>TileEvent</a></code></td>
4599 <td>Fired when a tile is removed (e.g. when a tile goes off the screen).</td>
4600 </tr>
4601 <tr id='tilelayer-tileloadstart'>
4602 <td><code><b>tileloadstart</b></code></td>
4603 <td><code><a href='#tileevent'>TileEvent</a></code></td>
4604 <td>Fired when a tile is requested and starts loading.</td>
4605 </tr>
4606 <tr id='tilelayer-tileerror'>
4607 <td><code><b>tileerror</b></code></td>
4608 <td><code><a href='#tileerrorevent'>TileErrorEvent</a></code></td>
4609 <td>Fired when there is an error loading a tile.</td>
4610 </tr>
4611 <tr id='tilelayer-tileload'>
4612 <td><code><b>tileload</b></code></td>
4613 <td><code><a href='#tileevent'>TileEvent</a></code></td>
4614 <td>Fired when a tile loads.</td>
4615 </tr>
4616 <tr id='tilelayer-load'>
4617 <td><code><b>load</b></code></td>
4618 <td><code><a href='#event'>Event</a></code></td>
4619 <td>Fired when the grid layer loaded all visible tiles.</td>
4620 </tr>
4621</tbody></table>
4622
4623</section></div>
4624 </div>
4625</div>
4626
4627<div class='accordion'>
4628 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
4629 <div class='accordion-overflow'>
4630 <div class='accordion-content'><section >
4631
4632
4633
4634
4635<table><thead>
4636 <tr>
4637 <th>Event</th>
4638 <th>Data</th>
4639 <th>Description</th>
4640 </tr>
4641 </thead><tbody>
4642 <tr id='tilelayer-add'>
4643 <td><code><b>add</b></code></td>
4644 <td><code><a href='#event'>Event</a></code></td>
4645 <td>Fired after the layer is added to a map</td>
4646 </tr>
4647 <tr id='tilelayer-remove'>
4648 <td><code><b>remove</b></code></td>
4649 <td><code><a href='#event'>Event</a></code></td>
4650 <td>Fired after the layer is removed from a map</td>
4651 </tr>
4652</tbody></table>
4653
4654</section></div>
4655 </div>
4656</div>
4657
4658<div class='accordion'>
4659 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
4660 <div class='accordion-overflow'>
4661 <div class='accordion-content'><section >
4662
4663
4664
4665
4666<table><thead>
4667 <tr>
4668 <th>Event</th>
4669 <th>Data</th>
4670 <th>Description</th>
4671 </tr>
4672 </thead><tbody>
4673 <tr id='tilelayer-popupopen'>
4674 <td><code><b>popupopen</b></code></td>
4675 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
4676 <td>Fired when a popup bound to this layer is opened</td>
4677 </tr>
4678 <tr id='tilelayer-popupclose'>
4679 <td><code><b>popupclose</b></code></td>
4680 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
4681 <td>Fired when a popup bound to this layer is closed</td>
4682 </tr>
4683</tbody></table>
4684
4685</section></div>
4686 </div>
4687</div>
4688
4689<div class='accordion'>
4690 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
4691 <div class='accordion-overflow'>
4692 <div class='accordion-content'><section >
4693
4694
4695
4696
4697<table><thead>
4698 <tr>
4699 <th>Event</th>
4700 <th>Data</th>
4701 <th>Description</th>
4702 </tr>
4703 </thead><tbody>
4704 <tr id='tilelayer-tooltipopen'>
4705 <td><code><b>tooltipopen</b></code></td>
4706 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
4707 <td>Fired when a tooltip bound to this layer is opened.</td>
4708 </tr>
4709 <tr id='tilelayer-tooltipclose'>
4710 <td><code><b>tooltipclose</b></code></td>
4711 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
4712 <td>Fired when a tooltip bound to this layer is closed.</td>
4713 </tr>
4714</tbody></table>
4715
4716</section></div>
4717 </div>
4718</div>
4719
4720</section><section>
4721<h3 id='tilelayer-method'>Methods</h3>
4722
4723<section >
4724
4725
4726
4727
4728<table><thead>
4729 <tr>
4730 <th>Method</th>
4731 <th>Returns</th>
4732 <th>Description</th>
4733 </tr>
4734 </thead><tbody>
4735 <tr id='tilelayer-seturl'>
4736 <td><code><b>setUrl</b>(<nobr>&lt;String&gt;</nobr> <i>url</i>, <nobr>&lt;Boolean&gt;</nobr> <i>noRedraw?</i>)</code></td>
4737 <td><code>this</code></td>
4738 <td><p>Updates the layer&#39;s URL template and redraws it (unless <code>noRedraw</code> is set to <code>true</code>).
4739If the URL does not change, the layer will not be redrawn unless
4740the noRedraw parameter is set to false.</p>
4741</td>
4742 </tr>
4743 <tr id='tilelayer-createtile'>
4744 <td><code><b>createTile</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>, <nobr>&lt;Function&gt;</nobr> <i>done?</i>)</code></td>
4745 <td><code>HTMLElement</code></td>
4746 <td><p>Called only internally, overrides GridLayer&#39;s <a href="#gridlayer-createtile"><code>createTile()</code></a>
4747to return an <code>&lt;img&gt;</code> HTML element with the appropriate image URL given <code>coords</code>. The <code>done</code>
4748callback is called when the tile has been loaded.</p>
4749</td>
4750 </tr>
4751</tbody></table>
4752
4753</section><section class='collapsable'>
4754
4755<h4 id='tilelayer-extension-methods'>Extension methods</h4>
4756
4757<div class='section-comments'>Layers extending <a href="#tilelayer"><code>TileLayer</code></a> might reimplement the following method.</div>
4758
4759<table><thead>
4760 <tr>
4761 <th>Method</th>
4762 <th>Returns</th>
4763 <th>Description</th>
4764 </tr>
4765 </thead><tbody>
4766 <tr id='tilelayer-gettileurl'>
4767 <td><code><b>getTileUrl</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>)</code></td>
4768 <td><code>String</code></td>
4769 <td><p>Called only internally, returns the URL for a tile given its coordinates.
4770Classes extending <a href="#tilelayer"><code>TileLayer</code></a> can override this function to provide custom tile URL naming schemes.</p>
4771</td>
4772 </tr>
4773</tbody></table>
4774
4775</section>
4776
4777
4778<div class='accordion'>
4779 <label><span class='expander'></span> Methods inherited from <a href='#gridlayer'>GridLayer</a></label>
4780 <div class='accordion-overflow'>
4781 <div class='accordion-content'><section >
4782
4783
4784
4785
4786<table><thead>
4787 <tr>
4788 <th>Method</th>
4789 <th>Returns</th>
4790 <th>Description</th>
4791 </tr>
4792 </thead><tbody>
4793 <tr id='tilelayer-bringtofront'>
4794 <td><code><b>bringToFront</b>()</code></td>
4795 <td><code>this</code></td>
4796 <td><p>Brings the tile layer to the top of all tile layers.</p>
4797</td>
4798 </tr>
4799 <tr id='tilelayer-bringtoback'>
4800 <td><code><b>bringToBack</b>()</code></td>
4801 <td><code>this</code></td>
4802 <td><p>Brings the tile layer to the bottom of all tile layers.</p>
4803</td>
4804 </tr>
4805 <tr id='tilelayer-getcontainer'>
4806 <td><code><b>getContainer</b>()</code></td>
4807 <td><code>HTMLElement</code></td>
4808 <td><p>Returns the HTML element that contains the tiles for this layer.</p>
4809</td>
4810 </tr>
4811 <tr id='tilelayer-setopacity'>
4812 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
4813 <td><code>this</code></td>
4814 <td><p>Changes the <a href="#gridlayer-opacity">opacity</a> of the grid layer.</p>
4815</td>
4816 </tr>
4817 <tr id='tilelayer-setzindex'>
4818 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
4819 <td><code>this</code></td>
4820 <td><p>Changes the <a href="#gridlayer-zindex">zIndex</a> of the grid layer.</p>
4821</td>
4822 </tr>
4823 <tr id='tilelayer-isloading'>
4824 <td><code><b>isLoading</b>()</code></td>
4825 <td><code>Boolean</code></td>
4826 <td><p>Returns <code>true</code> if any tile in the grid layer has not finished loading.</p>
4827</td>
4828 </tr>
4829 <tr id='tilelayer-redraw'>
4830 <td><code><b>redraw</b>()</code></td>
4831 <td><code>this</code></td>
4832 <td><p>Causes the layer to clear all the tiles and request them again.</p>
4833</td>
4834 </tr>
4835 <tr id='tilelayer-gettilesize'>
4836 <td><code><b>getTileSize</b>()</code></td>
4837 <td><code><a href='#point'>Point</a></code></td>
4838 <td><p>Normalizes the <a href="#gridlayer-tilesize">tileSize option</a> into a point. Used by the <code>createTile()</code> method.</p>
4839</td>
4840 </tr>
4841</tbody></table>
4842
4843</section></div>
4844 </div>
4845</div>
4846
4847<div class='accordion'>
4848 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
4849 <div class='accordion-overflow'>
4850 <div class='accordion-content'><section >
4851
4852
4853
4854
4855<table><thead>
4856 <tr>
4857 <th>Method</th>
4858 <th>Returns</th>
4859 <th>Description</th>
4860 </tr>
4861 </thead><tbody>
4862 <tr id='tilelayer-addto'>
4863 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
4864 <td><code>this</code></td>
4865 <td><p>Adds the layer to the given map or layer group.</p>
4866</td>
4867 </tr>
4868 <tr id='tilelayer-remove'>
4869 <td><code><b>remove</b>()</code></td>
4870 <td><code>this</code></td>
4871 <td><p>Removes the layer from the map it is currently active on.</p>
4872</td>
4873 </tr>
4874 <tr id='tilelayer-removefrom'>
4875 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
4876 <td><code>this</code></td>
4877 <td><p>Removes the layer from the given map</p>
4878</td>
4879 </tr>
4880 <tr id='tilelayer-removefrom'>
4881 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
4882 <td><code>this</code></td>
4883 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
4884</td>
4885 </tr>
4886 <tr id='tilelayer-getpane'>
4887 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
4888 <td><code>HTMLElement</code></td>
4889 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
4890</td>
4891 </tr>
4892 <tr id='tilelayer-getattribution'>
4893 <td><code><b>getAttribution</b>()</code></td>
4894 <td><code>String</code></td>
4895 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
4896</td>
4897 </tr>
4898</tbody></table>
4899
4900</section></div>
4901 </div>
4902</div>
4903
4904<div class='accordion'>
4905 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
4906 <div class='accordion-overflow'>
4907 <div class='accordion-content'><section >
4908
4909
4910
4911
4912<table><thead>
4913 <tr>
4914 <th>Method</th>
4915 <th>Returns</th>
4916 <th>Description</th>
4917 </tr>
4918 </thead><tbody>
4919 <tr id='tilelayer-bindpopup'>
4920 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
4921 <td><code>this</code></td>
4922 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
4923necessary event listeners. If a <code>Function</code> is passed it will receive
4924the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
4925</td>
4926 </tr>
4927 <tr id='tilelayer-unbindpopup'>
4928 <td><code><b>unbindPopup</b>()</code></td>
4929 <td><code>this</code></td>
4930 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
4931</td>
4932 </tr>
4933 <tr id='tilelayer-openpopup'>
4934 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
4935 <td><code>this</code></td>
4936 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
4937</td>
4938 </tr>
4939 <tr id='tilelayer-closepopup'>
4940 <td><code><b>closePopup</b>()</code></td>
4941 <td><code>this</code></td>
4942 <td><p>Closes the popup bound to this layer if it is open.</p>
4943</td>
4944 </tr>
4945 <tr id='tilelayer-togglepopup'>
4946 <td><code><b>togglePopup</b>()</code></td>
4947 <td><code>this</code></td>
4948 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
4949</td>
4950 </tr>
4951 <tr id='tilelayer-ispopupopen'>
4952 <td><code><b>isPopupOpen</b>()</code></td>
4953 <td><code>boolean</code></td>
4954 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
4955</td>
4956 </tr>
4957 <tr id='tilelayer-setpopupcontent'>
4958 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
4959 <td><code>this</code></td>
4960 <td><p>Sets the content of the popup bound to this layer.</p>
4961</td>
4962 </tr>
4963 <tr id='tilelayer-getpopup'>
4964 <td><code><b>getPopup</b>()</code></td>
4965 <td><code><a href='#popup'>Popup</a></code></td>
4966 <td><p>Returns the popup bound to this layer.</p>
4967</td>
4968 </tr>
4969</tbody></table>
4970
4971</section></div>
4972 </div>
4973</div>
4974
4975<div class='accordion'>
4976 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
4977 <div class='accordion-overflow'>
4978 <div class='accordion-content'><section >
4979
4980
4981
4982
4983<table><thead>
4984 <tr>
4985 <th>Method</th>
4986 <th>Returns</th>
4987 <th>Description</th>
4988 </tr>
4989 </thead><tbody>
4990 <tr id='tilelayer-bindtooltip'>
4991 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
4992 <td><code>this</code></td>
4993 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
4994necessary event listeners. If a <code>Function</code> is passed it will receive
4995the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
4996</td>
4997 </tr>
4998 <tr id='tilelayer-unbindtooltip'>
4999 <td><code><b>unbindTooltip</b>()</code></td>
5000 <td><code>this</code></td>
5001 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
5002</td>
5003 </tr>
5004 <tr id='tilelayer-opentooltip'>
5005 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
5006 <td><code>this</code></td>
5007 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
5008</td>
5009 </tr>
5010 <tr id='tilelayer-closetooltip'>
5011 <td><code><b>closeTooltip</b>()</code></td>
5012 <td><code>this</code></td>
5013 <td><p>Closes the tooltip bound to this layer if it is open.</p>
5014</td>
5015 </tr>
5016 <tr id='tilelayer-toggletooltip'>
5017 <td><code><b>toggleTooltip</b>()</code></td>
5018 <td><code>this</code></td>
5019 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
5020</td>
5021 </tr>
5022 <tr id='tilelayer-istooltipopen'>
5023 <td><code><b>isTooltipOpen</b>()</code></td>
5024 <td><code>boolean</code></td>
5025 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
5026</td>
5027 </tr>
5028 <tr id='tilelayer-settooltipcontent'>
5029 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
5030 <td><code>this</code></td>
5031 <td><p>Sets the content of the tooltip bound to this layer.</p>
5032</td>
5033 </tr>
5034 <tr id='tilelayer-gettooltip'>
5035 <td><code><b>getTooltip</b>()</code></td>
5036 <td><code><a href='#tooltip'>Tooltip</a></code></td>
5037 <td><p>Returns the tooltip bound to this layer.</p>
5038</td>
5039 </tr>
5040</tbody></table>
5041
5042</section></div>
5043 </div>
5044</div>
5045
5046<div class='accordion'>
5047 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
5048 <div class='accordion-overflow'>
5049 <div class='accordion-content'><section >
5050
5051
5052
5053
5054<table><thead>
5055 <tr>
5056 <th>Method</th>
5057 <th>Returns</th>
5058 <th>Description</th>
5059 </tr>
5060 </thead><tbody>
5061 <tr id='tilelayer-on'>
5062 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
5063 <td><code>this</code></td>
5064 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
5065</td>
5066 </tr>
5067 <tr id='tilelayer-on'>
5068 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
5069 <td><code>this</code></td>
5070 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
5071</td>
5072 </tr>
5073 <tr id='tilelayer-off'>
5074 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
5075 <td><code>this</code></td>
5076 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
5077</td>
5078 </tr>
5079 <tr id='tilelayer-off'>
5080 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
5081 <td><code>this</code></td>
5082 <td><p>Removes a set of type/listener pairs.</p>
5083</td>
5084 </tr>
5085 <tr id='tilelayer-off'>
5086 <td><code><b>off</b>()</code></td>
5087 <td><code>this</code></td>
5088 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
5089</td>
5090 </tr>
5091 <tr id='tilelayer-fire'>
5092 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
5093 <td><code>this</code></td>
5094 <td><p>Fires an event of the specified type. You can optionally provide an data
5095object — the first argument of the listener function will contain its
5096properties. The event can optionally be propagated to event parents.</p>
5097</td>
5098 </tr>
5099 <tr id='tilelayer-listens'>
5100 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
5101 <td><code>Boolean</code></td>
5102 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
5103</td>
5104 </tr>
5105 <tr id='tilelayer-once'>
5106 <td><code><b>once</b>(<i></i>)</code></td>
5107 <td><code>this</code></td>
5108 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
5109</td>
5110 </tr>
5111 <tr id='tilelayer-addeventparent'>
5112 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
5113 <td><code>this</code></td>
5114 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
5115</td>
5116 </tr>
5117 <tr id='tilelayer-removeeventparent'>
5118 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
5119 <td><code>this</code></td>
5120 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
5121</td>
5122 </tr>
5123 <tr id='tilelayer-addeventlistener'>
5124 <td><code><b>addEventListener</b>(<i></i>)</code></td>
5125 <td><code>this</code></td>
5126 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
5127</td>
5128 </tr>
5129 <tr id='tilelayer-removeeventlistener'>
5130 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
5131 <td><code>this</code></td>
5132 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
5133</td>
5134 </tr>
5135 <tr id='tilelayer-clearalleventlisteners'>
5136 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
5137 <td><code>this</code></td>
5138 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
5139</td>
5140 </tr>
5141 <tr id='tilelayer-addonetimeeventlistener'>
5142 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
5143 <td><code>this</code></td>
5144 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
5145</td>
5146 </tr>
5147 <tr id='tilelayer-fireevent'>
5148 <td><code><b>fireEvent</b>(<i></i>)</code></td>
5149 <td><code>this</code></td>
5150 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
5151</td>
5152 </tr>
5153 <tr id='tilelayer-haseventlisteners'>
5154 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
5155 <td><code>Boolean</code></td>
5156 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
5157</td>
5158 </tr>
5159</tbody></table>
5160
5161</section></div>
5162 </div>
5163</div>
5164
5165</section><h2 id='tilelayer-wms'>TileLayer.WMS</h2><p>Used to display <a href="https://en.wikipedia.org/wiki/Web_Map_Service">WMS</a> services as tile layers on the map. Extends <a href="#tilelayer"><code>TileLayer</code></a>.</p>
5166
5167<section>
5168<h3 id='tilelayer-wms-example'>Usage example</h3>
5169
5170<section >
5171
5172
5173
5174
5175
5176<pre><code class="lang-js">var nexrad = L.tileLayer.wms(&quot;http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi&quot;, {
5177 layers: &#39;nexrad-n0r-900913&#39;,
5178 format: &#39;image/png&#39;,
5179 transparent: true,
5180 attribution: &quot;Weather data © 2012 IEM Nexrad&quot;
5181});
5182</code></pre>
5183
5184
5185
5186</section>
5187
5188
5189</section><section>
5190<h3 id='tilelayer-wms-factory'>Creation</h3>
5191
5192<section >
5193
5194
5195
5196
5197<table><thead>
5198 <tr>
5199 <th>Factory</th>
5200 <th>Description</th>
5201 </tr>
5202 </thead><tbody>
5203 <tr id='tilelayer-wms-l-tilelayer-wms'>
5204 <td><code><b>L.tileLayer.wms</b>(<nobr>&lt;String&gt;</nobr> <i>baseUrl</i>, <nobr>&lt;<a href='#tilelayer-wms-option'>TileLayer.WMS options</a>&gt;</nobr> <i>options</i>)</code></td>
5205 <td>Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.</td>
5206 </tr>
5207</tbody></table>
5208
5209</section>
5210
5211
5212</section><section>
5213<h3 id='tilelayer-wms-option'>Options</h3>
5214
5215<section >
5216
5217
5218
5219<div class='section-comments'>If any custom options not documented here are used, they will be sent to the
5220WMS server as extra parameters in each request URL. This can be useful for
5221<a href="http://docs.geoserver.org/stable/en/user/services/wms/vendor.html">non-standard vendor WMS parameters</a>.</div>
5222
5223<table><thead>
5224 <tr>
5225 <th>Option</th>
5226 <th>Type</th>
5227 <th>Default</th>
5228 <th>Description</th>
5229 </tr>
5230 </thead><tbody>
5231 <tr id='tilelayer-wms-layers'>
5232 <td><code><b>layers</b></code></td>
5233 <td><code>String</code></td>
5234 <td><code>&#x27;&#x27;</code></td>
5235 <td><strong>(required)</strong> Comma-separated list of WMS layers to show.</td>
5236 </tr>
5237 <tr id='tilelayer-wms-styles'>
5238 <td><code><b>styles</b></code></td>
5239 <td><code>String</code></td>
5240 <td><code>&#x27;&#x27;</code></td>
5241 <td>Comma-separated list of WMS styles.</td>
5242 </tr>
5243 <tr id='tilelayer-wms-format'>
5244 <td><code><b>format</b></code></td>
5245 <td><code>String</code></td>
5246 <td><code>&#x27;image/jpeg&#x27;</code></td>
5247 <td>WMS image format (use <code>&#39;image/png&#39;</code> for layers with transparency).</td>
5248 </tr>
5249 <tr id='tilelayer-wms-transparent'>
5250 <td><code><b>transparent</b></code></td>
5251 <td><code>Boolean</code></td>
5252 <td><code>false</code></td>
5253 <td>If <code>true</code>, the WMS service will return images with transparency.</td>
5254 </tr>
5255 <tr id='tilelayer-wms-version'>
5256 <td><code><b>version</b></code></td>
5257 <td><code>String</code></td>
5258 <td><code>&#x27;1.1.1&#x27;</code></td>
5259 <td>Version of the WMS service to use</td>
5260 </tr>
5261 <tr id='tilelayer-wms-crs'>
5262 <td><code><b>crs</b></code></td>
5263 <td><code><a href='#crs'>CRS</a></code></td>
5264 <td><code>null</code></td>
5265 <td>Coordinate Reference System to use for the WMS requests, defaults to
5266map CRS. Don&#39;t change this if you&#39;re not sure what it means.</td>
5267 </tr>
5268 <tr id='tilelayer-wms-uppercase'>
5269 <td><code><b>uppercase</b></code></td>
5270 <td><code>Boolean</code></td>
5271 <td><code>false</code></td>
5272 <td>If <code>true</code>, WMS request parameter keys will be uppercase.</td>
5273 </tr>
5274</tbody></table>
5275
5276</section>
5277
5278
5279<div class='accordion'>
5280 <label><span class='expander'></span> Options inherited from <a href='#tilelayer'>TileLayer</a></label>
5281 <div class='accordion-overflow'>
5282 <div class='accordion-content'><section >
5283
5284
5285
5286
5287<table><thead>
5288 <tr>
5289 <th>Option</th>
5290 <th>Type</th>
5291 <th>Default</th>
5292 <th>Description</th>
5293 </tr>
5294 </thead><tbody>
5295 <tr id='tilelayer-wms-minzoom'>
5296 <td><code><b>minZoom</b></code></td>
5297 <td><code>Number</code></td>
5298 <td><code>0</code></td>
5299 <td>The minimum zoom level down to which this layer will be displayed (inclusive).</td>
5300 </tr>
5301 <tr id='tilelayer-wms-maxzoom'>
5302 <td><code><b>maxZoom</b></code></td>
5303 <td><code>Number</code></td>
5304 <td><code>18</code></td>
5305 <td>The maximum zoom level up to which this layer will be displayed (inclusive).</td>
5306 </tr>
5307 <tr id='tilelayer-wms-subdomains'>
5308 <td><code><b>subdomains</b></code></td>
5309 <td><code>String|String[]</code></td>
5310 <td><code>&#x27;abc&#x27;</code></td>
5311 <td>Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.</td>
5312 </tr>
5313 <tr id='tilelayer-wms-errortileurl'>
5314 <td><code><b>errorTileUrl</b></code></td>
5315 <td><code>String</code></td>
5316 <td><code>&#x27;&#x27;</code></td>
5317 <td>URL to the tile image to show in place of the tile that failed to load.</td>
5318 </tr>
5319 <tr id='tilelayer-wms-zoomoffset'>
5320 <td><code><b>zoomOffset</b></code></td>
5321 <td><code>Number</code></td>
5322 <td><code>0</code></td>
5323 <td>The zoom number used in tile URLs will be offset with this value.</td>
5324 </tr>
5325 <tr id='tilelayer-wms-tms'>
5326 <td><code><b>tms</b></code></td>
5327 <td><code>Boolean</code></td>
5328 <td><code>false</code></td>
5329 <td>If <code>true</code>, inverses Y axis numbering for tiles (turn this on for <a href="https://en.wikipedia.org/wiki/Tile_Map_Service">TMS</a> services).</td>
5330 </tr>
5331 <tr id='tilelayer-wms-zoomreverse'>
5332 <td><code><b>zoomReverse</b></code></td>
5333 <td><code>Boolean</code></td>
5334 <td><code>false</code></td>
5335 <td>If set to true, the zoom number used in tile URLs will be reversed (<code>maxZoom - zoom</code> instead of <code>zoom</code>)</td>
5336 </tr>
5337 <tr id='tilelayer-wms-detectretina'>
5338 <td><code><b>detectRetina</b></code></td>
5339 <td><code>Boolean</code></td>
5340 <td><code>false</code></td>
5341 <td>If <code>true</code> and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.</td>
5342 </tr>
5343 <tr id='tilelayer-wms-crossorigin'>
5344 <td><code><b>crossOrigin</b></code></td>
5345 <td><code>Boolean|String</code></td>
5346 <td><code>false</code></td>
5347 <td>Whether the crossOrigin attribute will be added to the tiles.
5348If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
5349Refer to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes">CORS Settings</a> for valid String values.</td>
5350 </tr>
5351</tbody></table>
5352
5353</section></div>
5354 </div>
5355</div>
5356
5357<div class='accordion'>
5358 <label><span class='expander'></span> Options inherited from <a href='#gridlayer'>GridLayer</a></label>
5359 <div class='accordion-overflow'>
5360 <div class='accordion-content'><section >
5361
5362
5363
5364
5365<table><thead>
5366 <tr>
5367 <th>Option</th>
5368 <th>Type</th>
5369 <th>Default</th>
5370 <th>Description</th>
5371 </tr>
5372 </thead><tbody>
5373 <tr id='tilelayer-wms-tilesize'>
5374 <td><code><b>tileSize</b></code></td>
5375 <td><code>Number|Point</code></td>
5376 <td><code>256</code></td>
5377 <td>Width and height of tiles in the grid. Use a number if width and height are equal, or <code>L.point(width, height)</code> otherwise.</td>
5378 </tr>
5379 <tr id='tilelayer-wms-opacity'>
5380 <td><code><b>opacity</b></code></td>
5381 <td><code>Number</code></td>
5382 <td><code>1.0</code></td>
5383 <td>Opacity of the tiles. Can be used in the <code>createTile()</code> function.</td>
5384 </tr>
5385 <tr id='tilelayer-wms-updatewhenidle'>
5386 <td><code><b>updateWhenIdle</b></code></td>
5387 <td><code>Boolean</code></td>
5388 <td><code>(depends)</code></td>
5389 <td>Load new tiles only when panning ends.
5390<code>true</code> by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
5391<code>false</code> otherwise in order to display new tiles <em>during</em> panning, since it is easy to pan outside the
5392<a href="#gridlayer-keepbuffer"><code>keepBuffer</code></a> option in desktop browsers.</td>
5393 </tr>
5394 <tr id='tilelayer-wms-updatewhenzooming'>
5395 <td><code><b>updateWhenZooming</b></code></td>
5396 <td><code>Boolean</code></td>
5397 <td><code>true</code></td>
5398 <td>By default, a smooth zoom animation (during a <a href="#map-touchzoom">touch zoom</a> or a <a href="#map-flyto"><code>flyTo()</code></a>) will update grid layers every integer zoom level. Setting this option to <code>false</code> will update the grid layer only when the smooth animation ends.</td>
5399 </tr>
5400 <tr id='tilelayer-wms-updateinterval'>
5401 <td><code><b>updateInterval</b></code></td>
5402 <td><code>Number</code></td>
5403 <td><code>200</code></td>
5404 <td>Tiles will not update more than once every <code>updateInterval</code> milliseconds when panning.</td>
5405 </tr>
5406 <tr id='tilelayer-wms-zindex'>
5407 <td><code><b>zIndex</b></code></td>
5408 <td><code>Number</code></td>
5409 <td><code>1</code></td>
5410 <td>The explicit zIndex of the tile layer.</td>
5411 </tr>
5412 <tr id='tilelayer-wms-bounds'>
5413 <td><code><b>bounds</b></code></td>
5414 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
5415 <td><code>undefined</code></td>
5416 <td>If set, tiles will only be loaded inside the set <a href="#latlngbounds"><code>LatLngBounds</code></a>.</td>
5417 </tr>
5418 <tr id='tilelayer-wms-maxnativezoom'>
5419 <td><code><b>maxNativeZoom</b></code></td>
5420 <td><code>Number</code></td>
5421 <td><code>undefined</code></td>
5422 <td>Maximum zoom number the tile source has available. If it is specified,
5423the tiles on all zoom levels higher than <code>maxNativeZoom</code> will be loaded
5424from <code>maxNativeZoom</code> level and auto-scaled.</td>
5425 </tr>
5426 <tr id='tilelayer-wms-minnativezoom'>
5427 <td><code><b>minNativeZoom</b></code></td>
5428 <td><code>Number</code></td>
5429 <td><code>undefined</code></td>
5430 <td>Minimum zoom number the tile source has available. If it is specified,
5431the tiles on all zoom levels lower than <code>minNativeZoom</code> will be loaded
5432from <code>minNativeZoom</code> level and auto-scaled.</td>
5433 </tr>
5434 <tr id='tilelayer-wms-nowrap'>
5435 <td><code><b>noWrap</b></code></td>
5436 <td><code>Boolean</code></td>
5437 <td><code>false</code></td>
5438 <td>Whether the layer is wrapped around the antimeridian. If <code>true</code>, the
5439GridLayer will only be displayed once at low zoom levels. Has no
5440effect when the <a href="#map-crs">map CRS</a> doesn&#39;t wrap around. Can be used
5441in combination with <a href="#gridlayer-bounds"><a href="#bounds"><code>bounds</code></a></a> to prevent requesting
5442tiles outside the CRS limits.</td>
5443 </tr>
5444 <tr id='tilelayer-wms-pane'>
5445 <td><code><b>pane</b></code></td>
5446 <td><code>String</code></td>
5447 <td><code>&#x27;tilePane&#x27;</code></td>
5448 <td><code>Map pane</code> where the grid layer will be added.</td>
5449 </tr>
5450 <tr id='tilelayer-wms-classname'>
5451 <td><code><b>className</b></code></td>
5452 <td><code>String</code></td>
5453 <td><code>&#x27;&#x27;</code></td>
5454 <td>A custom class name to assign to the tile layer. Empty by default.</td>
5455 </tr>
5456 <tr id='tilelayer-wms-keepbuffer'>
5457 <td><code><b>keepBuffer</b></code></td>
5458 <td><code>Number</code></td>
5459 <td><code>2</code></td>
5460 <td>When panning the map, keep this many rows and columns of tiles before unloading them.</td>
5461 </tr>
5462</tbody></table>
5463
5464</section></div>
5465 </div>
5466</div>
5467
5468<div class='accordion'>
5469 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
5470 <div class='accordion-overflow'>
5471 <div class='accordion-content'><section >
5472
5473
5474
5475
5476<table><thead>
5477 <tr>
5478 <th>Option</th>
5479 <th>Type</th>
5480 <th>Default</th>
5481 <th>Description</th>
5482 </tr>
5483 </thead><tbody>
5484 <tr id='tilelayer-wms-attribution'>
5485 <td><code><b>attribution</b></code></td>
5486 <td><code>String</code></td>
5487 <td><code>null</code></td>
5488 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
5489 </tr>
5490</tbody></table>
5491
5492</section></div>
5493 </div>
5494</div>
5495
5496</section><section>
5497<h3 id=''>Events</h3>
5498
5499
5500
5501
5502<div class='accordion'>
5503 <label><span class='expander'></span> Events inherited from <a href='#gridlayer'>GridLayer</a></label>
5504 <div class='accordion-overflow'>
5505 <div class='accordion-content'><section >
5506
5507
5508
5509
5510<table><thead>
5511 <tr>
5512 <th>Event</th>
5513 <th>Data</th>
5514 <th>Description</th>
5515 </tr>
5516 </thead><tbody>
5517 <tr id='tilelayer-wms-loading'>
5518 <td><code><b>loading</b></code></td>
5519 <td><code><a href='#event'>Event</a></code></td>
5520 <td>Fired when the grid layer starts loading tiles.</td>
5521 </tr>
5522 <tr id='tilelayer-wms-tileunload'>
5523 <td><code><b>tileunload</b></code></td>
5524 <td><code><a href='#tileevent'>TileEvent</a></code></td>
5525 <td>Fired when a tile is removed (e.g. when a tile goes off the screen).</td>
5526 </tr>
5527 <tr id='tilelayer-wms-tileloadstart'>
5528 <td><code><b>tileloadstart</b></code></td>
5529 <td><code><a href='#tileevent'>TileEvent</a></code></td>
5530 <td>Fired when a tile is requested and starts loading.</td>
5531 </tr>
5532 <tr id='tilelayer-wms-tileerror'>
5533 <td><code><b>tileerror</b></code></td>
5534 <td><code><a href='#tileerrorevent'>TileErrorEvent</a></code></td>
5535 <td>Fired when there is an error loading a tile.</td>
5536 </tr>
5537 <tr id='tilelayer-wms-tileload'>
5538 <td><code><b>tileload</b></code></td>
5539 <td><code><a href='#tileevent'>TileEvent</a></code></td>
5540 <td>Fired when a tile loads.</td>
5541 </tr>
5542 <tr id='tilelayer-wms-load'>
5543 <td><code><b>load</b></code></td>
5544 <td><code><a href='#event'>Event</a></code></td>
5545 <td>Fired when the grid layer loaded all visible tiles.</td>
5546 </tr>
5547</tbody></table>
5548
5549</section></div>
5550 </div>
5551</div>
5552
5553<div class='accordion'>
5554 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
5555 <div class='accordion-overflow'>
5556 <div class='accordion-content'><section >
5557
5558
5559
5560
5561<table><thead>
5562 <tr>
5563 <th>Event</th>
5564 <th>Data</th>
5565 <th>Description</th>
5566 </tr>
5567 </thead><tbody>
5568 <tr id='tilelayer-wms-add'>
5569 <td><code><b>add</b></code></td>
5570 <td><code><a href='#event'>Event</a></code></td>
5571 <td>Fired after the layer is added to a map</td>
5572 </tr>
5573 <tr id='tilelayer-wms-remove'>
5574 <td><code><b>remove</b></code></td>
5575 <td><code><a href='#event'>Event</a></code></td>
5576 <td>Fired after the layer is removed from a map</td>
5577 </tr>
5578</tbody></table>
5579
5580</section></div>
5581 </div>
5582</div>
5583
5584<div class='accordion'>
5585 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
5586 <div class='accordion-overflow'>
5587 <div class='accordion-content'><section >
5588
5589
5590
5591
5592<table><thead>
5593 <tr>
5594 <th>Event</th>
5595 <th>Data</th>
5596 <th>Description</th>
5597 </tr>
5598 </thead><tbody>
5599 <tr id='tilelayer-wms-popupopen'>
5600 <td><code><b>popupopen</b></code></td>
5601 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
5602 <td>Fired when a popup bound to this layer is opened</td>
5603 </tr>
5604 <tr id='tilelayer-wms-popupclose'>
5605 <td><code><b>popupclose</b></code></td>
5606 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
5607 <td>Fired when a popup bound to this layer is closed</td>
5608 </tr>
5609</tbody></table>
5610
5611</section></div>
5612 </div>
5613</div>
5614
5615<div class='accordion'>
5616 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
5617 <div class='accordion-overflow'>
5618 <div class='accordion-content'><section >
5619
5620
5621
5622
5623<table><thead>
5624 <tr>
5625 <th>Event</th>
5626 <th>Data</th>
5627 <th>Description</th>
5628 </tr>
5629 </thead><tbody>
5630 <tr id='tilelayer-wms-tooltipopen'>
5631 <td><code><b>tooltipopen</b></code></td>
5632 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
5633 <td>Fired when a tooltip bound to this layer is opened.</td>
5634 </tr>
5635 <tr id='tilelayer-wms-tooltipclose'>
5636 <td><code><b>tooltipclose</b></code></td>
5637 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
5638 <td>Fired when a tooltip bound to this layer is closed.</td>
5639 </tr>
5640</tbody></table>
5641
5642</section></div>
5643 </div>
5644</div>
5645
5646</section><section>
5647<h3 id='tilelayer-wms-method'>Methods</h3>
5648
5649<section >
5650
5651
5652
5653
5654<table><thead>
5655 <tr>
5656 <th>Method</th>
5657 <th>Returns</th>
5658 <th>Description</th>
5659 </tr>
5660 </thead><tbody>
5661 <tr id='tilelayer-wms-setparams'>
5662 <td><code><b>setParams</b>(<nobr>&lt;Object&gt;</nobr> <i>params</i>, <nobr>&lt;Boolean&gt;</nobr> <i>noRedraw?</i>)</code></td>
5663 <td><code>this</code></td>
5664 <td><p>Merges an object with the new parameters and re-requests tiles on the current screen (unless <code>noRedraw</code> was set to true).</p>
5665</td>
5666 </tr>
5667</tbody></table>
5668
5669</section>
5670
5671
5672<div class='accordion'>
5673 <label><span class='expander'></span> Methods inherited from <a href='#tilelayer'>TileLayer</a></label>
5674 <div class='accordion-overflow'>
5675 <div class='accordion-content'><section >
5676
5677
5678
5679
5680<table><thead>
5681 <tr>
5682 <th>Method</th>
5683 <th>Returns</th>
5684 <th>Description</th>
5685 </tr>
5686 </thead><tbody>
5687 <tr id='tilelayer-wms-seturl'>
5688 <td><code><b>setUrl</b>(<nobr>&lt;String&gt;</nobr> <i>url</i>, <nobr>&lt;Boolean&gt;</nobr> <i>noRedraw?</i>)</code></td>
5689 <td><code>this</code></td>
5690 <td><p>Updates the layer&#39;s URL template and redraws it (unless <code>noRedraw</code> is set to <code>true</code>).
5691If the URL does not change, the layer will not be redrawn unless
5692the noRedraw parameter is set to false.</p>
5693</td>
5694 </tr>
5695 <tr id='tilelayer-wms-createtile'>
5696 <td><code><b>createTile</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>, <nobr>&lt;Function&gt;</nobr> <i>done?</i>)</code></td>
5697 <td><code>HTMLElement</code></td>
5698 <td><p>Called only internally, overrides GridLayer&#39;s <a href="#gridlayer-createtile"><code>createTile()</code></a>
5699to return an <code>&lt;img&gt;</code> HTML element with the appropriate image URL given <code>coords</code>. The <code>done</code>
5700callback is called when the tile has been loaded.</p>
5701</td>
5702 </tr>
5703</tbody></table>
5704
5705</section></div>
5706 </div>
5707</div>
5708
5709<div class='accordion'>
5710 <label><span class='expander'></span> Methods inherited from <a href='#gridlayer'>GridLayer</a></label>
5711 <div class='accordion-overflow'>
5712 <div class='accordion-content'><section >
5713
5714
5715
5716
5717<table><thead>
5718 <tr>
5719 <th>Method</th>
5720 <th>Returns</th>
5721 <th>Description</th>
5722 </tr>
5723 </thead><tbody>
5724 <tr id='tilelayer-wms-bringtofront'>
5725 <td><code><b>bringToFront</b>()</code></td>
5726 <td><code>this</code></td>
5727 <td><p>Brings the tile layer to the top of all tile layers.</p>
5728</td>
5729 </tr>
5730 <tr id='tilelayer-wms-bringtoback'>
5731 <td><code><b>bringToBack</b>()</code></td>
5732 <td><code>this</code></td>
5733 <td><p>Brings the tile layer to the bottom of all tile layers.</p>
5734</td>
5735 </tr>
5736 <tr id='tilelayer-wms-getcontainer'>
5737 <td><code><b>getContainer</b>()</code></td>
5738 <td><code>HTMLElement</code></td>
5739 <td><p>Returns the HTML element that contains the tiles for this layer.</p>
5740</td>
5741 </tr>
5742 <tr id='tilelayer-wms-setopacity'>
5743 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
5744 <td><code>this</code></td>
5745 <td><p>Changes the <a href="#gridlayer-opacity">opacity</a> of the grid layer.</p>
5746</td>
5747 </tr>
5748 <tr id='tilelayer-wms-setzindex'>
5749 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
5750 <td><code>this</code></td>
5751 <td><p>Changes the <a href="#gridlayer-zindex">zIndex</a> of the grid layer.</p>
5752</td>
5753 </tr>
5754 <tr id='tilelayer-wms-isloading'>
5755 <td><code><b>isLoading</b>()</code></td>
5756 <td><code>Boolean</code></td>
5757 <td><p>Returns <code>true</code> if any tile in the grid layer has not finished loading.</p>
5758</td>
5759 </tr>
5760 <tr id='tilelayer-wms-redraw'>
5761 <td><code><b>redraw</b>()</code></td>
5762 <td><code>this</code></td>
5763 <td><p>Causes the layer to clear all the tiles and request them again.</p>
5764</td>
5765 </tr>
5766 <tr id='tilelayer-wms-gettilesize'>
5767 <td><code><b>getTileSize</b>()</code></td>
5768 <td><code><a href='#point'>Point</a></code></td>
5769 <td><p>Normalizes the <a href="#gridlayer-tilesize">tileSize option</a> into a point. Used by the <code>createTile()</code> method.</p>
5770</td>
5771 </tr>
5772</tbody></table>
5773
5774</section></div>
5775 </div>
5776</div>
5777
5778<div class='accordion'>
5779 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
5780 <div class='accordion-overflow'>
5781 <div class='accordion-content'><section >
5782
5783
5784
5785
5786<table><thead>
5787 <tr>
5788 <th>Method</th>
5789 <th>Returns</th>
5790 <th>Description</th>
5791 </tr>
5792 </thead><tbody>
5793 <tr id='tilelayer-wms-addto'>
5794 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
5795 <td><code>this</code></td>
5796 <td><p>Adds the layer to the given map or layer group.</p>
5797</td>
5798 </tr>
5799 <tr id='tilelayer-wms-remove'>
5800 <td><code><b>remove</b>()</code></td>
5801 <td><code>this</code></td>
5802 <td><p>Removes the layer from the map it is currently active on.</p>
5803</td>
5804 </tr>
5805 <tr id='tilelayer-wms-removefrom'>
5806 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
5807 <td><code>this</code></td>
5808 <td><p>Removes the layer from the given map</p>
5809</td>
5810 </tr>
5811 <tr id='tilelayer-wms-removefrom'>
5812 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
5813 <td><code>this</code></td>
5814 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
5815</td>
5816 </tr>
5817 <tr id='tilelayer-wms-getpane'>
5818 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
5819 <td><code>HTMLElement</code></td>
5820 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
5821</td>
5822 </tr>
5823 <tr id='tilelayer-wms-getattribution'>
5824 <td><code><b>getAttribution</b>()</code></td>
5825 <td><code>String</code></td>
5826 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
5827</td>
5828 </tr>
5829</tbody></table>
5830
5831</section></div>
5832 </div>
5833</div>
5834
5835<div class='accordion'>
5836 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
5837 <div class='accordion-overflow'>
5838 <div class='accordion-content'><section >
5839
5840
5841
5842
5843<table><thead>
5844 <tr>
5845 <th>Method</th>
5846 <th>Returns</th>
5847 <th>Description</th>
5848 </tr>
5849 </thead><tbody>
5850 <tr id='tilelayer-wms-bindpopup'>
5851 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
5852 <td><code>this</code></td>
5853 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
5854necessary event listeners. If a <code>Function</code> is passed it will receive
5855the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
5856</td>
5857 </tr>
5858 <tr id='tilelayer-wms-unbindpopup'>
5859 <td><code><b>unbindPopup</b>()</code></td>
5860 <td><code>this</code></td>
5861 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
5862</td>
5863 </tr>
5864 <tr id='tilelayer-wms-openpopup'>
5865 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
5866 <td><code>this</code></td>
5867 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
5868</td>
5869 </tr>
5870 <tr id='tilelayer-wms-closepopup'>
5871 <td><code><b>closePopup</b>()</code></td>
5872 <td><code>this</code></td>
5873 <td><p>Closes the popup bound to this layer if it is open.</p>
5874</td>
5875 </tr>
5876 <tr id='tilelayer-wms-togglepopup'>
5877 <td><code><b>togglePopup</b>()</code></td>
5878 <td><code>this</code></td>
5879 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
5880</td>
5881 </tr>
5882 <tr id='tilelayer-wms-ispopupopen'>
5883 <td><code><b>isPopupOpen</b>()</code></td>
5884 <td><code>boolean</code></td>
5885 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
5886</td>
5887 </tr>
5888 <tr id='tilelayer-wms-setpopupcontent'>
5889 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
5890 <td><code>this</code></td>
5891 <td><p>Sets the content of the popup bound to this layer.</p>
5892</td>
5893 </tr>
5894 <tr id='tilelayer-wms-getpopup'>
5895 <td><code><b>getPopup</b>()</code></td>
5896 <td><code><a href='#popup'>Popup</a></code></td>
5897 <td><p>Returns the popup bound to this layer.</p>
5898</td>
5899 </tr>
5900</tbody></table>
5901
5902</section></div>
5903 </div>
5904</div>
5905
5906<div class='accordion'>
5907 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
5908 <div class='accordion-overflow'>
5909 <div class='accordion-content'><section >
5910
5911
5912
5913
5914<table><thead>
5915 <tr>
5916 <th>Method</th>
5917 <th>Returns</th>
5918 <th>Description</th>
5919 </tr>
5920 </thead><tbody>
5921 <tr id='tilelayer-wms-bindtooltip'>
5922 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
5923 <td><code>this</code></td>
5924 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
5925necessary event listeners. If a <code>Function</code> is passed it will receive
5926the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
5927</td>
5928 </tr>
5929 <tr id='tilelayer-wms-unbindtooltip'>
5930 <td><code><b>unbindTooltip</b>()</code></td>
5931 <td><code>this</code></td>
5932 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
5933</td>
5934 </tr>
5935 <tr id='tilelayer-wms-opentooltip'>
5936 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
5937 <td><code>this</code></td>
5938 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
5939</td>
5940 </tr>
5941 <tr id='tilelayer-wms-closetooltip'>
5942 <td><code><b>closeTooltip</b>()</code></td>
5943 <td><code>this</code></td>
5944 <td><p>Closes the tooltip bound to this layer if it is open.</p>
5945</td>
5946 </tr>
5947 <tr id='tilelayer-wms-toggletooltip'>
5948 <td><code><b>toggleTooltip</b>()</code></td>
5949 <td><code>this</code></td>
5950 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
5951</td>
5952 </tr>
5953 <tr id='tilelayer-wms-istooltipopen'>
5954 <td><code><b>isTooltipOpen</b>()</code></td>
5955 <td><code>boolean</code></td>
5956 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
5957</td>
5958 </tr>
5959 <tr id='tilelayer-wms-settooltipcontent'>
5960 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
5961 <td><code>this</code></td>
5962 <td><p>Sets the content of the tooltip bound to this layer.</p>
5963</td>
5964 </tr>
5965 <tr id='tilelayer-wms-gettooltip'>
5966 <td><code><b>getTooltip</b>()</code></td>
5967 <td><code><a href='#tooltip'>Tooltip</a></code></td>
5968 <td><p>Returns the tooltip bound to this layer.</p>
5969</td>
5970 </tr>
5971</tbody></table>
5972
5973</section></div>
5974 </div>
5975</div>
5976
5977<div class='accordion'>
5978 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
5979 <div class='accordion-overflow'>
5980 <div class='accordion-content'><section >
5981
5982
5983
5984
5985<table><thead>
5986 <tr>
5987 <th>Method</th>
5988 <th>Returns</th>
5989 <th>Description</th>
5990 </tr>
5991 </thead><tbody>
5992 <tr id='tilelayer-wms-on'>
5993 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
5994 <td><code>this</code></td>
5995 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
5996</td>
5997 </tr>
5998 <tr id='tilelayer-wms-on'>
5999 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
6000 <td><code>this</code></td>
6001 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
6002</td>
6003 </tr>
6004 <tr id='tilelayer-wms-off'>
6005 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
6006 <td><code>this</code></td>
6007 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
6008</td>
6009 </tr>
6010 <tr id='tilelayer-wms-off'>
6011 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
6012 <td><code>this</code></td>
6013 <td><p>Removes a set of type/listener pairs.</p>
6014</td>
6015 </tr>
6016 <tr id='tilelayer-wms-off'>
6017 <td><code><b>off</b>()</code></td>
6018 <td><code>this</code></td>
6019 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
6020</td>
6021 </tr>
6022 <tr id='tilelayer-wms-fire'>
6023 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
6024 <td><code>this</code></td>
6025 <td><p>Fires an event of the specified type. You can optionally provide an data
6026object — the first argument of the listener function will contain its
6027properties. The event can optionally be propagated to event parents.</p>
6028</td>
6029 </tr>
6030 <tr id='tilelayer-wms-listens'>
6031 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
6032 <td><code>Boolean</code></td>
6033 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
6034</td>
6035 </tr>
6036 <tr id='tilelayer-wms-once'>
6037 <td><code><b>once</b>(<i></i>)</code></td>
6038 <td><code>this</code></td>
6039 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
6040</td>
6041 </tr>
6042 <tr id='tilelayer-wms-addeventparent'>
6043 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
6044 <td><code>this</code></td>
6045 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
6046</td>
6047 </tr>
6048 <tr id='tilelayer-wms-removeeventparent'>
6049 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
6050 <td><code>this</code></td>
6051 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
6052</td>
6053 </tr>
6054 <tr id='tilelayer-wms-addeventlistener'>
6055 <td><code><b>addEventListener</b>(<i></i>)</code></td>
6056 <td><code>this</code></td>
6057 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
6058</td>
6059 </tr>
6060 <tr id='tilelayer-wms-removeeventlistener'>
6061 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
6062 <td><code>this</code></td>
6063 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
6064</td>
6065 </tr>
6066 <tr id='tilelayer-wms-clearalleventlisteners'>
6067 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
6068 <td><code>this</code></td>
6069 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
6070</td>
6071 </tr>
6072 <tr id='tilelayer-wms-addonetimeeventlistener'>
6073 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
6074 <td><code>this</code></td>
6075 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
6076</td>
6077 </tr>
6078 <tr id='tilelayer-wms-fireevent'>
6079 <td><code><b>fireEvent</b>(<i></i>)</code></td>
6080 <td><code>this</code></td>
6081 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
6082</td>
6083 </tr>
6084 <tr id='tilelayer-wms-haseventlisteners'>
6085 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
6086 <td><code>Boolean</code></td>
6087 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
6088</td>
6089 </tr>
6090</tbody></table>
6091
6092</section></div>
6093 </div>
6094</div>
6095
6096</section><h2 id='imageoverlay'>ImageOverlay</h2><p>Used to load and display a single image over specific bounds of the map. Extends <a href="#layer"><code>Layer</code></a>.</p>
6097
6098<section>
6099<h3 id='imageoverlay-example'>Usage example</h3>
6100
6101<section >
6102
6103
6104
6105
6106
6107<pre><code class="lang-js">var imageUrl = &#39;http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg&#39;,
6108 imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
6109L.imageOverlay(imageUrl, imageBounds).addTo(map);
6110</code></pre>
6111
6112
6113
6114</section>
6115
6116
6117</section><section>
6118<h3 id='imageoverlay-factory'>Creation</h3>
6119
6120<section >
6121
6122
6123
6124
6125<table><thead>
6126 <tr>
6127 <th>Factory</th>
6128 <th>Description</th>
6129 </tr>
6130 </thead><tbody>
6131 <tr id='imageoverlay-l-imageoverlay'>
6132 <td><code><b>L.imageOverlay</b>(<nobr>&lt;String&gt;</nobr> <i>imageUrl</i>, <nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;<a href='#imageoverlay-option'>ImageOverlay options</a>&gt;</nobr> <i>options?</i>)</code></td>
6133 <td>Instantiates an image overlay object given the URL of the image and the
6134geographical bounds it is tied to.</td>
6135 </tr>
6136</tbody></table>
6137
6138</section>
6139
6140
6141</section><section>
6142<h3 id='imageoverlay-option'>Options</h3>
6143
6144<section >
6145
6146
6147
6148
6149<table><thead>
6150 <tr>
6151 <th>Option</th>
6152 <th>Type</th>
6153 <th>Default</th>
6154 <th>Description</th>
6155 </tr>
6156 </thead><tbody>
6157 <tr id='imageoverlay-opacity'>
6158 <td><code><b>opacity</b></code></td>
6159 <td><code>Number</code></td>
6160 <td><code>1.0</code></td>
6161 <td>The opacity of the image overlay.</td>
6162 </tr>
6163 <tr id='imageoverlay-alt'>
6164 <td><code><b>alt</b></code></td>
6165 <td><code>String</code></td>
6166 <td><code>&#x27;&#x27;</code></td>
6167 <td>Text for the <code>alt</code> attribute of the image (useful for accessibility).</td>
6168 </tr>
6169 <tr id='imageoverlay-interactive'>
6170 <td><code><b>interactive</b></code></td>
6171 <td><code>Boolean</code></td>
6172 <td><code>false</code></td>
6173 <td>If <code>true</code>, the image overlay will emit <a href="#interactive-layer">mouse events</a> when clicked or hovered.</td>
6174 </tr>
6175 <tr id='imageoverlay-crossorigin'>
6176 <td><code><b>crossOrigin</b></code></td>
6177 <td><code>Boolean|String</code></td>
6178 <td><code>false</code></td>
6179 <td>Whether the crossOrigin attribute will be added to the image.
6180If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
6181Refer to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes">CORS Settings</a> for valid String values.</td>
6182 </tr>
6183 <tr id='imageoverlay-erroroverlayurl'>
6184 <td><code><b>errorOverlayUrl</b></code></td>
6185 <td><code>String</code></td>
6186 <td><code>&#x27;&#x27;</code></td>
6187 <td>URL to the overlay image to show in place of the overlay that failed to load.</td>
6188 </tr>
6189 <tr id='imageoverlay-zindex'>
6190 <td><code><b>zIndex</b></code></td>
6191 <td><code>Number</code></td>
6192 <td><code>1</code></td>
6193 <td>The explicit <a href="https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index">zIndex</a> of the overlay layer.</td>
6194 </tr>
6195 <tr id='imageoverlay-classname'>
6196 <td><code><b>className</b></code></td>
6197 <td><code>String</code></td>
6198 <td><code>&#x27;&#x27;</code></td>
6199 <td>A custom class name to assign to the image. Empty by default.</td>
6200 </tr>
6201</tbody></table>
6202
6203</section>
6204
6205
6206<div class='accordion'>
6207 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
6208 <div class='accordion-overflow'>
6209 <div class='accordion-content'><section >
6210
6211
6212
6213
6214<table><thead>
6215 <tr>
6216 <th>Option</th>
6217 <th>Type</th>
6218 <th>Default</th>
6219 <th>Description</th>
6220 </tr>
6221 </thead><tbody>
6222 <tr id='imageoverlay-bubblingmouseevents'>
6223 <td><code><b>bubblingMouseEvents</b></code></td>
6224 <td><code>Boolean</code></td>
6225 <td><code>true</code></td>
6226 <td>When <code>true</code>, a mouse event on this layer will trigger the same event on the map
6227(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
6228 </tr>
6229</tbody></table>
6230
6231</section></div>
6232 </div>
6233</div>
6234
6235<div class='accordion'>
6236 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
6237 <div class='accordion-overflow'>
6238 <div class='accordion-content'><section >
6239
6240
6241
6242
6243<table><thead>
6244 <tr>
6245 <th>Option</th>
6246 <th>Type</th>
6247 <th>Default</th>
6248 <th>Description</th>
6249 </tr>
6250 </thead><tbody>
6251 <tr id='imageoverlay-pane'>
6252 <td><code><b>pane</b></code></td>
6253 <td><code>String</code></td>
6254 <td><code>&#x27;overlayPane&#x27;</code></td>
6255 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
6256 </tr>
6257 <tr id='imageoverlay-attribution'>
6258 <td><code><b>attribution</b></code></td>
6259 <td><code>String</code></td>
6260 <td><code>null</code></td>
6261 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
6262 </tr>
6263</tbody></table>
6264
6265</section></div>
6266 </div>
6267</div>
6268
6269</section><section>
6270<h3 id='imageoverlay-event'>Events</h3>
6271
6272<section >
6273
6274
6275
6276
6277<table><thead>
6278 <tr>
6279 <th>Event</th>
6280 <th>Data</th>
6281 <th>Description</th>
6282 </tr>
6283 </thead><tbody>
6284 <tr id='imageoverlay-load'>
6285 <td><code><b>load</b></code></td>
6286 <td><code><a href='#event'>Event</a></code></td>
6287 <td>Fired when the ImageOverlay layer has loaded its image</td>
6288 </tr>
6289 <tr id='imageoverlay-error'>
6290 <td><code><b>error</b></code></td>
6291 <td><code><a href='#event'>Event</a></code></td>
6292 <td>Fired when the ImageOverlay layer fails to load its image</td>
6293 </tr>
6294</tbody></table>
6295
6296</section>
6297
6298
6299<div class='accordion'>
6300 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
6301 <div class='accordion-overflow'>
6302 <div class='accordion-content'><section >
6303
6304
6305
6306
6307<table><thead>
6308 <tr>
6309 <th>Event</th>
6310 <th>Data</th>
6311 <th>Description</th>
6312 </tr>
6313 </thead><tbody>
6314 <tr id='imageoverlay-click'>
6315 <td><code><b>click</b></code></td>
6316 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6317 <td>Fired when the user clicks (or taps) the layer.</td>
6318 </tr>
6319 <tr id='imageoverlay-dblclick'>
6320 <td><code><b>dblclick</b></code></td>
6321 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6322 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
6323 </tr>
6324 <tr id='imageoverlay-mousedown'>
6325 <td><code><b>mousedown</b></code></td>
6326 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6327 <td>Fired when the user pushes the mouse button on the layer.</td>
6328 </tr>
6329 <tr id='imageoverlay-mouseup'>
6330 <td><code><b>mouseup</b></code></td>
6331 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6332 <td>Fired when the user releases the mouse button pushed on the layer.</td>
6333 </tr>
6334 <tr id='imageoverlay-mouseover'>
6335 <td><code><b>mouseover</b></code></td>
6336 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6337 <td>Fired when the mouse enters the layer.</td>
6338 </tr>
6339 <tr id='imageoverlay-mouseout'>
6340 <td><code><b>mouseout</b></code></td>
6341 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6342 <td>Fired when the mouse leaves the layer.</td>
6343 </tr>
6344 <tr id='imageoverlay-contextmenu'>
6345 <td><code><b>contextmenu</b></code></td>
6346 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
6347 <td>Fired when the user right-clicks on the layer, prevents
6348default browser context menu from showing if there are listeners on
6349this event. Also fired on mobile when the user holds a single touch
6350for a second (also called long press).</td>
6351 </tr>
6352</tbody></table>
6353
6354</section></div>
6355 </div>
6356</div>
6357
6358<div class='accordion'>
6359 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
6360 <div class='accordion-overflow'>
6361 <div class='accordion-content'><section >
6362
6363
6364
6365
6366<table><thead>
6367 <tr>
6368 <th>Event</th>
6369 <th>Data</th>
6370 <th>Description</th>
6371 </tr>
6372 </thead><tbody>
6373 <tr id='imageoverlay-add'>
6374 <td><code><b>add</b></code></td>
6375 <td><code><a href='#event'>Event</a></code></td>
6376 <td>Fired after the layer is added to a map</td>
6377 </tr>
6378 <tr id='imageoverlay-remove'>
6379 <td><code><b>remove</b></code></td>
6380 <td><code><a href='#event'>Event</a></code></td>
6381 <td>Fired after the layer is removed from a map</td>
6382 </tr>
6383</tbody></table>
6384
6385</section></div>
6386 </div>
6387</div>
6388
6389<div class='accordion'>
6390 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
6391 <div class='accordion-overflow'>
6392 <div class='accordion-content'><section >
6393
6394
6395
6396
6397<table><thead>
6398 <tr>
6399 <th>Event</th>
6400 <th>Data</th>
6401 <th>Description</th>
6402 </tr>
6403 </thead><tbody>
6404 <tr id='imageoverlay-popupopen'>
6405 <td><code><b>popupopen</b></code></td>
6406 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
6407 <td>Fired when a popup bound to this layer is opened</td>
6408 </tr>
6409 <tr id='imageoverlay-popupclose'>
6410 <td><code><b>popupclose</b></code></td>
6411 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
6412 <td>Fired when a popup bound to this layer is closed</td>
6413 </tr>
6414</tbody></table>
6415
6416</section></div>
6417 </div>
6418</div>
6419
6420<div class='accordion'>
6421 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
6422 <div class='accordion-overflow'>
6423 <div class='accordion-content'><section >
6424
6425
6426
6427
6428<table><thead>
6429 <tr>
6430 <th>Event</th>
6431 <th>Data</th>
6432 <th>Description</th>
6433 </tr>
6434 </thead><tbody>
6435 <tr id='imageoverlay-tooltipopen'>
6436 <td><code><b>tooltipopen</b></code></td>
6437 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
6438 <td>Fired when a tooltip bound to this layer is opened.</td>
6439 </tr>
6440 <tr id='imageoverlay-tooltipclose'>
6441 <td><code><b>tooltipclose</b></code></td>
6442 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
6443 <td>Fired when a tooltip bound to this layer is closed.</td>
6444 </tr>
6445</tbody></table>
6446
6447</section></div>
6448 </div>
6449</div>
6450
6451</section><section>
6452<h3 id='imageoverlay-method'>Methods</h3>
6453
6454<section >
6455
6456
6457
6458
6459<table><thead>
6460 <tr>
6461 <th>Method</th>
6462 <th>Returns</th>
6463 <th>Description</th>
6464 </tr>
6465 </thead><tbody>
6466 <tr id='imageoverlay-setopacity'>
6467 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
6468 <td><code>this</code></td>
6469 <td><p>Sets the opacity of the overlay.</p>
6470</td>
6471 </tr>
6472 <tr id='imageoverlay-bringtofront'>
6473 <td><code><b>bringToFront</b>()</code></td>
6474 <td><code>this</code></td>
6475 <td><p>Brings the layer to the top of all overlays.</p>
6476</td>
6477 </tr>
6478 <tr id='imageoverlay-bringtoback'>
6479 <td><code><b>bringToBack</b>()</code></td>
6480 <td><code>this</code></td>
6481 <td><p>Brings the layer to the bottom of all overlays.</p>
6482</td>
6483 </tr>
6484 <tr id='imageoverlay-seturl'>
6485 <td><code><b>setUrl</b>(<nobr>&lt;String&gt;</nobr> <i>url</i>)</code></td>
6486 <td><code>this</code></td>
6487 <td><p>Changes the URL of the image.</p>
6488</td>
6489 </tr>
6490 <tr id='imageoverlay-setbounds'>
6491 <td><code><b>setBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
6492 <td><code>this</code></td>
6493 <td><p>Update the bounds that this ImageOverlay covers</p>
6494</td>
6495 </tr>
6496 <tr id='imageoverlay-setzindex'>
6497 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>value</i>)</code></td>
6498 <td><code>this</code></td>
6499 <td><p>Changes the <a href="#imageoverlay-zindex">zIndex</a> of the image overlay.</p>
6500</td>
6501 </tr>
6502 <tr id='imageoverlay-getbounds'>
6503 <td><code><b>getBounds</b>()</code></td>
6504 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
6505 <td><p>Get the bounds that this ImageOverlay covers</p>
6506</td>
6507 </tr>
6508 <tr id='imageoverlay-getelement'>
6509 <td><code><b>getElement</b>()</code></td>
6510 <td><code>HTMLElement</code></td>
6511 <td><p>Returns the instance of <a href="https://developer.mozilla.org/docs/Web/API/HTMLImageElement"><code>HTMLImageElement</code></a>
6512used by this overlay.</p>
6513</td>
6514 </tr>
6515</tbody></table>
6516
6517</section>
6518
6519
6520<div class='accordion'>
6521 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
6522 <div class='accordion-overflow'>
6523 <div class='accordion-content'><section >
6524
6525
6526
6527
6528<table><thead>
6529 <tr>
6530 <th>Method</th>
6531 <th>Returns</th>
6532 <th>Description</th>
6533 </tr>
6534 </thead><tbody>
6535 <tr id='imageoverlay-addto'>
6536 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
6537 <td><code>this</code></td>
6538 <td><p>Adds the layer to the given map or layer group.</p>
6539</td>
6540 </tr>
6541 <tr id='imageoverlay-remove'>
6542 <td><code><b>remove</b>()</code></td>
6543 <td><code>this</code></td>
6544 <td><p>Removes the layer from the map it is currently active on.</p>
6545</td>
6546 </tr>
6547 <tr id='imageoverlay-removefrom'>
6548 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
6549 <td><code>this</code></td>
6550 <td><p>Removes the layer from the given map</p>
6551</td>
6552 </tr>
6553 <tr id='imageoverlay-removefrom'>
6554 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
6555 <td><code>this</code></td>
6556 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
6557</td>
6558 </tr>
6559 <tr id='imageoverlay-getpane'>
6560 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
6561 <td><code>HTMLElement</code></td>
6562 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
6563</td>
6564 </tr>
6565 <tr id='imageoverlay-getattribution'>
6566 <td><code><b>getAttribution</b>()</code></td>
6567 <td><code>String</code></td>
6568 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
6569</td>
6570 </tr>
6571</tbody></table>
6572
6573</section></div>
6574 </div>
6575</div>
6576
6577<div class='accordion'>
6578 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
6579 <div class='accordion-overflow'>
6580 <div class='accordion-content'><section >
6581
6582
6583
6584
6585<table><thead>
6586 <tr>
6587 <th>Method</th>
6588 <th>Returns</th>
6589 <th>Description</th>
6590 </tr>
6591 </thead><tbody>
6592 <tr id='imageoverlay-bindpopup'>
6593 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
6594 <td><code>this</code></td>
6595 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
6596necessary event listeners. If a <code>Function</code> is passed it will receive
6597the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
6598</td>
6599 </tr>
6600 <tr id='imageoverlay-unbindpopup'>
6601 <td><code><b>unbindPopup</b>()</code></td>
6602 <td><code>this</code></td>
6603 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
6604</td>
6605 </tr>
6606 <tr id='imageoverlay-openpopup'>
6607 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
6608 <td><code>this</code></td>
6609 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
6610</td>
6611 </tr>
6612 <tr id='imageoverlay-closepopup'>
6613 <td><code><b>closePopup</b>()</code></td>
6614 <td><code>this</code></td>
6615 <td><p>Closes the popup bound to this layer if it is open.</p>
6616</td>
6617 </tr>
6618 <tr id='imageoverlay-togglepopup'>
6619 <td><code><b>togglePopup</b>()</code></td>
6620 <td><code>this</code></td>
6621 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
6622</td>
6623 </tr>
6624 <tr id='imageoverlay-ispopupopen'>
6625 <td><code><b>isPopupOpen</b>()</code></td>
6626 <td><code>boolean</code></td>
6627 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
6628</td>
6629 </tr>
6630 <tr id='imageoverlay-setpopupcontent'>
6631 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
6632 <td><code>this</code></td>
6633 <td><p>Sets the content of the popup bound to this layer.</p>
6634</td>
6635 </tr>
6636 <tr id='imageoverlay-getpopup'>
6637 <td><code><b>getPopup</b>()</code></td>
6638 <td><code><a href='#popup'>Popup</a></code></td>
6639 <td><p>Returns the popup bound to this layer.</p>
6640</td>
6641 </tr>
6642</tbody></table>
6643
6644</section></div>
6645 </div>
6646</div>
6647
6648<div class='accordion'>
6649 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
6650 <div class='accordion-overflow'>
6651 <div class='accordion-content'><section >
6652
6653
6654
6655
6656<table><thead>
6657 <tr>
6658 <th>Method</th>
6659 <th>Returns</th>
6660 <th>Description</th>
6661 </tr>
6662 </thead><tbody>
6663 <tr id='imageoverlay-bindtooltip'>
6664 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
6665 <td><code>this</code></td>
6666 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
6667necessary event listeners. If a <code>Function</code> is passed it will receive
6668the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
6669</td>
6670 </tr>
6671 <tr id='imageoverlay-unbindtooltip'>
6672 <td><code><b>unbindTooltip</b>()</code></td>
6673 <td><code>this</code></td>
6674 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
6675</td>
6676 </tr>
6677 <tr id='imageoverlay-opentooltip'>
6678 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
6679 <td><code>this</code></td>
6680 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
6681</td>
6682 </tr>
6683 <tr id='imageoverlay-closetooltip'>
6684 <td><code><b>closeTooltip</b>()</code></td>
6685 <td><code>this</code></td>
6686 <td><p>Closes the tooltip bound to this layer if it is open.</p>
6687</td>
6688 </tr>
6689 <tr id='imageoverlay-toggletooltip'>
6690 <td><code><b>toggleTooltip</b>()</code></td>
6691 <td><code>this</code></td>
6692 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
6693</td>
6694 </tr>
6695 <tr id='imageoverlay-istooltipopen'>
6696 <td><code><b>isTooltipOpen</b>()</code></td>
6697 <td><code>boolean</code></td>
6698 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
6699</td>
6700 </tr>
6701 <tr id='imageoverlay-settooltipcontent'>
6702 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
6703 <td><code>this</code></td>
6704 <td><p>Sets the content of the tooltip bound to this layer.</p>
6705</td>
6706 </tr>
6707 <tr id='imageoverlay-gettooltip'>
6708 <td><code><b>getTooltip</b>()</code></td>
6709 <td><code><a href='#tooltip'>Tooltip</a></code></td>
6710 <td><p>Returns the tooltip bound to this layer.</p>
6711</td>
6712 </tr>
6713</tbody></table>
6714
6715</section></div>
6716 </div>
6717</div>
6718
6719<div class='accordion'>
6720 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
6721 <div class='accordion-overflow'>
6722 <div class='accordion-content'><section >
6723
6724
6725
6726
6727<table><thead>
6728 <tr>
6729 <th>Method</th>
6730 <th>Returns</th>
6731 <th>Description</th>
6732 </tr>
6733 </thead><tbody>
6734 <tr id='imageoverlay-on'>
6735 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
6736 <td><code>this</code></td>
6737 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
6738</td>
6739 </tr>
6740 <tr id='imageoverlay-on'>
6741 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
6742 <td><code>this</code></td>
6743 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
6744</td>
6745 </tr>
6746 <tr id='imageoverlay-off'>
6747 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
6748 <td><code>this</code></td>
6749 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
6750</td>
6751 </tr>
6752 <tr id='imageoverlay-off'>
6753 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
6754 <td><code>this</code></td>
6755 <td><p>Removes a set of type/listener pairs.</p>
6756</td>
6757 </tr>
6758 <tr id='imageoverlay-off'>
6759 <td><code><b>off</b>()</code></td>
6760 <td><code>this</code></td>
6761 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
6762</td>
6763 </tr>
6764 <tr id='imageoverlay-fire'>
6765 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
6766 <td><code>this</code></td>
6767 <td><p>Fires an event of the specified type. You can optionally provide an data
6768object — the first argument of the listener function will contain its
6769properties. The event can optionally be propagated to event parents.</p>
6770</td>
6771 </tr>
6772 <tr id='imageoverlay-listens'>
6773 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
6774 <td><code>Boolean</code></td>
6775 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
6776</td>
6777 </tr>
6778 <tr id='imageoverlay-once'>
6779 <td><code><b>once</b>(<i></i>)</code></td>
6780 <td><code>this</code></td>
6781 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
6782</td>
6783 </tr>
6784 <tr id='imageoverlay-addeventparent'>
6785 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
6786 <td><code>this</code></td>
6787 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
6788</td>
6789 </tr>
6790 <tr id='imageoverlay-removeeventparent'>
6791 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
6792 <td><code>this</code></td>
6793 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
6794</td>
6795 </tr>
6796 <tr id='imageoverlay-addeventlistener'>
6797 <td><code><b>addEventListener</b>(<i></i>)</code></td>
6798 <td><code>this</code></td>
6799 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
6800</td>
6801 </tr>
6802 <tr id='imageoverlay-removeeventlistener'>
6803 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
6804 <td><code>this</code></td>
6805 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
6806</td>
6807 </tr>
6808 <tr id='imageoverlay-clearalleventlisteners'>
6809 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
6810 <td><code>this</code></td>
6811 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
6812</td>
6813 </tr>
6814 <tr id='imageoverlay-addonetimeeventlistener'>
6815 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
6816 <td><code>this</code></td>
6817 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
6818</td>
6819 </tr>
6820 <tr id='imageoverlay-fireevent'>
6821 <td><code><b>fireEvent</b>(<i></i>)</code></td>
6822 <td><code>this</code></td>
6823 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
6824</td>
6825 </tr>
6826 <tr id='imageoverlay-haseventlisteners'>
6827 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
6828 <td><code>Boolean</code></td>
6829 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
6830</td>
6831 </tr>
6832</tbody></table>
6833
6834</section></div>
6835 </div>
6836</div>
6837
6838</section><h2 id='videooverlay'>VideoOverlay</h2><p>Used to load and display a video player over specific bounds of the map. Extends <a href="#imageoverlay"><code>ImageOverlay</code></a>.
6839A video overlay uses the <a href="https://developer.mozilla.org/docs/Web/HTML/Element/video"><code>&lt;video&gt;</code></a>
6840HTML5 element.</p>
6841
6842<section>
6843<h3 id='videooverlay-example'>Usage example</h3>
6844
6845<section >
6846
6847
6848
6849
6850
6851<pre><code class="lang-js">var videoUrl = &#39;https://www.mapbox.com/bites/00188/patricia_nasa.webm&#39;,
6852 videoBounds = [[ 32, -130], [ 13, -100]];
6853L.videoOverlay(videoUrl, videoBounds ).addTo(map);
6854</code></pre>
6855
6856
6857
6858</section>
6859
6860
6861</section><section>
6862<h3 id='videooverlay-factory'>Creation</h3>
6863
6864<section >
6865
6866
6867
6868
6869<table><thead>
6870 <tr>
6871 <th>Factory</th>
6872 <th>Description</th>
6873 </tr>
6874 </thead><tbody>
6875 <tr id='videooverlay-l-videooverlay'>
6876 <td><code><b>L.videoOverlay</b>(<nobr>&lt;String|Array|HTMLVideoElement&gt;</nobr> <i>video</i>, <nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;<a href='#videooverlay-option'>VideoOverlay options</a>&gt;</nobr> <i>options?</i>)</code></td>
6877 <td>Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
6878geographical bounds it is tied to.</td>
6879 </tr>
6880</tbody></table>
6881
6882</section>
6883
6884
6885</section><section>
6886<h3 id='videooverlay-option'>Options</h3>
6887
6888<section >
6889
6890
6891
6892
6893<table><thead>
6894 <tr>
6895 <th>Option</th>
6896 <th>Type</th>
6897 <th>Default</th>
6898 <th>Description</th>
6899 </tr>
6900 </thead><tbody>
6901 <tr id='videooverlay-autoplay'>
6902 <td><code><b>autoplay</b></code></td>
6903 <td><code>Boolean</code></td>
6904 <td><code>true</code></td>
6905 <td>Whether the video starts playing automatically when loaded.</td>
6906 </tr>
6907 <tr id='videooverlay-loop'>
6908 <td><code><b>loop</b></code></td>
6909 <td><code>Boolean</code></td>
6910 <td><code>true</code></td>
6911 <td>Whether the video will loop back to the beginning when played.</td>
6912 </tr>
6913 <tr id='videooverlay-keepaspectratio'>
6914 <td><code><b>keepAspectRatio</b></code></td>
6915 <td><code>Boolean</code></td>
6916 <td><code>true</code></td>
6917 <td>Whether the video will save aspect ratio after the projection.
6918Relevant for supported browsers. Browser compatibility- <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit">https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit</a></td>
6919 </tr>
6920 <tr id='videooverlay-muted'>
6921 <td><code><b>muted</b></code></td>
6922 <td><code>Boolean</code></td>
6923 <td><code>false</code></td>
6924 <td>Whether the video starts on mute when loaded.</td>
6925 </tr>
6926</tbody></table>
6927
6928</section>
6929
6930
6931<div class='accordion'>
6932 <label><span class='expander'></span> Options inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
6933 <div class='accordion-overflow'>
6934 <div class='accordion-content'><section >
6935
6936
6937
6938
6939<table><thead>
6940 <tr>
6941 <th>Option</th>
6942 <th>Type</th>
6943 <th>Default</th>
6944 <th>Description</th>
6945 </tr>
6946 </thead><tbody>
6947 <tr id='videooverlay-opacity'>
6948 <td><code><b>opacity</b></code></td>
6949 <td><code>Number</code></td>
6950 <td><code>1.0</code></td>
6951 <td>The opacity of the image overlay.</td>
6952 </tr>
6953 <tr id='videooverlay-alt'>
6954 <td><code><b>alt</b></code></td>
6955 <td><code>String</code></td>
6956 <td><code>&#x27;&#x27;</code></td>
6957 <td>Text for the <code>alt</code> attribute of the image (useful for accessibility).</td>
6958 </tr>
6959 <tr id='videooverlay-interactive'>
6960 <td><code><b>interactive</b></code></td>
6961 <td><code>Boolean</code></td>
6962 <td><code>false</code></td>
6963 <td>If <code>true</code>, the image overlay will emit <a href="#interactive-layer">mouse events</a> when clicked or hovered.</td>
6964 </tr>
6965 <tr id='videooverlay-crossorigin'>
6966 <td><code><b>crossOrigin</b></code></td>
6967 <td><code>Boolean|String</code></td>
6968 <td><code>false</code></td>
6969 <td>Whether the crossOrigin attribute will be added to the image.
6970If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
6971Refer to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes">CORS Settings</a> for valid String values.</td>
6972 </tr>
6973 <tr id='videooverlay-erroroverlayurl'>
6974 <td><code><b>errorOverlayUrl</b></code></td>
6975 <td><code>String</code></td>
6976 <td><code>&#x27;&#x27;</code></td>
6977 <td>URL to the overlay image to show in place of the overlay that failed to load.</td>
6978 </tr>
6979 <tr id='videooverlay-zindex'>
6980 <td><code><b>zIndex</b></code></td>
6981 <td><code>Number</code></td>
6982 <td><code>1</code></td>
6983 <td>The explicit <a href="https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index">zIndex</a> of the overlay layer.</td>
6984 </tr>
6985 <tr id='videooverlay-classname'>
6986 <td><code><b>className</b></code></td>
6987 <td><code>String</code></td>
6988 <td><code>&#x27;&#x27;</code></td>
6989 <td>A custom class name to assign to the image. Empty by default.</td>
6990 </tr>
6991</tbody></table>
6992
6993</section></div>
6994 </div>
6995</div>
6996
6997<div class='accordion'>
6998 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
6999 <div class='accordion-overflow'>
7000 <div class='accordion-content'><section >
7001
7002
7003
7004
7005<table><thead>
7006 <tr>
7007 <th>Option</th>
7008 <th>Type</th>
7009 <th>Default</th>
7010 <th>Description</th>
7011 </tr>
7012 </thead><tbody>
7013 <tr id='videooverlay-bubblingmouseevents'>
7014 <td><code><b>bubblingMouseEvents</b></code></td>
7015 <td><code>Boolean</code></td>
7016 <td><code>true</code></td>
7017 <td>When <code>true</code>, a mouse event on this layer will trigger the same event on the map
7018(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
7019 </tr>
7020</tbody></table>
7021
7022</section></div>
7023 </div>
7024</div>
7025
7026<div class='accordion'>
7027 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
7028 <div class='accordion-overflow'>
7029 <div class='accordion-content'><section >
7030
7031
7032
7033
7034<table><thead>
7035 <tr>
7036 <th>Option</th>
7037 <th>Type</th>
7038 <th>Default</th>
7039 <th>Description</th>
7040 </tr>
7041 </thead><tbody>
7042 <tr id='videooverlay-pane'>
7043 <td><code><b>pane</b></code></td>
7044 <td><code>String</code></td>
7045 <td><code>&#x27;overlayPane&#x27;</code></td>
7046 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
7047 </tr>
7048 <tr id='videooverlay-attribution'>
7049 <td><code><b>attribution</b></code></td>
7050 <td><code>String</code></td>
7051 <td><code>null</code></td>
7052 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
7053 </tr>
7054</tbody></table>
7055
7056</section></div>
7057 </div>
7058</div>
7059
7060</section><section>
7061<h3 id='videooverlay-event'>Events</h3>
7062
7063<section >
7064
7065
7066
7067
7068<table><thead>
7069 <tr>
7070 <th>Event</th>
7071 <th>Data</th>
7072 <th>Description</th>
7073 </tr>
7074 </thead><tbody>
7075 <tr id='videooverlay-load'>
7076 <td><code><b>load</b></code></td>
7077 <td><code><a href='#event'>Event</a></code></td>
7078 <td>Fired when the video has finished loading the first frame</td>
7079 </tr>
7080</tbody></table>
7081
7082</section>
7083
7084
7085<div class='accordion'>
7086 <label><span class='expander'></span> Events inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
7087 <div class='accordion-overflow'>
7088 <div class='accordion-content'><section >
7089
7090
7091
7092
7093<table><thead>
7094 <tr>
7095 <th>Event</th>
7096 <th>Data</th>
7097 <th>Description</th>
7098 </tr>
7099 </thead><tbody>
7100 <tr id='videooverlay-error'>
7101 <td><code><b>error</b></code></td>
7102 <td><code><a href='#event'>Event</a></code></td>
7103 <td>Fired when the ImageOverlay layer fails to load its image</td>
7104 </tr>
7105</tbody></table>
7106
7107</section></div>
7108 </div>
7109</div>
7110
7111<div class='accordion'>
7112 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
7113 <div class='accordion-overflow'>
7114 <div class='accordion-content'><section >
7115
7116
7117
7118
7119<table><thead>
7120 <tr>
7121 <th>Event</th>
7122 <th>Data</th>
7123 <th>Description</th>
7124 </tr>
7125 </thead><tbody>
7126 <tr id='videooverlay-click'>
7127 <td><code><b>click</b></code></td>
7128 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7129 <td>Fired when the user clicks (or taps) the layer.</td>
7130 </tr>
7131 <tr id='videooverlay-dblclick'>
7132 <td><code><b>dblclick</b></code></td>
7133 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7134 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
7135 </tr>
7136 <tr id='videooverlay-mousedown'>
7137 <td><code><b>mousedown</b></code></td>
7138 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7139 <td>Fired when the user pushes the mouse button on the layer.</td>
7140 </tr>
7141 <tr id='videooverlay-mouseup'>
7142 <td><code><b>mouseup</b></code></td>
7143 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7144 <td>Fired when the user releases the mouse button pushed on the layer.</td>
7145 </tr>
7146 <tr id='videooverlay-mouseover'>
7147 <td><code><b>mouseover</b></code></td>
7148 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7149 <td>Fired when the mouse enters the layer.</td>
7150 </tr>
7151 <tr id='videooverlay-mouseout'>
7152 <td><code><b>mouseout</b></code></td>
7153 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7154 <td>Fired when the mouse leaves the layer.</td>
7155 </tr>
7156 <tr id='videooverlay-contextmenu'>
7157 <td><code><b>contextmenu</b></code></td>
7158 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7159 <td>Fired when the user right-clicks on the layer, prevents
7160default browser context menu from showing if there are listeners on
7161this event. Also fired on mobile when the user holds a single touch
7162for a second (also called long press).</td>
7163 </tr>
7164</tbody></table>
7165
7166</section></div>
7167 </div>
7168</div>
7169
7170<div class='accordion'>
7171 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
7172 <div class='accordion-overflow'>
7173 <div class='accordion-content'><section >
7174
7175
7176
7177
7178<table><thead>
7179 <tr>
7180 <th>Event</th>
7181 <th>Data</th>
7182 <th>Description</th>
7183 </tr>
7184 </thead><tbody>
7185 <tr id='videooverlay-add'>
7186 <td><code><b>add</b></code></td>
7187 <td><code><a href='#event'>Event</a></code></td>
7188 <td>Fired after the layer is added to a map</td>
7189 </tr>
7190 <tr id='videooverlay-remove'>
7191 <td><code><b>remove</b></code></td>
7192 <td><code><a href='#event'>Event</a></code></td>
7193 <td>Fired after the layer is removed from a map</td>
7194 </tr>
7195</tbody></table>
7196
7197</section></div>
7198 </div>
7199</div>
7200
7201<div class='accordion'>
7202 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
7203 <div class='accordion-overflow'>
7204 <div class='accordion-content'><section >
7205
7206
7207
7208
7209<table><thead>
7210 <tr>
7211 <th>Event</th>
7212 <th>Data</th>
7213 <th>Description</th>
7214 </tr>
7215 </thead><tbody>
7216 <tr id='videooverlay-popupopen'>
7217 <td><code><b>popupopen</b></code></td>
7218 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
7219 <td>Fired when a popup bound to this layer is opened</td>
7220 </tr>
7221 <tr id='videooverlay-popupclose'>
7222 <td><code><b>popupclose</b></code></td>
7223 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
7224 <td>Fired when a popup bound to this layer is closed</td>
7225 </tr>
7226</tbody></table>
7227
7228</section></div>
7229 </div>
7230</div>
7231
7232<div class='accordion'>
7233 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
7234 <div class='accordion-overflow'>
7235 <div class='accordion-content'><section >
7236
7237
7238
7239
7240<table><thead>
7241 <tr>
7242 <th>Event</th>
7243 <th>Data</th>
7244 <th>Description</th>
7245 </tr>
7246 </thead><tbody>
7247 <tr id='videooverlay-tooltipopen'>
7248 <td><code><b>tooltipopen</b></code></td>
7249 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
7250 <td>Fired when a tooltip bound to this layer is opened.</td>
7251 </tr>
7252 <tr id='videooverlay-tooltipclose'>
7253 <td><code><b>tooltipclose</b></code></td>
7254 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
7255 <td>Fired when a tooltip bound to this layer is closed.</td>
7256 </tr>
7257</tbody></table>
7258
7259</section></div>
7260 </div>
7261</div>
7262
7263</section><section>
7264<h3 id='videooverlay-method'>Methods</h3>
7265
7266<section >
7267
7268
7269
7270
7271<table><thead>
7272 <tr>
7273 <th>Method</th>
7274 <th>Returns</th>
7275 <th>Description</th>
7276 </tr>
7277 </thead><tbody>
7278 <tr id='videooverlay-getelement'>
7279 <td><code><b>getElement</b>()</code></td>
7280 <td><code>HTMLVideoElement</code></td>
7281 <td><p>Returns the instance of <a href="https://developer.mozilla.org/docs/Web/API/HTMLVideoElement"><code>HTMLVideoElement</code></a>
7282used by this overlay.</p>
7283</td>
7284 </tr>
7285</tbody></table>
7286
7287</section>
7288
7289
7290<div class='accordion'>
7291 <label><span class='expander'></span> Methods inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
7292 <div class='accordion-overflow'>
7293 <div class='accordion-content'><section >
7294
7295
7296
7297
7298<table><thead>
7299 <tr>
7300 <th>Method</th>
7301 <th>Returns</th>
7302 <th>Description</th>
7303 </tr>
7304 </thead><tbody>
7305 <tr id='videooverlay-setopacity'>
7306 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
7307 <td><code>this</code></td>
7308 <td><p>Sets the opacity of the overlay.</p>
7309</td>
7310 </tr>
7311 <tr id='videooverlay-bringtofront'>
7312 <td><code><b>bringToFront</b>()</code></td>
7313 <td><code>this</code></td>
7314 <td><p>Brings the layer to the top of all overlays.</p>
7315</td>
7316 </tr>
7317 <tr id='videooverlay-bringtoback'>
7318 <td><code><b>bringToBack</b>()</code></td>
7319 <td><code>this</code></td>
7320 <td><p>Brings the layer to the bottom of all overlays.</p>
7321</td>
7322 </tr>
7323 <tr id='videooverlay-seturl'>
7324 <td><code><b>setUrl</b>(<nobr>&lt;String&gt;</nobr> <i>url</i>)</code></td>
7325 <td><code>this</code></td>
7326 <td><p>Changes the URL of the image.</p>
7327</td>
7328 </tr>
7329 <tr id='videooverlay-setbounds'>
7330 <td><code><b>setBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
7331 <td><code>this</code></td>
7332 <td><p>Update the bounds that this ImageOverlay covers</p>
7333</td>
7334 </tr>
7335 <tr id='videooverlay-setzindex'>
7336 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>value</i>)</code></td>
7337 <td><code>this</code></td>
7338 <td><p>Changes the <a href="#imageoverlay-zindex">zIndex</a> of the image overlay.</p>
7339</td>
7340 </tr>
7341 <tr id='videooverlay-getbounds'>
7342 <td><code><b>getBounds</b>()</code></td>
7343 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
7344 <td><p>Get the bounds that this ImageOverlay covers</p>
7345</td>
7346 </tr>
7347</tbody></table>
7348
7349</section></div>
7350 </div>
7351</div>
7352
7353<div class='accordion'>
7354 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
7355 <div class='accordion-overflow'>
7356 <div class='accordion-content'><section >
7357
7358
7359
7360
7361<table><thead>
7362 <tr>
7363 <th>Method</th>
7364 <th>Returns</th>
7365 <th>Description</th>
7366 </tr>
7367 </thead><tbody>
7368 <tr id='videooverlay-addto'>
7369 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
7370 <td><code>this</code></td>
7371 <td><p>Adds the layer to the given map or layer group.</p>
7372</td>
7373 </tr>
7374 <tr id='videooverlay-remove'>
7375 <td><code><b>remove</b>()</code></td>
7376 <td><code>this</code></td>
7377 <td><p>Removes the layer from the map it is currently active on.</p>
7378</td>
7379 </tr>
7380 <tr id='videooverlay-removefrom'>
7381 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
7382 <td><code>this</code></td>
7383 <td><p>Removes the layer from the given map</p>
7384</td>
7385 </tr>
7386 <tr id='videooverlay-removefrom'>
7387 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
7388 <td><code>this</code></td>
7389 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
7390</td>
7391 </tr>
7392 <tr id='videooverlay-getpane'>
7393 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
7394 <td><code>HTMLElement</code></td>
7395 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
7396</td>
7397 </tr>
7398 <tr id='videooverlay-getattribution'>
7399 <td><code><b>getAttribution</b>()</code></td>
7400 <td><code>String</code></td>
7401 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
7402</td>
7403 </tr>
7404</tbody></table>
7405
7406</section></div>
7407 </div>
7408</div>
7409
7410<div class='accordion'>
7411 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
7412 <div class='accordion-overflow'>
7413 <div class='accordion-content'><section >
7414
7415
7416
7417
7418<table><thead>
7419 <tr>
7420 <th>Method</th>
7421 <th>Returns</th>
7422 <th>Description</th>
7423 </tr>
7424 </thead><tbody>
7425 <tr id='videooverlay-bindpopup'>
7426 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
7427 <td><code>this</code></td>
7428 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
7429necessary event listeners. If a <code>Function</code> is passed it will receive
7430the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
7431</td>
7432 </tr>
7433 <tr id='videooverlay-unbindpopup'>
7434 <td><code><b>unbindPopup</b>()</code></td>
7435 <td><code>this</code></td>
7436 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
7437</td>
7438 </tr>
7439 <tr id='videooverlay-openpopup'>
7440 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
7441 <td><code>this</code></td>
7442 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
7443</td>
7444 </tr>
7445 <tr id='videooverlay-closepopup'>
7446 <td><code><b>closePopup</b>()</code></td>
7447 <td><code>this</code></td>
7448 <td><p>Closes the popup bound to this layer if it is open.</p>
7449</td>
7450 </tr>
7451 <tr id='videooverlay-togglepopup'>
7452 <td><code><b>togglePopup</b>()</code></td>
7453 <td><code>this</code></td>
7454 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
7455</td>
7456 </tr>
7457 <tr id='videooverlay-ispopupopen'>
7458 <td><code><b>isPopupOpen</b>()</code></td>
7459 <td><code>boolean</code></td>
7460 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
7461</td>
7462 </tr>
7463 <tr id='videooverlay-setpopupcontent'>
7464 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
7465 <td><code>this</code></td>
7466 <td><p>Sets the content of the popup bound to this layer.</p>
7467</td>
7468 </tr>
7469 <tr id='videooverlay-getpopup'>
7470 <td><code><b>getPopup</b>()</code></td>
7471 <td><code><a href='#popup'>Popup</a></code></td>
7472 <td><p>Returns the popup bound to this layer.</p>
7473</td>
7474 </tr>
7475</tbody></table>
7476
7477</section></div>
7478 </div>
7479</div>
7480
7481<div class='accordion'>
7482 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
7483 <div class='accordion-overflow'>
7484 <div class='accordion-content'><section >
7485
7486
7487
7488
7489<table><thead>
7490 <tr>
7491 <th>Method</th>
7492 <th>Returns</th>
7493 <th>Description</th>
7494 </tr>
7495 </thead><tbody>
7496 <tr id='videooverlay-bindtooltip'>
7497 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
7498 <td><code>this</code></td>
7499 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
7500necessary event listeners. If a <code>Function</code> is passed it will receive
7501the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
7502</td>
7503 </tr>
7504 <tr id='videooverlay-unbindtooltip'>
7505 <td><code><b>unbindTooltip</b>()</code></td>
7506 <td><code>this</code></td>
7507 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
7508</td>
7509 </tr>
7510 <tr id='videooverlay-opentooltip'>
7511 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
7512 <td><code>this</code></td>
7513 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
7514</td>
7515 </tr>
7516 <tr id='videooverlay-closetooltip'>
7517 <td><code><b>closeTooltip</b>()</code></td>
7518 <td><code>this</code></td>
7519 <td><p>Closes the tooltip bound to this layer if it is open.</p>
7520</td>
7521 </tr>
7522 <tr id='videooverlay-toggletooltip'>
7523 <td><code><b>toggleTooltip</b>()</code></td>
7524 <td><code>this</code></td>
7525 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
7526</td>
7527 </tr>
7528 <tr id='videooverlay-istooltipopen'>
7529 <td><code><b>isTooltipOpen</b>()</code></td>
7530 <td><code>boolean</code></td>
7531 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
7532</td>
7533 </tr>
7534 <tr id='videooverlay-settooltipcontent'>
7535 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
7536 <td><code>this</code></td>
7537 <td><p>Sets the content of the tooltip bound to this layer.</p>
7538</td>
7539 </tr>
7540 <tr id='videooverlay-gettooltip'>
7541 <td><code><b>getTooltip</b>()</code></td>
7542 <td><code><a href='#tooltip'>Tooltip</a></code></td>
7543 <td><p>Returns the tooltip bound to this layer.</p>
7544</td>
7545 </tr>
7546</tbody></table>
7547
7548</section></div>
7549 </div>
7550</div>
7551
7552<div class='accordion'>
7553 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
7554 <div class='accordion-overflow'>
7555 <div class='accordion-content'><section >
7556
7557
7558
7559
7560<table><thead>
7561 <tr>
7562 <th>Method</th>
7563 <th>Returns</th>
7564 <th>Description</th>
7565 </tr>
7566 </thead><tbody>
7567 <tr id='videooverlay-on'>
7568 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
7569 <td><code>this</code></td>
7570 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
7571</td>
7572 </tr>
7573 <tr id='videooverlay-on'>
7574 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
7575 <td><code>this</code></td>
7576 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
7577</td>
7578 </tr>
7579 <tr id='videooverlay-off'>
7580 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
7581 <td><code>this</code></td>
7582 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
7583</td>
7584 </tr>
7585 <tr id='videooverlay-off'>
7586 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
7587 <td><code>this</code></td>
7588 <td><p>Removes a set of type/listener pairs.</p>
7589</td>
7590 </tr>
7591 <tr id='videooverlay-off'>
7592 <td><code><b>off</b>()</code></td>
7593 <td><code>this</code></td>
7594 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
7595</td>
7596 </tr>
7597 <tr id='videooverlay-fire'>
7598 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
7599 <td><code>this</code></td>
7600 <td><p>Fires an event of the specified type. You can optionally provide an data
7601object — the first argument of the listener function will contain its
7602properties. The event can optionally be propagated to event parents.</p>
7603</td>
7604 </tr>
7605 <tr id='videooverlay-listens'>
7606 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
7607 <td><code>Boolean</code></td>
7608 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
7609</td>
7610 </tr>
7611 <tr id='videooverlay-once'>
7612 <td><code><b>once</b>(<i></i>)</code></td>
7613 <td><code>this</code></td>
7614 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
7615</td>
7616 </tr>
7617 <tr id='videooverlay-addeventparent'>
7618 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
7619 <td><code>this</code></td>
7620 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
7621</td>
7622 </tr>
7623 <tr id='videooverlay-removeeventparent'>
7624 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
7625 <td><code>this</code></td>
7626 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
7627</td>
7628 </tr>
7629 <tr id='videooverlay-addeventlistener'>
7630 <td><code><b>addEventListener</b>(<i></i>)</code></td>
7631 <td><code>this</code></td>
7632 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
7633</td>
7634 </tr>
7635 <tr id='videooverlay-removeeventlistener'>
7636 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
7637 <td><code>this</code></td>
7638 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
7639</td>
7640 </tr>
7641 <tr id='videooverlay-clearalleventlisteners'>
7642 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
7643 <td><code>this</code></td>
7644 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
7645</td>
7646 </tr>
7647 <tr id='videooverlay-addonetimeeventlistener'>
7648 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
7649 <td><code>this</code></td>
7650 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
7651</td>
7652 </tr>
7653 <tr id='videooverlay-fireevent'>
7654 <td><code><b>fireEvent</b>(<i></i>)</code></td>
7655 <td><code>this</code></td>
7656 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
7657</td>
7658 </tr>
7659 <tr id='videooverlay-haseventlisteners'>
7660 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
7661 <td><code>Boolean</code></td>
7662 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
7663</td>
7664 </tr>
7665</tbody></table>
7666
7667</section></div>
7668 </div>
7669</div>
7670
7671</section><h2 id='svgoverlay'>SVGOverlay</h2><p>Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends <a href="#imageoverlay"><code>ImageOverlay</code></a>.
7672An SVG overlay uses the <a href="https://developer.mozilla.org/docs/Web/SVG/Element/svg"><code>&lt;svg&gt;</code></a> element.</p>
7673
7674<section>
7675<h3 id='svgoverlay-example'>Usage example</h3>
7676
7677<section >
7678
7679
7680
7681
7682
7683<pre><code class="lang-js">var svgElement = document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;, &quot;svg&quot;);
7684svgElement.setAttribute(&#39;xmlns&#39;, &quot;http://www.w3.org/2000/svg&quot;);
7685svgElement.setAttribute(&#39;viewBox&#39;, &quot;0 0 200 200&quot;);
7686svgElement.innerHTML = &#39;&lt;rect width=&quot;200&quot; height=&quot;200&quot;/&gt;&lt;rect x=&quot;75&quot; y=&quot;23&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red&quot;/&gt;&lt;rect x=&quot;75&quot; y=&quot;123&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:#0013ff&quot;/&gt;&#39;;
7687var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];
7688L.svgOverlay(svgElement, svgElementBounds).addTo(map);
7689</code></pre>
7690
7691
7692
7693</section>
7694
7695
7696</section><section>
7697<h3 id='svgoverlay-factory'>Creation</h3>
7698
7699<section >
7700
7701
7702
7703
7704<table><thead>
7705 <tr>
7706 <th>Factory</th>
7707 <th>Description</th>
7708 </tr>
7709 </thead><tbody>
7710 <tr id='svgoverlay-l-svgoverlay'>
7711 <td><code><b>L.svgOverlay</b>(<nobr>&lt;String|SVGElement&gt;</nobr> <i>svg</i>, <nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;SVGOverlay options&gt;</nobr> <i>options?</i>)</code></td>
7712 <td>Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to.
7713A viewBox attribute is required on the SVG element to zoom in and out properly.</td>
7714 </tr>
7715</tbody></table>
7716
7717</section>
7718
7719
7720</section><section>
7721<h3 id=''>Options</h3>
7722
7723
7724
7725
7726<div class='accordion'>
7727 <label><span class='expander'></span> Options inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
7728 <div class='accordion-overflow'>
7729 <div class='accordion-content'><section >
7730
7731
7732
7733
7734<table><thead>
7735 <tr>
7736 <th>Option</th>
7737 <th>Type</th>
7738 <th>Default</th>
7739 <th>Description</th>
7740 </tr>
7741 </thead><tbody>
7742 <tr id='svgoverlay-opacity'>
7743 <td><code><b>opacity</b></code></td>
7744 <td><code>Number</code></td>
7745 <td><code>1.0</code></td>
7746 <td>The opacity of the image overlay.</td>
7747 </tr>
7748 <tr id='svgoverlay-alt'>
7749 <td><code><b>alt</b></code></td>
7750 <td><code>String</code></td>
7751 <td><code>&#x27;&#x27;</code></td>
7752 <td>Text for the <code>alt</code> attribute of the image (useful for accessibility).</td>
7753 </tr>
7754 <tr id='svgoverlay-interactive'>
7755 <td><code><b>interactive</b></code></td>
7756 <td><code>Boolean</code></td>
7757 <td><code>false</code></td>
7758 <td>If <code>true</code>, the image overlay will emit <a href="#interactive-layer">mouse events</a> when clicked or hovered.</td>
7759 </tr>
7760 <tr id='svgoverlay-crossorigin'>
7761 <td><code><b>crossOrigin</b></code></td>
7762 <td><code>Boolean|String</code></td>
7763 <td><code>false</code></td>
7764 <td>Whether the crossOrigin attribute will be added to the image.
7765If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
7766Refer to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes">CORS Settings</a> for valid String values.</td>
7767 </tr>
7768 <tr id='svgoverlay-erroroverlayurl'>
7769 <td><code><b>errorOverlayUrl</b></code></td>
7770 <td><code>String</code></td>
7771 <td><code>&#x27;&#x27;</code></td>
7772 <td>URL to the overlay image to show in place of the overlay that failed to load.</td>
7773 </tr>
7774 <tr id='svgoverlay-zindex'>
7775 <td><code><b>zIndex</b></code></td>
7776 <td><code>Number</code></td>
7777 <td><code>1</code></td>
7778 <td>The explicit <a href="https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index">zIndex</a> of the overlay layer.</td>
7779 </tr>
7780 <tr id='svgoverlay-classname'>
7781 <td><code><b>className</b></code></td>
7782 <td><code>String</code></td>
7783 <td><code>&#x27;&#x27;</code></td>
7784 <td>A custom class name to assign to the image. Empty by default.</td>
7785 </tr>
7786</tbody></table>
7787
7788</section></div>
7789 </div>
7790</div>
7791
7792<div class='accordion'>
7793 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
7794 <div class='accordion-overflow'>
7795 <div class='accordion-content'><section >
7796
7797
7798
7799
7800<table><thead>
7801 <tr>
7802 <th>Option</th>
7803 <th>Type</th>
7804 <th>Default</th>
7805 <th>Description</th>
7806 </tr>
7807 </thead><tbody>
7808 <tr id='svgoverlay-bubblingmouseevents'>
7809 <td><code><b>bubblingMouseEvents</b></code></td>
7810 <td><code>Boolean</code></td>
7811 <td><code>true</code></td>
7812 <td>When <code>true</code>, a mouse event on this layer will trigger the same event on the map
7813(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
7814 </tr>
7815</tbody></table>
7816
7817</section></div>
7818 </div>
7819</div>
7820
7821<div class='accordion'>
7822 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
7823 <div class='accordion-overflow'>
7824 <div class='accordion-content'><section >
7825
7826
7827
7828
7829<table><thead>
7830 <tr>
7831 <th>Option</th>
7832 <th>Type</th>
7833 <th>Default</th>
7834 <th>Description</th>
7835 </tr>
7836 </thead><tbody>
7837 <tr id='svgoverlay-pane'>
7838 <td><code><b>pane</b></code></td>
7839 <td><code>String</code></td>
7840 <td><code>&#x27;overlayPane&#x27;</code></td>
7841 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
7842 </tr>
7843 <tr id='svgoverlay-attribution'>
7844 <td><code><b>attribution</b></code></td>
7845 <td><code>String</code></td>
7846 <td><code>null</code></td>
7847 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
7848 </tr>
7849</tbody></table>
7850
7851</section></div>
7852 </div>
7853</div>
7854
7855</section><section>
7856<h3 id=''>Events</h3>
7857
7858
7859
7860
7861<div class='accordion'>
7862 <label><span class='expander'></span> Events inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
7863 <div class='accordion-overflow'>
7864 <div class='accordion-content'><section >
7865
7866
7867
7868
7869<table><thead>
7870 <tr>
7871 <th>Event</th>
7872 <th>Data</th>
7873 <th>Description</th>
7874 </tr>
7875 </thead><tbody>
7876 <tr id='svgoverlay-load'>
7877 <td><code><b>load</b></code></td>
7878 <td><code><a href='#event'>Event</a></code></td>
7879 <td>Fired when the ImageOverlay layer has loaded its image</td>
7880 </tr>
7881 <tr id='svgoverlay-error'>
7882 <td><code><b>error</b></code></td>
7883 <td><code><a href='#event'>Event</a></code></td>
7884 <td>Fired when the ImageOverlay layer fails to load its image</td>
7885 </tr>
7886</tbody></table>
7887
7888</section></div>
7889 </div>
7890</div>
7891
7892<div class='accordion'>
7893 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
7894 <div class='accordion-overflow'>
7895 <div class='accordion-content'><section >
7896
7897
7898
7899
7900<table><thead>
7901 <tr>
7902 <th>Event</th>
7903 <th>Data</th>
7904 <th>Description</th>
7905 </tr>
7906 </thead><tbody>
7907 <tr id='svgoverlay-click'>
7908 <td><code><b>click</b></code></td>
7909 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7910 <td>Fired when the user clicks (or taps) the layer.</td>
7911 </tr>
7912 <tr id='svgoverlay-dblclick'>
7913 <td><code><b>dblclick</b></code></td>
7914 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7915 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
7916 </tr>
7917 <tr id='svgoverlay-mousedown'>
7918 <td><code><b>mousedown</b></code></td>
7919 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7920 <td>Fired when the user pushes the mouse button on the layer.</td>
7921 </tr>
7922 <tr id='svgoverlay-mouseup'>
7923 <td><code><b>mouseup</b></code></td>
7924 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7925 <td>Fired when the user releases the mouse button pushed on the layer.</td>
7926 </tr>
7927 <tr id='svgoverlay-mouseover'>
7928 <td><code><b>mouseover</b></code></td>
7929 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7930 <td>Fired when the mouse enters the layer.</td>
7931 </tr>
7932 <tr id='svgoverlay-mouseout'>
7933 <td><code><b>mouseout</b></code></td>
7934 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7935 <td>Fired when the mouse leaves the layer.</td>
7936 </tr>
7937 <tr id='svgoverlay-contextmenu'>
7938 <td><code><b>contextmenu</b></code></td>
7939 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
7940 <td>Fired when the user right-clicks on the layer, prevents
7941default browser context menu from showing if there are listeners on
7942this event. Also fired on mobile when the user holds a single touch
7943for a second (also called long press).</td>
7944 </tr>
7945</tbody></table>
7946
7947</section></div>
7948 </div>
7949</div>
7950
7951<div class='accordion'>
7952 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
7953 <div class='accordion-overflow'>
7954 <div class='accordion-content'><section >
7955
7956
7957
7958
7959<table><thead>
7960 <tr>
7961 <th>Event</th>
7962 <th>Data</th>
7963 <th>Description</th>
7964 </tr>
7965 </thead><tbody>
7966 <tr id='svgoverlay-add'>
7967 <td><code><b>add</b></code></td>
7968 <td><code><a href='#event'>Event</a></code></td>
7969 <td>Fired after the layer is added to a map</td>
7970 </tr>
7971 <tr id='svgoverlay-remove'>
7972 <td><code><b>remove</b></code></td>
7973 <td><code><a href='#event'>Event</a></code></td>
7974 <td>Fired after the layer is removed from a map</td>
7975 </tr>
7976</tbody></table>
7977
7978</section></div>
7979 </div>
7980</div>
7981
7982<div class='accordion'>
7983 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
7984 <div class='accordion-overflow'>
7985 <div class='accordion-content'><section >
7986
7987
7988
7989
7990<table><thead>
7991 <tr>
7992 <th>Event</th>
7993 <th>Data</th>
7994 <th>Description</th>
7995 </tr>
7996 </thead><tbody>
7997 <tr id='svgoverlay-popupopen'>
7998 <td><code><b>popupopen</b></code></td>
7999 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
8000 <td>Fired when a popup bound to this layer is opened</td>
8001 </tr>
8002 <tr id='svgoverlay-popupclose'>
8003 <td><code><b>popupclose</b></code></td>
8004 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
8005 <td>Fired when a popup bound to this layer is closed</td>
8006 </tr>
8007</tbody></table>
8008
8009</section></div>
8010 </div>
8011</div>
8012
8013<div class='accordion'>
8014 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
8015 <div class='accordion-overflow'>
8016 <div class='accordion-content'><section >
8017
8018
8019
8020
8021<table><thead>
8022 <tr>
8023 <th>Event</th>
8024 <th>Data</th>
8025 <th>Description</th>
8026 </tr>
8027 </thead><tbody>
8028 <tr id='svgoverlay-tooltipopen'>
8029 <td><code><b>tooltipopen</b></code></td>
8030 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
8031 <td>Fired when a tooltip bound to this layer is opened.</td>
8032 </tr>
8033 <tr id='svgoverlay-tooltipclose'>
8034 <td><code><b>tooltipclose</b></code></td>
8035 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
8036 <td>Fired when a tooltip bound to this layer is closed.</td>
8037 </tr>
8038</tbody></table>
8039
8040</section></div>
8041 </div>
8042</div>
8043
8044</section><section>
8045<h3 id='svgoverlay-method'>Methods</h3>
8046
8047<section >
8048
8049
8050
8051
8052<table><thead>
8053 <tr>
8054 <th>Method</th>
8055 <th>Returns</th>
8056 <th>Description</th>
8057 </tr>
8058 </thead><tbody>
8059 <tr id='svgoverlay-getelement'>
8060 <td><code><b>getElement</b>()</code></td>
8061 <td><code>SVGElement</code></td>
8062 <td><p>Returns the instance of <a href="https://developer.mozilla.org/docs/Web/API/SVGElement"><code>SVGElement</code></a>
8063used by this overlay.</p>
8064</td>
8065 </tr>
8066</tbody></table>
8067
8068</section>
8069
8070
8071<div class='accordion'>
8072 <label><span class='expander'></span> Methods inherited from <a href='#imageoverlay'>ImageOverlay</a></label>
8073 <div class='accordion-overflow'>
8074 <div class='accordion-content'><section >
8075
8076
8077
8078
8079<table><thead>
8080 <tr>
8081 <th>Method</th>
8082 <th>Returns</th>
8083 <th>Description</th>
8084 </tr>
8085 </thead><tbody>
8086 <tr id='svgoverlay-setopacity'>
8087 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
8088 <td><code>this</code></td>
8089 <td><p>Sets the opacity of the overlay.</p>
8090</td>
8091 </tr>
8092 <tr id='svgoverlay-bringtofront'>
8093 <td><code><b>bringToFront</b>()</code></td>
8094 <td><code>this</code></td>
8095 <td><p>Brings the layer to the top of all overlays.</p>
8096</td>
8097 </tr>
8098 <tr id='svgoverlay-bringtoback'>
8099 <td><code><b>bringToBack</b>()</code></td>
8100 <td><code>this</code></td>
8101 <td><p>Brings the layer to the bottom of all overlays.</p>
8102</td>
8103 </tr>
8104 <tr id='svgoverlay-seturl'>
8105 <td><code><b>setUrl</b>(<nobr>&lt;String&gt;</nobr> <i>url</i>)</code></td>
8106 <td><code>this</code></td>
8107 <td><p>Changes the URL of the image.</p>
8108</td>
8109 </tr>
8110 <tr id='svgoverlay-setbounds'>
8111 <td><code><b>setBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
8112 <td><code>this</code></td>
8113 <td><p>Update the bounds that this ImageOverlay covers</p>
8114</td>
8115 </tr>
8116 <tr id='svgoverlay-setzindex'>
8117 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>value</i>)</code></td>
8118 <td><code>this</code></td>
8119 <td><p>Changes the <a href="#imageoverlay-zindex">zIndex</a> of the image overlay.</p>
8120</td>
8121 </tr>
8122 <tr id='svgoverlay-getbounds'>
8123 <td><code><b>getBounds</b>()</code></td>
8124 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
8125 <td><p>Get the bounds that this ImageOverlay covers</p>
8126</td>
8127 </tr>
8128</tbody></table>
8129
8130</section></div>
8131 </div>
8132</div>
8133
8134<div class='accordion'>
8135 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
8136 <div class='accordion-overflow'>
8137 <div class='accordion-content'><section >
8138
8139
8140
8141
8142<table><thead>
8143 <tr>
8144 <th>Method</th>
8145 <th>Returns</th>
8146 <th>Description</th>
8147 </tr>
8148 </thead><tbody>
8149 <tr id='svgoverlay-addto'>
8150 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
8151 <td><code>this</code></td>
8152 <td><p>Adds the layer to the given map or layer group.</p>
8153</td>
8154 </tr>
8155 <tr id='svgoverlay-remove'>
8156 <td><code><b>remove</b>()</code></td>
8157 <td><code>this</code></td>
8158 <td><p>Removes the layer from the map it is currently active on.</p>
8159</td>
8160 </tr>
8161 <tr id='svgoverlay-removefrom'>
8162 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
8163 <td><code>this</code></td>
8164 <td><p>Removes the layer from the given map</p>
8165</td>
8166 </tr>
8167 <tr id='svgoverlay-removefrom'>
8168 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
8169 <td><code>this</code></td>
8170 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
8171</td>
8172 </tr>
8173 <tr id='svgoverlay-getpane'>
8174 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
8175 <td><code>HTMLElement</code></td>
8176 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
8177</td>
8178 </tr>
8179 <tr id='svgoverlay-getattribution'>
8180 <td><code><b>getAttribution</b>()</code></td>
8181 <td><code>String</code></td>
8182 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
8183</td>
8184 </tr>
8185</tbody></table>
8186
8187</section></div>
8188 </div>
8189</div>
8190
8191<div class='accordion'>
8192 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
8193 <div class='accordion-overflow'>
8194 <div class='accordion-content'><section >
8195
8196
8197
8198
8199<table><thead>
8200 <tr>
8201 <th>Method</th>
8202 <th>Returns</th>
8203 <th>Description</th>
8204 </tr>
8205 </thead><tbody>
8206 <tr id='svgoverlay-bindpopup'>
8207 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
8208 <td><code>this</code></td>
8209 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
8210necessary event listeners. If a <code>Function</code> is passed it will receive
8211the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
8212</td>
8213 </tr>
8214 <tr id='svgoverlay-unbindpopup'>
8215 <td><code><b>unbindPopup</b>()</code></td>
8216 <td><code>this</code></td>
8217 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
8218</td>
8219 </tr>
8220 <tr id='svgoverlay-openpopup'>
8221 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
8222 <td><code>this</code></td>
8223 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
8224</td>
8225 </tr>
8226 <tr id='svgoverlay-closepopup'>
8227 <td><code><b>closePopup</b>()</code></td>
8228 <td><code>this</code></td>
8229 <td><p>Closes the popup bound to this layer if it is open.</p>
8230</td>
8231 </tr>
8232 <tr id='svgoverlay-togglepopup'>
8233 <td><code><b>togglePopup</b>()</code></td>
8234 <td><code>this</code></td>
8235 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
8236</td>
8237 </tr>
8238 <tr id='svgoverlay-ispopupopen'>
8239 <td><code><b>isPopupOpen</b>()</code></td>
8240 <td><code>boolean</code></td>
8241 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
8242</td>
8243 </tr>
8244 <tr id='svgoverlay-setpopupcontent'>
8245 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
8246 <td><code>this</code></td>
8247 <td><p>Sets the content of the popup bound to this layer.</p>
8248</td>
8249 </tr>
8250 <tr id='svgoverlay-getpopup'>
8251 <td><code><b>getPopup</b>()</code></td>
8252 <td><code><a href='#popup'>Popup</a></code></td>
8253 <td><p>Returns the popup bound to this layer.</p>
8254</td>
8255 </tr>
8256</tbody></table>
8257
8258</section></div>
8259 </div>
8260</div>
8261
8262<div class='accordion'>
8263 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
8264 <div class='accordion-overflow'>
8265 <div class='accordion-content'><section >
8266
8267
8268
8269
8270<table><thead>
8271 <tr>
8272 <th>Method</th>
8273 <th>Returns</th>
8274 <th>Description</th>
8275 </tr>
8276 </thead><tbody>
8277 <tr id='svgoverlay-bindtooltip'>
8278 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
8279 <td><code>this</code></td>
8280 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
8281necessary event listeners. If a <code>Function</code> is passed it will receive
8282the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
8283</td>
8284 </tr>
8285 <tr id='svgoverlay-unbindtooltip'>
8286 <td><code><b>unbindTooltip</b>()</code></td>
8287 <td><code>this</code></td>
8288 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
8289</td>
8290 </tr>
8291 <tr id='svgoverlay-opentooltip'>
8292 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
8293 <td><code>this</code></td>
8294 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
8295</td>
8296 </tr>
8297 <tr id='svgoverlay-closetooltip'>
8298 <td><code><b>closeTooltip</b>()</code></td>
8299 <td><code>this</code></td>
8300 <td><p>Closes the tooltip bound to this layer if it is open.</p>
8301</td>
8302 </tr>
8303 <tr id='svgoverlay-toggletooltip'>
8304 <td><code><b>toggleTooltip</b>()</code></td>
8305 <td><code>this</code></td>
8306 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
8307</td>
8308 </tr>
8309 <tr id='svgoverlay-istooltipopen'>
8310 <td><code><b>isTooltipOpen</b>()</code></td>
8311 <td><code>boolean</code></td>
8312 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
8313</td>
8314 </tr>
8315 <tr id='svgoverlay-settooltipcontent'>
8316 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
8317 <td><code>this</code></td>
8318 <td><p>Sets the content of the tooltip bound to this layer.</p>
8319</td>
8320 </tr>
8321 <tr id='svgoverlay-gettooltip'>
8322 <td><code><b>getTooltip</b>()</code></td>
8323 <td><code><a href='#tooltip'>Tooltip</a></code></td>
8324 <td><p>Returns the tooltip bound to this layer.</p>
8325</td>
8326 </tr>
8327</tbody></table>
8328
8329</section></div>
8330 </div>
8331</div>
8332
8333<div class='accordion'>
8334 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
8335 <div class='accordion-overflow'>
8336 <div class='accordion-content'><section >
8337
8338
8339
8340
8341<table><thead>
8342 <tr>
8343 <th>Method</th>
8344 <th>Returns</th>
8345 <th>Description</th>
8346 </tr>
8347 </thead><tbody>
8348 <tr id='svgoverlay-on'>
8349 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
8350 <td><code>this</code></td>
8351 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
8352</td>
8353 </tr>
8354 <tr id='svgoverlay-on'>
8355 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
8356 <td><code>this</code></td>
8357 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
8358</td>
8359 </tr>
8360 <tr id='svgoverlay-off'>
8361 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
8362 <td><code>this</code></td>
8363 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
8364</td>
8365 </tr>
8366 <tr id='svgoverlay-off'>
8367 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
8368 <td><code>this</code></td>
8369 <td><p>Removes a set of type/listener pairs.</p>
8370</td>
8371 </tr>
8372 <tr id='svgoverlay-off'>
8373 <td><code><b>off</b>()</code></td>
8374 <td><code>this</code></td>
8375 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
8376</td>
8377 </tr>
8378 <tr id='svgoverlay-fire'>
8379 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
8380 <td><code>this</code></td>
8381 <td><p>Fires an event of the specified type. You can optionally provide an data
8382object — the first argument of the listener function will contain its
8383properties. The event can optionally be propagated to event parents.</p>
8384</td>
8385 </tr>
8386 <tr id='svgoverlay-listens'>
8387 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
8388 <td><code>Boolean</code></td>
8389 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
8390</td>
8391 </tr>
8392 <tr id='svgoverlay-once'>
8393 <td><code><b>once</b>(<i></i>)</code></td>
8394 <td><code>this</code></td>
8395 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
8396</td>
8397 </tr>
8398 <tr id='svgoverlay-addeventparent'>
8399 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
8400 <td><code>this</code></td>
8401 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
8402</td>
8403 </tr>
8404 <tr id='svgoverlay-removeeventparent'>
8405 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
8406 <td><code>this</code></td>
8407 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
8408</td>
8409 </tr>
8410 <tr id='svgoverlay-addeventlistener'>
8411 <td><code><b>addEventListener</b>(<i></i>)</code></td>
8412 <td><code>this</code></td>
8413 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
8414</td>
8415 </tr>
8416 <tr id='svgoverlay-removeeventlistener'>
8417 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
8418 <td><code>this</code></td>
8419 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
8420</td>
8421 </tr>
8422 <tr id='svgoverlay-clearalleventlisteners'>
8423 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
8424 <td><code>this</code></td>
8425 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
8426</td>
8427 </tr>
8428 <tr id='svgoverlay-addonetimeeventlistener'>
8429 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
8430 <td><code>this</code></td>
8431 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
8432</td>
8433 </tr>
8434 <tr id='svgoverlay-fireevent'>
8435 <td><code><b>fireEvent</b>(<i></i>)</code></td>
8436 <td><code>this</code></td>
8437 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
8438</td>
8439 </tr>
8440 <tr id='svgoverlay-haseventlisteners'>
8441 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
8442 <td><code>Boolean</code></td>
8443 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
8444</td>
8445 </tr>
8446</tbody></table>
8447
8448</section></div>
8449 </div>
8450</div>
8451
8452</section><h2 id='path'>Path</h2><p>An abstract class that contains options and constants shared between vector
8453overlays (Polygon, Polyline, Circle). Do not use it directly. Extends <a href="#layer"><code>Layer</code></a>.</p>
8454
8455<section>
8456<h3 id='path-option'>Options</h3>
8457
8458<section >
8459
8460
8461
8462
8463<table><thead>
8464 <tr>
8465 <th>Option</th>
8466 <th>Type</th>
8467 <th>Default</th>
8468 <th>Description</th>
8469 </tr>
8470 </thead><tbody>
8471 <tr id='path-stroke'>
8472 <td><code><b>stroke</b></code></td>
8473 <td><code>Boolean</code></td>
8474 <td><code>true</code></td>
8475 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
8476 </tr>
8477 <tr id='path-color'>
8478 <td><code><b>color</b></code></td>
8479 <td><code>String</code></td>
8480 <td><code>&#x27;#3388ff&#x27;</code></td>
8481 <td>Stroke color</td>
8482 </tr>
8483 <tr id='path-weight'>
8484 <td><code><b>weight</b></code></td>
8485 <td><code>Number</code></td>
8486 <td><code>3</code></td>
8487 <td>Stroke width in pixels</td>
8488 </tr>
8489 <tr id='path-opacity'>
8490 <td><code><b>opacity</b></code></td>
8491 <td><code>Number</code></td>
8492 <td><code>1.0</code></td>
8493 <td>Stroke opacity</td>
8494 </tr>
8495 <tr id='path-linecap'>
8496 <td><code><b>lineCap</b></code></td>
8497 <td><code>String</code></td>
8498 <td><code>&#x27;round&#x27;</code></td>
8499 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
8500 </tr>
8501 <tr id='path-linejoin'>
8502 <td><code><b>lineJoin</b></code></td>
8503 <td><code>String</code></td>
8504 <td><code>&#x27;round&#x27;</code></td>
8505 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
8506 </tr>
8507 <tr id='path-dasharray'>
8508 <td><code><b>dashArray</b></code></td>
8509 <td><code>String</code></td>
8510 <td><code>null</code></td>
8511 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
8512 </tr>
8513 <tr id='path-dashoffset'>
8514 <td><code><b>dashOffset</b></code></td>
8515 <td><code>String</code></td>
8516 <td><code>null</code></td>
8517 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
8518 </tr>
8519 <tr id='path-fill'>
8520 <td><code><b>fill</b></code></td>
8521 <td><code>Boolean</code></td>
8522 <td><code>depends</code></td>
8523 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
8524 </tr>
8525 <tr id='path-fillcolor'>
8526 <td><code><b>fillColor</b></code></td>
8527 <td><code>String</code></td>
8528 <td><code>*</code></td>
8529 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
8530 </tr>
8531 <tr id='path-fillopacity'>
8532 <td><code><b>fillOpacity</b></code></td>
8533 <td><code>Number</code></td>
8534 <td><code>0.2</code></td>
8535 <td>Fill opacity.</td>
8536 </tr>
8537 <tr id='path-fillrule'>
8538 <td><code><b>fillRule</b></code></td>
8539 <td><code>String</code></td>
8540 <td><code>&#x27;evenodd&#x27;</code></td>
8541 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
8542 </tr>
8543 <tr id='path-bubblingmouseevents'>
8544 <td><code><b>bubblingMouseEvents</b></code></td>
8545 <td><code>Boolean</code></td>
8546 <td><code>true</code></td>
8547 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
8548(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
8549 </tr>
8550 <tr id='path-renderer'>
8551 <td><code><b>renderer</b></code></td>
8552 <td><code><a href='#renderer'>Renderer</a></code></td>
8553 <td><code></code></td>
8554 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
8555precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
8556 </tr>
8557 <tr id='path-classname'>
8558 <td><code><b>className</b></code></td>
8559 <td><code>String</code></td>
8560 <td><code>null</code></td>
8561 <td>Custom class name set on an element. Only for SVG renderer.</td>
8562 </tr>
8563</tbody></table>
8564
8565</section>
8566
8567
8568<div class='accordion'>
8569 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
8570 <div class='accordion-overflow'>
8571 <div class='accordion-content'><section >
8572
8573
8574
8575
8576<table><thead>
8577 <tr>
8578 <th>Option</th>
8579 <th>Type</th>
8580 <th>Default</th>
8581 <th>Description</th>
8582 </tr>
8583 </thead><tbody>
8584 <tr id='path-interactive'>
8585 <td><code><b>interactive</b></code></td>
8586 <td><code>Boolean</code></td>
8587 <td><code>true</code></td>
8588 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
8589 </tr>
8590</tbody></table>
8591
8592</section></div>
8593 </div>
8594</div>
8595
8596<div class='accordion'>
8597 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
8598 <div class='accordion-overflow'>
8599 <div class='accordion-content'><section >
8600
8601
8602
8603
8604<table><thead>
8605 <tr>
8606 <th>Option</th>
8607 <th>Type</th>
8608 <th>Default</th>
8609 <th>Description</th>
8610 </tr>
8611 </thead><tbody>
8612 <tr id='path-pane'>
8613 <td><code><b>pane</b></code></td>
8614 <td><code>String</code></td>
8615 <td><code>&#x27;overlayPane&#x27;</code></td>
8616 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
8617 </tr>
8618 <tr id='path-attribution'>
8619 <td><code><b>attribution</b></code></td>
8620 <td><code>String</code></td>
8621 <td><code>null</code></td>
8622 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
8623 </tr>
8624</tbody></table>
8625
8626</section></div>
8627 </div>
8628</div>
8629
8630</section><section>
8631<h3 id=''>Events</h3>
8632
8633
8634
8635
8636<div class='accordion'>
8637 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
8638 <div class='accordion-overflow'>
8639 <div class='accordion-content'><section >
8640
8641
8642
8643
8644<table><thead>
8645 <tr>
8646 <th>Event</th>
8647 <th>Data</th>
8648 <th>Description</th>
8649 </tr>
8650 </thead><tbody>
8651 <tr id='path-click'>
8652 <td><code><b>click</b></code></td>
8653 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8654 <td>Fired when the user clicks (or taps) the layer.</td>
8655 </tr>
8656 <tr id='path-dblclick'>
8657 <td><code><b>dblclick</b></code></td>
8658 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8659 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
8660 </tr>
8661 <tr id='path-mousedown'>
8662 <td><code><b>mousedown</b></code></td>
8663 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8664 <td>Fired when the user pushes the mouse button on the layer.</td>
8665 </tr>
8666 <tr id='path-mouseup'>
8667 <td><code><b>mouseup</b></code></td>
8668 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8669 <td>Fired when the user releases the mouse button pushed on the layer.</td>
8670 </tr>
8671 <tr id='path-mouseover'>
8672 <td><code><b>mouseover</b></code></td>
8673 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8674 <td>Fired when the mouse enters the layer.</td>
8675 </tr>
8676 <tr id='path-mouseout'>
8677 <td><code><b>mouseout</b></code></td>
8678 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8679 <td>Fired when the mouse leaves the layer.</td>
8680 </tr>
8681 <tr id='path-contextmenu'>
8682 <td><code><b>contextmenu</b></code></td>
8683 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
8684 <td>Fired when the user right-clicks on the layer, prevents
8685default browser context menu from showing if there are listeners on
8686this event. Also fired on mobile when the user holds a single touch
8687for a second (also called long press).</td>
8688 </tr>
8689</tbody></table>
8690
8691</section></div>
8692 </div>
8693</div>
8694
8695<div class='accordion'>
8696 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
8697 <div class='accordion-overflow'>
8698 <div class='accordion-content'><section >
8699
8700
8701
8702
8703<table><thead>
8704 <tr>
8705 <th>Event</th>
8706 <th>Data</th>
8707 <th>Description</th>
8708 </tr>
8709 </thead><tbody>
8710 <tr id='path-add'>
8711 <td><code><b>add</b></code></td>
8712 <td><code><a href='#event'>Event</a></code></td>
8713 <td>Fired after the layer is added to a map</td>
8714 </tr>
8715 <tr id='path-remove'>
8716 <td><code><b>remove</b></code></td>
8717 <td><code><a href='#event'>Event</a></code></td>
8718 <td>Fired after the layer is removed from a map</td>
8719 </tr>
8720</tbody></table>
8721
8722</section></div>
8723 </div>
8724</div>
8725
8726<div class='accordion'>
8727 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
8728 <div class='accordion-overflow'>
8729 <div class='accordion-content'><section >
8730
8731
8732
8733
8734<table><thead>
8735 <tr>
8736 <th>Event</th>
8737 <th>Data</th>
8738 <th>Description</th>
8739 </tr>
8740 </thead><tbody>
8741 <tr id='path-popupopen'>
8742 <td><code><b>popupopen</b></code></td>
8743 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
8744 <td>Fired when a popup bound to this layer is opened</td>
8745 </tr>
8746 <tr id='path-popupclose'>
8747 <td><code><b>popupclose</b></code></td>
8748 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
8749 <td>Fired when a popup bound to this layer is closed</td>
8750 </tr>
8751</tbody></table>
8752
8753</section></div>
8754 </div>
8755</div>
8756
8757<div class='accordion'>
8758 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
8759 <div class='accordion-overflow'>
8760 <div class='accordion-content'><section >
8761
8762
8763
8764
8765<table><thead>
8766 <tr>
8767 <th>Event</th>
8768 <th>Data</th>
8769 <th>Description</th>
8770 </tr>
8771 </thead><tbody>
8772 <tr id='path-tooltipopen'>
8773 <td><code><b>tooltipopen</b></code></td>
8774 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
8775 <td>Fired when a tooltip bound to this layer is opened.</td>
8776 </tr>
8777 <tr id='path-tooltipclose'>
8778 <td><code><b>tooltipclose</b></code></td>
8779 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
8780 <td>Fired when a tooltip bound to this layer is closed.</td>
8781 </tr>
8782</tbody></table>
8783
8784</section></div>
8785 </div>
8786</div>
8787
8788</section><section>
8789<h3 id='path-method'>Methods</h3>
8790
8791<section >
8792
8793
8794
8795
8796<table><thead>
8797 <tr>
8798 <th>Method</th>
8799 <th>Returns</th>
8800 <th>Description</th>
8801 </tr>
8802 </thead><tbody>
8803 <tr id='path-redraw'>
8804 <td><code><b>redraw</b>()</code></td>
8805 <td><code>this</code></td>
8806 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
8807</td>
8808 </tr>
8809 <tr id='path-setstyle'>
8810 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
8811 <td><code>this</code></td>
8812 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
8813</td>
8814 </tr>
8815 <tr id='path-bringtofront'>
8816 <td><code><b>bringToFront</b>()</code></td>
8817 <td><code>this</code></td>
8818 <td><p>Brings the layer to the top of all path layers.</p>
8819</td>
8820 </tr>
8821 <tr id='path-bringtoback'>
8822 <td><code><b>bringToBack</b>()</code></td>
8823 <td><code>this</code></td>
8824 <td><p>Brings the layer to the bottom of all path layers.</p>
8825</td>
8826 </tr>
8827</tbody></table>
8828
8829</section>
8830
8831
8832<div class='accordion'>
8833 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
8834 <div class='accordion-overflow'>
8835 <div class='accordion-content'><section >
8836
8837
8838
8839
8840<table><thead>
8841 <tr>
8842 <th>Method</th>
8843 <th>Returns</th>
8844 <th>Description</th>
8845 </tr>
8846 </thead><tbody>
8847 <tr id='path-addto'>
8848 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
8849 <td><code>this</code></td>
8850 <td><p>Adds the layer to the given map or layer group.</p>
8851</td>
8852 </tr>
8853 <tr id='path-remove'>
8854 <td><code><b>remove</b>()</code></td>
8855 <td><code>this</code></td>
8856 <td><p>Removes the layer from the map it is currently active on.</p>
8857</td>
8858 </tr>
8859 <tr id='path-removefrom'>
8860 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
8861 <td><code>this</code></td>
8862 <td><p>Removes the layer from the given map</p>
8863</td>
8864 </tr>
8865 <tr id='path-removefrom'>
8866 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
8867 <td><code>this</code></td>
8868 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
8869</td>
8870 </tr>
8871 <tr id='path-getpane'>
8872 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
8873 <td><code>HTMLElement</code></td>
8874 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
8875</td>
8876 </tr>
8877 <tr id='path-getattribution'>
8878 <td><code><b>getAttribution</b>()</code></td>
8879 <td><code>String</code></td>
8880 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
8881</td>
8882 </tr>
8883</tbody></table>
8884
8885</section></div>
8886 </div>
8887</div>
8888
8889<div class='accordion'>
8890 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
8891 <div class='accordion-overflow'>
8892 <div class='accordion-content'><section >
8893
8894
8895
8896
8897<table><thead>
8898 <tr>
8899 <th>Method</th>
8900 <th>Returns</th>
8901 <th>Description</th>
8902 </tr>
8903 </thead><tbody>
8904 <tr id='path-bindpopup'>
8905 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
8906 <td><code>this</code></td>
8907 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
8908necessary event listeners. If a <code>Function</code> is passed it will receive
8909the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
8910</td>
8911 </tr>
8912 <tr id='path-unbindpopup'>
8913 <td><code><b>unbindPopup</b>()</code></td>
8914 <td><code>this</code></td>
8915 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
8916</td>
8917 </tr>
8918 <tr id='path-openpopup'>
8919 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
8920 <td><code>this</code></td>
8921 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
8922</td>
8923 </tr>
8924 <tr id='path-closepopup'>
8925 <td><code><b>closePopup</b>()</code></td>
8926 <td><code>this</code></td>
8927 <td><p>Closes the popup bound to this layer if it is open.</p>
8928</td>
8929 </tr>
8930 <tr id='path-togglepopup'>
8931 <td><code><b>togglePopup</b>()</code></td>
8932 <td><code>this</code></td>
8933 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
8934</td>
8935 </tr>
8936 <tr id='path-ispopupopen'>
8937 <td><code><b>isPopupOpen</b>()</code></td>
8938 <td><code>boolean</code></td>
8939 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
8940</td>
8941 </tr>
8942 <tr id='path-setpopupcontent'>
8943 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
8944 <td><code>this</code></td>
8945 <td><p>Sets the content of the popup bound to this layer.</p>
8946</td>
8947 </tr>
8948 <tr id='path-getpopup'>
8949 <td><code><b>getPopup</b>()</code></td>
8950 <td><code><a href='#popup'>Popup</a></code></td>
8951 <td><p>Returns the popup bound to this layer.</p>
8952</td>
8953 </tr>
8954</tbody></table>
8955
8956</section></div>
8957 </div>
8958</div>
8959
8960<div class='accordion'>
8961 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
8962 <div class='accordion-overflow'>
8963 <div class='accordion-content'><section >
8964
8965
8966
8967
8968<table><thead>
8969 <tr>
8970 <th>Method</th>
8971 <th>Returns</th>
8972 <th>Description</th>
8973 </tr>
8974 </thead><tbody>
8975 <tr id='path-bindtooltip'>
8976 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
8977 <td><code>this</code></td>
8978 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
8979necessary event listeners. If a <code>Function</code> is passed it will receive
8980the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
8981</td>
8982 </tr>
8983 <tr id='path-unbindtooltip'>
8984 <td><code><b>unbindTooltip</b>()</code></td>
8985 <td><code>this</code></td>
8986 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
8987</td>
8988 </tr>
8989 <tr id='path-opentooltip'>
8990 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
8991 <td><code>this</code></td>
8992 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
8993</td>
8994 </tr>
8995 <tr id='path-closetooltip'>
8996 <td><code><b>closeTooltip</b>()</code></td>
8997 <td><code>this</code></td>
8998 <td><p>Closes the tooltip bound to this layer if it is open.</p>
8999</td>
9000 </tr>
9001 <tr id='path-toggletooltip'>
9002 <td><code><b>toggleTooltip</b>()</code></td>
9003 <td><code>this</code></td>
9004 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
9005</td>
9006 </tr>
9007 <tr id='path-istooltipopen'>
9008 <td><code><b>isTooltipOpen</b>()</code></td>
9009 <td><code>boolean</code></td>
9010 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
9011</td>
9012 </tr>
9013 <tr id='path-settooltipcontent'>
9014 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
9015 <td><code>this</code></td>
9016 <td><p>Sets the content of the tooltip bound to this layer.</p>
9017</td>
9018 </tr>
9019 <tr id='path-gettooltip'>
9020 <td><code><b>getTooltip</b>()</code></td>
9021 <td><code><a href='#tooltip'>Tooltip</a></code></td>
9022 <td><p>Returns the tooltip bound to this layer.</p>
9023</td>
9024 </tr>
9025</tbody></table>
9026
9027</section></div>
9028 </div>
9029</div>
9030
9031<div class='accordion'>
9032 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
9033 <div class='accordion-overflow'>
9034 <div class='accordion-content'><section >
9035
9036
9037
9038
9039<table><thead>
9040 <tr>
9041 <th>Method</th>
9042 <th>Returns</th>
9043 <th>Description</th>
9044 </tr>
9045 </thead><tbody>
9046 <tr id='path-on'>
9047 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
9048 <td><code>this</code></td>
9049 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
9050</td>
9051 </tr>
9052 <tr id='path-on'>
9053 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
9054 <td><code>this</code></td>
9055 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
9056</td>
9057 </tr>
9058 <tr id='path-off'>
9059 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
9060 <td><code>this</code></td>
9061 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
9062</td>
9063 </tr>
9064 <tr id='path-off'>
9065 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
9066 <td><code>this</code></td>
9067 <td><p>Removes a set of type/listener pairs.</p>
9068</td>
9069 </tr>
9070 <tr id='path-off'>
9071 <td><code><b>off</b>()</code></td>
9072 <td><code>this</code></td>
9073 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
9074</td>
9075 </tr>
9076 <tr id='path-fire'>
9077 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
9078 <td><code>this</code></td>
9079 <td><p>Fires an event of the specified type. You can optionally provide an data
9080object — the first argument of the listener function will contain its
9081properties. The event can optionally be propagated to event parents.</p>
9082</td>
9083 </tr>
9084 <tr id='path-listens'>
9085 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
9086 <td><code>Boolean</code></td>
9087 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
9088</td>
9089 </tr>
9090 <tr id='path-once'>
9091 <td><code><b>once</b>(<i></i>)</code></td>
9092 <td><code>this</code></td>
9093 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
9094</td>
9095 </tr>
9096 <tr id='path-addeventparent'>
9097 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
9098 <td><code>this</code></td>
9099 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
9100</td>
9101 </tr>
9102 <tr id='path-removeeventparent'>
9103 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
9104 <td><code>this</code></td>
9105 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
9106</td>
9107 </tr>
9108 <tr id='path-addeventlistener'>
9109 <td><code><b>addEventListener</b>(<i></i>)</code></td>
9110 <td><code>this</code></td>
9111 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
9112</td>
9113 </tr>
9114 <tr id='path-removeeventlistener'>
9115 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
9116 <td><code>this</code></td>
9117 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
9118</td>
9119 </tr>
9120 <tr id='path-clearalleventlisteners'>
9121 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
9122 <td><code>this</code></td>
9123 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
9124</td>
9125 </tr>
9126 <tr id='path-addonetimeeventlistener'>
9127 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
9128 <td><code>this</code></td>
9129 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
9130</td>
9131 </tr>
9132 <tr id='path-fireevent'>
9133 <td><code><b>fireEvent</b>(<i></i>)</code></td>
9134 <td><code>this</code></td>
9135 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
9136</td>
9137 </tr>
9138 <tr id='path-haseventlisteners'>
9139 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
9140 <td><code>Boolean</code></td>
9141 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
9142</td>
9143 </tr>
9144</tbody></table>
9145
9146</section></div>
9147 </div>
9148</div>
9149
9150</section><h2 id='polyline'>Polyline</h2><p>A class for drawing polyline overlays on a map. Extends <a href="#path"><code>Path</code></a>.</p>
9151
9152<section>
9153<h3 id='polyline-example'>Usage example</h3>
9154
9155<section >
9156
9157
9158
9159
9160
9161<pre><code class="lang-js">// create a red polyline from an array of LatLng points
9162var latlngs = [
9163 [45.51, -122.68],
9164 [37.77, -122.43],
9165 [34.04, -118.2]
9166];
9167var polyline = L.polyline(latlngs, {color: &#39;red&#39;}).addTo(map);
9168// zoom the map to the polyline
9169map.fitBounds(polyline.getBounds());
9170</code></pre>
9171<p>You can also pass a multi-dimensional array to represent a <code>MultiPolyline</code> shape:</p>
9172<pre><code class="lang-js">// create a red polyline from an array of arrays of LatLng points
9173var latlngs = [
9174 [[45.51, -122.68],
9175 [37.77, -122.43],
9176 [34.04, -118.2]],
9177 [[40.78, -73.91],
9178 [41.83, -87.62],
9179 [32.76, -96.72]]
9180];
9181</code></pre>
9182
9183
9184
9185</section>
9186
9187
9188</section><section>
9189<h3 id='polyline-factory'>Creation</h3>
9190
9191<section >
9192
9193
9194
9195
9196<table><thead>
9197 <tr>
9198 <th>Factory</th>
9199 <th>Description</th>
9200 </tr>
9201 </thead><tbody>
9202 <tr id='polyline-l-polyline'>
9203 <td><code><b>L.polyline</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>, <nobr>&lt;<a href='#polyline-option'>Polyline options</a>&gt;</nobr> <i>options?</i>)</code></td>
9204 <td>Instantiates a polyline object given an array of geographical points and
9205optionally an options object. You can create a <a href="#polyline"><code>Polyline</code></a> object with
9206multiple separate lines (<code>MultiPolyline</code>) by passing an array of arrays
9207of geographic points.</td>
9208 </tr>
9209</tbody></table>
9210
9211</section>
9212
9213
9214</section><section>
9215<h3 id='polyline-option'>Options</h3>
9216
9217<section >
9218
9219
9220
9221
9222<table><thead>
9223 <tr>
9224 <th>Option</th>
9225 <th>Type</th>
9226 <th>Default</th>
9227 <th>Description</th>
9228 </tr>
9229 </thead><tbody>
9230 <tr id='polyline-smoothfactor'>
9231 <td><code><b>smoothFactor</b></code></td>
9232 <td><code>Number</code></td>
9233 <td><code>1.0</code></td>
9234 <td>How much to simplify the polyline on each zoom level. More means
9235better performance and smoother look, and less means more accurate representation.</td>
9236 </tr>
9237 <tr id='polyline-noclip'>
9238 <td><code><b>noClip</b></code></td>
9239 <td><code>Boolean</code></td>
9240 <td><code>false</code></td>
9241 <td>Disable polyline clipping.</td>
9242 </tr>
9243</tbody></table>
9244
9245</section>
9246
9247
9248<div class='accordion'>
9249 <label><span class='expander'></span> Options inherited from <a href='#path'>Path</a></label>
9250 <div class='accordion-overflow'>
9251 <div class='accordion-content'><section >
9252
9253
9254
9255
9256<table><thead>
9257 <tr>
9258 <th>Option</th>
9259 <th>Type</th>
9260 <th>Default</th>
9261 <th>Description</th>
9262 </tr>
9263 </thead><tbody>
9264 <tr id='polyline-stroke'>
9265 <td><code><b>stroke</b></code></td>
9266 <td><code>Boolean</code></td>
9267 <td><code>true</code></td>
9268 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
9269 </tr>
9270 <tr id='polyline-color'>
9271 <td><code><b>color</b></code></td>
9272 <td><code>String</code></td>
9273 <td><code>&#x27;#3388ff&#x27;</code></td>
9274 <td>Stroke color</td>
9275 </tr>
9276 <tr id='polyline-weight'>
9277 <td><code><b>weight</b></code></td>
9278 <td><code>Number</code></td>
9279 <td><code>3</code></td>
9280 <td>Stroke width in pixels</td>
9281 </tr>
9282 <tr id='polyline-opacity'>
9283 <td><code><b>opacity</b></code></td>
9284 <td><code>Number</code></td>
9285 <td><code>1.0</code></td>
9286 <td>Stroke opacity</td>
9287 </tr>
9288 <tr id='polyline-linecap'>
9289 <td><code><b>lineCap</b></code></td>
9290 <td><code>String</code></td>
9291 <td><code>&#x27;round&#x27;</code></td>
9292 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
9293 </tr>
9294 <tr id='polyline-linejoin'>
9295 <td><code><b>lineJoin</b></code></td>
9296 <td><code>String</code></td>
9297 <td><code>&#x27;round&#x27;</code></td>
9298 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
9299 </tr>
9300 <tr id='polyline-dasharray'>
9301 <td><code><b>dashArray</b></code></td>
9302 <td><code>String</code></td>
9303 <td><code>null</code></td>
9304 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
9305 </tr>
9306 <tr id='polyline-dashoffset'>
9307 <td><code><b>dashOffset</b></code></td>
9308 <td><code>String</code></td>
9309 <td><code>null</code></td>
9310 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
9311 </tr>
9312 <tr id='polyline-fill'>
9313 <td><code><b>fill</b></code></td>
9314 <td><code>Boolean</code></td>
9315 <td><code>depends</code></td>
9316 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
9317 </tr>
9318 <tr id='polyline-fillcolor'>
9319 <td><code><b>fillColor</b></code></td>
9320 <td><code>String</code></td>
9321 <td><code>*</code></td>
9322 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
9323 </tr>
9324 <tr id='polyline-fillopacity'>
9325 <td><code><b>fillOpacity</b></code></td>
9326 <td><code>Number</code></td>
9327 <td><code>0.2</code></td>
9328 <td>Fill opacity.</td>
9329 </tr>
9330 <tr id='polyline-fillrule'>
9331 <td><code><b>fillRule</b></code></td>
9332 <td><code>String</code></td>
9333 <td><code>&#x27;evenodd&#x27;</code></td>
9334 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
9335 </tr>
9336 <tr id='polyline-bubblingmouseevents'>
9337 <td><code><b>bubblingMouseEvents</b></code></td>
9338 <td><code>Boolean</code></td>
9339 <td><code>true</code></td>
9340 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
9341(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
9342 </tr>
9343 <tr id='polyline-renderer'>
9344 <td><code><b>renderer</b></code></td>
9345 <td><code><a href='#renderer'>Renderer</a></code></td>
9346 <td><code></code></td>
9347 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
9348precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
9349 </tr>
9350 <tr id='polyline-classname'>
9351 <td><code><b>className</b></code></td>
9352 <td><code>String</code></td>
9353 <td><code>null</code></td>
9354 <td>Custom class name set on an element. Only for SVG renderer.</td>
9355 </tr>
9356</tbody></table>
9357
9358</section></div>
9359 </div>
9360</div>
9361
9362<div class='accordion'>
9363 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
9364 <div class='accordion-overflow'>
9365 <div class='accordion-content'><section >
9366
9367
9368
9369
9370<table><thead>
9371 <tr>
9372 <th>Option</th>
9373 <th>Type</th>
9374 <th>Default</th>
9375 <th>Description</th>
9376 </tr>
9377 </thead><tbody>
9378 <tr id='polyline-interactive'>
9379 <td><code><b>interactive</b></code></td>
9380 <td><code>Boolean</code></td>
9381 <td><code>true</code></td>
9382 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
9383 </tr>
9384</tbody></table>
9385
9386</section></div>
9387 </div>
9388</div>
9389
9390<div class='accordion'>
9391 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
9392 <div class='accordion-overflow'>
9393 <div class='accordion-content'><section >
9394
9395
9396
9397
9398<table><thead>
9399 <tr>
9400 <th>Option</th>
9401 <th>Type</th>
9402 <th>Default</th>
9403 <th>Description</th>
9404 </tr>
9405 </thead><tbody>
9406 <tr id='polyline-pane'>
9407 <td><code><b>pane</b></code></td>
9408 <td><code>String</code></td>
9409 <td><code>&#x27;overlayPane&#x27;</code></td>
9410 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
9411 </tr>
9412 <tr id='polyline-attribution'>
9413 <td><code><b>attribution</b></code></td>
9414 <td><code>String</code></td>
9415 <td><code>null</code></td>
9416 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
9417 </tr>
9418</tbody></table>
9419
9420</section></div>
9421 </div>
9422</div>
9423
9424</section><section>
9425<h3 id=''>Events</h3>
9426
9427
9428
9429
9430<div class='accordion'>
9431 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
9432 <div class='accordion-overflow'>
9433 <div class='accordion-content'><section >
9434
9435
9436
9437
9438<table><thead>
9439 <tr>
9440 <th>Event</th>
9441 <th>Data</th>
9442 <th>Description</th>
9443 </tr>
9444 </thead><tbody>
9445 <tr id='polyline-click'>
9446 <td><code><b>click</b></code></td>
9447 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9448 <td>Fired when the user clicks (or taps) the layer.</td>
9449 </tr>
9450 <tr id='polyline-dblclick'>
9451 <td><code><b>dblclick</b></code></td>
9452 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9453 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
9454 </tr>
9455 <tr id='polyline-mousedown'>
9456 <td><code><b>mousedown</b></code></td>
9457 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9458 <td>Fired when the user pushes the mouse button on the layer.</td>
9459 </tr>
9460 <tr id='polyline-mouseup'>
9461 <td><code><b>mouseup</b></code></td>
9462 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9463 <td>Fired when the user releases the mouse button pushed on the layer.</td>
9464 </tr>
9465 <tr id='polyline-mouseover'>
9466 <td><code><b>mouseover</b></code></td>
9467 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9468 <td>Fired when the mouse enters the layer.</td>
9469 </tr>
9470 <tr id='polyline-mouseout'>
9471 <td><code><b>mouseout</b></code></td>
9472 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9473 <td>Fired when the mouse leaves the layer.</td>
9474 </tr>
9475 <tr id='polyline-contextmenu'>
9476 <td><code><b>contextmenu</b></code></td>
9477 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
9478 <td>Fired when the user right-clicks on the layer, prevents
9479default browser context menu from showing if there are listeners on
9480this event. Also fired on mobile when the user holds a single touch
9481for a second (also called long press).</td>
9482 </tr>
9483</tbody></table>
9484
9485</section></div>
9486 </div>
9487</div>
9488
9489<div class='accordion'>
9490 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
9491 <div class='accordion-overflow'>
9492 <div class='accordion-content'><section >
9493
9494
9495
9496
9497<table><thead>
9498 <tr>
9499 <th>Event</th>
9500 <th>Data</th>
9501 <th>Description</th>
9502 </tr>
9503 </thead><tbody>
9504 <tr id='polyline-add'>
9505 <td><code><b>add</b></code></td>
9506 <td><code><a href='#event'>Event</a></code></td>
9507 <td>Fired after the layer is added to a map</td>
9508 </tr>
9509 <tr id='polyline-remove'>
9510 <td><code><b>remove</b></code></td>
9511 <td><code><a href='#event'>Event</a></code></td>
9512 <td>Fired after the layer is removed from a map</td>
9513 </tr>
9514</tbody></table>
9515
9516</section></div>
9517 </div>
9518</div>
9519
9520<div class='accordion'>
9521 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
9522 <div class='accordion-overflow'>
9523 <div class='accordion-content'><section >
9524
9525
9526
9527
9528<table><thead>
9529 <tr>
9530 <th>Event</th>
9531 <th>Data</th>
9532 <th>Description</th>
9533 </tr>
9534 </thead><tbody>
9535 <tr id='polyline-popupopen'>
9536 <td><code><b>popupopen</b></code></td>
9537 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
9538 <td>Fired when a popup bound to this layer is opened</td>
9539 </tr>
9540 <tr id='polyline-popupclose'>
9541 <td><code><b>popupclose</b></code></td>
9542 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
9543 <td>Fired when a popup bound to this layer is closed</td>
9544 </tr>
9545</tbody></table>
9546
9547</section></div>
9548 </div>
9549</div>
9550
9551<div class='accordion'>
9552 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
9553 <div class='accordion-overflow'>
9554 <div class='accordion-content'><section >
9555
9556
9557
9558
9559<table><thead>
9560 <tr>
9561 <th>Event</th>
9562 <th>Data</th>
9563 <th>Description</th>
9564 </tr>
9565 </thead><tbody>
9566 <tr id='polyline-tooltipopen'>
9567 <td><code><b>tooltipopen</b></code></td>
9568 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
9569 <td>Fired when a tooltip bound to this layer is opened.</td>
9570 </tr>
9571 <tr id='polyline-tooltipclose'>
9572 <td><code><b>tooltipclose</b></code></td>
9573 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
9574 <td>Fired when a tooltip bound to this layer is closed.</td>
9575 </tr>
9576</tbody></table>
9577
9578</section></div>
9579 </div>
9580</div>
9581
9582</section><section>
9583<h3 id='polyline-method'>Methods</h3>
9584
9585<section >
9586
9587
9588
9589
9590<table><thead>
9591 <tr>
9592 <th>Method</th>
9593 <th>Returns</th>
9594 <th>Description</th>
9595 </tr>
9596 </thead><tbody>
9597 <tr id='polyline-togeojson'>
9598 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
9599 <td><code>Object</code></td>
9600 <td><p><code>precision</code> is the number of decimal places for coordinates.
9601The default value is 6 places.
9602Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the polyline (as a GeoJSON <code>LineString</code> or <code>MultiLineString</code> Feature).</p>
9603</td>
9604 </tr>
9605 <tr id='polyline-getlatlngs'>
9606 <td><code><b>getLatLngs</b>()</code></td>
9607 <td><code>LatLng[]</code></td>
9608 <td><p>Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.</p>
9609</td>
9610 </tr>
9611 <tr id='polyline-setlatlngs'>
9612 <td><code><b>setLatLngs</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>)</code></td>
9613 <td><code>this</code></td>
9614 <td><p>Replaces all the points in the polyline with the given array of geographical points.</p>
9615</td>
9616 </tr>
9617 <tr id='polyline-isempty'>
9618 <td><code><b>isEmpty</b>()</code></td>
9619 <td><code>Boolean</code></td>
9620 <td><p>Returns <code>true</code> if the Polyline has no LatLngs.</p>
9621</td>
9622 </tr>
9623 <tr id='polyline-closestlayerpoint'>
9624 <td><code><b>closestLayerPoint</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p</i>)</code></td>
9625 <td><code><a href='#point'>Point</a></code></td>
9626 <td><p>Returns the point closest to <code>p</code> on the Polyline.</p>
9627</td>
9628 </tr>
9629 <tr id='polyline-getcenter'>
9630 <td><code><b>getCenter</b>()</code></td>
9631 <td><code><a href='#latlng'>LatLng</a></code></td>
9632 <td><p>Returns the center (<a href="http://en.wikipedia.org/wiki/Centroid">centroid</a>) of the polyline.</p>
9633</td>
9634 </tr>
9635 <tr id='polyline-getbounds'>
9636 <td><code><b>getBounds</b>()</code></td>
9637 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
9638 <td><p>Returns the <a href="#latlngbounds"><code>LatLngBounds</code></a> of the path.</p>
9639</td>
9640 </tr>
9641 <tr id='polyline-addlatlng'>
9642 <td><code><b>addLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs?</i>)</code></td>
9643 <td><code>this</code></td>
9644 <td><p>Adds a given point to the polyline. By default, adds to the first ring of
9645the polyline in case of a multi-polyline, but can be overridden by passing
9646a specific ring as a LatLng array (that you can earlier access with <a href="#polyline-getlatlngs"><code>getLatLngs</code></a>).</p>
9647</td>
9648 </tr>
9649</tbody></table>
9650
9651</section>
9652
9653
9654<div class='accordion'>
9655 <label><span class='expander'></span> Methods inherited from <a href='#path'>Path</a></label>
9656 <div class='accordion-overflow'>
9657 <div class='accordion-content'><section >
9658
9659
9660
9661
9662<table><thead>
9663 <tr>
9664 <th>Method</th>
9665 <th>Returns</th>
9666 <th>Description</th>
9667 </tr>
9668 </thead><tbody>
9669 <tr id='polyline-redraw'>
9670 <td><code><b>redraw</b>()</code></td>
9671 <td><code>this</code></td>
9672 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
9673</td>
9674 </tr>
9675 <tr id='polyline-setstyle'>
9676 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
9677 <td><code>this</code></td>
9678 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
9679</td>
9680 </tr>
9681 <tr id='polyline-bringtofront'>
9682 <td><code><b>bringToFront</b>()</code></td>
9683 <td><code>this</code></td>
9684 <td><p>Brings the layer to the top of all path layers.</p>
9685</td>
9686 </tr>
9687 <tr id='polyline-bringtoback'>
9688 <td><code><b>bringToBack</b>()</code></td>
9689 <td><code>this</code></td>
9690 <td><p>Brings the layer to the bottom of all path layers.</p>
9691</td>
9692 </tr>
9693</tbody></table>
9694
9695</section></div>
9696 </div>
9697</div>
9698
9699<div class='accordion'>
9700 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
9701 <div class='accordion-overflow'>
9702 <div class='accordion-content'><section >
9703
9704
9705
9706
9707<table><thead>
9708 <tr>
9709 <th>Method</th>
9710 <th>Returns</th>
9711 <th>Description</th>
9712 </tr>
9713 </thead><tbody>
9714 <tr id='polyline-addto'>
9715 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
9716 <td><code>this</code></td>
9717 <td><p>Adds the layer to the given map or layer group.</p>
9718</td>
9719 </tr>
9720 <tr id='polyline-remove'>
9721 <td><code><b>remove</b>()</code></td>
9722 <td><code>this</code></td>
9723 <td><p>Removes the layer from the map it is currently active on.</p>
9724</td>
9725 </tr>
9726 <tr id='polyline-removefrom'>
9727 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
9728 <td><code>this</code></td>
9729 <td><p>Removes the layer from the given map</p>
9730</td>
9731 </tr>
9732 <tr id='polyline-removefrom'>
9733 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
9734 <td><code>this</code></td>
9735 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
9736</td>
9737 </tr>
9738 <tr id='polyline-getpane'>
9739 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
9740 <td><code>HTMLElement</code></td>
9741 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
9742</td>
9743 </tr>
9744 <tr id='polyline-getattribution'>
9745 <td><code><b>getAttribution</b>()</code></td>
9746 <td><code>String</code></td>
9747 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
9748</td>
9749 </tr>
9750</tbody></table>
9751
9752</section></div>
9753 </div>
9754</div>
9755
9756<div class='accordion'>
9757 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
9758 <div class='accordion-overflow'>
9759 <div class='accordion-content'><section >
9760
9761
9762
9763
9764<table><thead>
9765 <tr>
9766 <th>Method</th>
9767 <th>Returns</th>
9768 <th>Description</th>
9769 </tr>
9770 </thead><tbody>
9771 <tr id='polyline-bindpopup'>
9772 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
9773 <td><code>this</code></td>
9774 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
9775necessary event listeners. If a <code>Function</code> is passed it will receive
9776the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
9777</td>
9778 </tr>
9779 <tr id='polyline-unbindpopup'>
9780 <td><code><b>unbindPopup</b>()</code></td>
9781 <td><code>this</code></td>
9782 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
9783</td>
9784 </tr>
9785 <tr id='polyline-openpopup'>
9786 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
9787 <td><code>this</code></td>
9788 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
9789</td>
9790 </tr>
9791 <tr id='polyline-closepopup'>
9792 <td><code><b>closePopup</b>()</code></td>
9793 <td><code>this</code></td>
9794 <td><p>Closes the popup bound to this layer if it is open.</p>
9795</td>
9796 </tr>
9797 <tr id='polyline-togglepopup'>
9798 <td><code><b>togglePopup</b>()</code></td>
9799 <td><code>this</code></td>
9800 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
9801</td>
9802 </tr>
9803 <tr id='polyline-ispopupopen'>
9804 <td><code><b>isPopupOpen</b>()</code></td>
9805 <td><code>boolean</code></td>
9806 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
9807</td>
9808 </tr>
9809 <tr id='polyline-setpopupcontent'>
9810 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
9811 <td><code>this</code></td>
9812 <td><p>Sets the content of the popup bound to this layer.</p>
9813</td>
9814 </tr>
9815 <tr id='polyline-getpopup'>
9816 <td><code><b>getPopup</b>()</code></td>
9817 <td><code><a href='#popup'>Popup</a></code></td>
9818 <td><p>Returns the popup bound to this layer.</p>
9819</td>
9820 </tr>
9821</tbody></table>
9822
9823</section></div>
9824 </div>
9825</div>
9826
9827<div class='accordion'>
9828 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
9829 <div class='accordion-overflow'>
9830 <div class='accordion-content'><section >
9831
9832
9833
9834
9835<table><thead>
9836 <tr>
9837 <th>Method</th>
9838 <th>Returns</th>
9839 <th>Description</th>
9840 </tr>
9841 </thead><tbody>
9842 <tr id='polyline-bindtooltip'>
9843 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
9844 <td><code>this</code></td>
9845 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
9846necessary event listeners. If a <code>Function</code> is passed it will receive
9847the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
9848</td>
9849 </tr>
9850 <tr id='polyline-unbindtooltip'>
9851 <td><code><b>unbindTooltip</b>()</code></td>
9852 <td><code>this</code></td>
9853 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
9854</td>
9855 </tr>
9856 <tr id='polyline-opentooltip'>
9857 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
9858 <td><code>this</code></td>
9859 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
9860</td>
9861 </tr>
9862 <tr id='polyline-closetooltip'>
9863 <td><code><b>closeTooltip</b>()</code></td>
9864 <td><code>this</code></td>
9865 <td><p>Closes the tooltip bound to this layer if it is open.</p>
9866</td>
9867 </tr>
9868 <tr id='polyline-toggletooltip'>
9869 <td><code><b>toggleTooltip</b>()</code></td>
9870 <td><code>this</code></td>
9871 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
9872</td>
9873 </tr>
9874 <tr id='polyline-istooltipopen'>
9875 <td><code><b>isTooltipOpen</b>()</code></td>
9876 <td><code>boolean</code></td>
9877 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
9878</td>
9879 </tr>
9880 <tr id='polyline-settooltipcontent'>
9881 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
9882 <td><code>this</code></td>
9883 <td><p>Sets the content of the tooltip bound to this layer.</p>
9884</td>
9885 </tr>
9886 <tr id='polyline-gettooltip'>
9887 <td><code><b>getTooltip</b>()</code></td>
9888 <td><code><a href='#tooltip'>Tooltip</a></code></td>
9889 <td><p>Returns the tooltip bound to this layer.</p>
9890</td>
9891 </tr>
9892</tbody></table>
9893
9894</section></div>
9895 </div>
9896</div>
9897
9898<div class='accordion'>
9899 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
9900 <div class='accordion-overflow'>
9901 <div class='accordion-content'><section >
9902
9903
9904
9905
9906<table><thead>
9907 <tr>
9908 <th>Method</th>
9909 <th>Returns</th>
9910 <th>Description</th>
9911 </tr>
9912 </thead><tbody>
9913 <tr id='polyline-on'>
9914 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
9915 <td><code>this</code></td>
9916 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
9917</td>
9918 </tr>
9919 <tr id='polyline-on'>
9920 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
9921 <td><code>this</code></td>
9922 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
9923</td>
9924 </tr>
9925 <tr id='polyline-off'>
9926 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
9927 <td><code>this</code></td>
9928 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
9929</td>
9930 </tr>
9931 <tr id='polyline-off'>
9932 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
9933 <td><code>this</code></td>
9934 <td><p>Removes a set of type/listener pairs.</p>
9935</td>
9936 </tr>
9937 <tr id='polyline-off'>
9938 <td><code><b>off</b>()</code></td>
9939 <td><code>this</code></td>
9940 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
9941</td>
9942 </tr>
9943 <tr id='polyline-fire'>
9944 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
9945 <td><code>this</code></td>
9946 <td><p>Fires an event of the specified type. You can optionally provide an data
9947object — the first argument of the listener function will contain its
9948properties. The event can optionally be propagated to event parents.</p>
9949</td>
9950 </tr>
9951 <tr id='polyline-listens'>
9952 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
9953 <td><code>Boolean</code></td>
9954 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
9955</td>
9956 </tr>
9957 <tr id='polyline-once'>
9958 <td><code><b>once</b>(<i></i>)</code></td>
9959 <td><code>this</code></td>
9960 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
9961</td>
9962 </tr>
9963 <tr id='polyline-addeventparent'>
9964 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
9965 <td><code>this</code></td>
9966 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
9967</td>
9968 </tr>
9969 <tr id='polyline-removeeventparent'>
9970 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
9971 <td><code>this</code></td>
9972 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
9973</td>
9974 </tr>
9975 <tr id='polyline-addeventlistener'>
9976 <td><code><b>addEventListener</b>(<i></i>)</code></td>
9977 <td><code>this</code></td>
9978 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
9979</td>
9980 </tr>
9981 <tr id='polyline-removeeventlistener'>
9982 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
9983 <td><code>this</code></td>
9984 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
9985</td>
9986 </tr>
9987 <tr id='polyline-clearalleventlisteners'>
9988 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
9989 <td><code>this</code></td>
9990 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
9991</td>
9992 </tr>
9993 <tr id='polyline-addonetimeeventlistener'>
9994 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
9995 <td><code>this</code></td>
9996 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
9997</td>
9998 </tr>
9999 <tr id='polyline-fireevent'>
10000 <td><code><b>fireEvent</b>(<i></i>)</code></td>
10001 <td><code>this</code></td>
10002 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
10003</td>
10004 </tr>
10005 <tr id='polyline-haseventlisteners'>
10006 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
10007 <td><code>Boolean</code></td>
10008 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
10009</td>
10010 </tr>
10011</tbody></table>
10012
10013</section></div>
10014 </div>
10015</div>
10016
10017</section><h2 id='polygon'>Polygon</h2><p>A class for drawing polygon overlays on a map. Extends <a href="#polyline"><code>Polyline</code></a>.
10018Note that points you pass when creating a polygon shouldn&#39;t have an additional last point equal to the first one — it&#39;s better to filter out such points.</p>
10019
10020<section>
10021<h3 id='polygon-example'>Usage example</h3>
10022
10023<section >
10024
10025
10026
10027
10028
10029<pre><code class="lang-js">// create a red polygon from an array of LatLng points
10030var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];
10031var polygon = L.polygon(latlngs, {color: &#39;red&#39;}).addTo(map);
10032// zoom the map to the polygon
10033map.fitBounds(polygon.getBounds());
10034</code></pre>
10035<p>You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:</p>
10036<pre><code class="lang-js">var latlngs = [
10037 [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
10038 [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
10039];
10040</code></pre>
10041<p>Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.</p>
10042<pre><code class="lang-js">var latlngs = [
10043 [ // first polygon
10044 [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring
10045 [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole
10046 ],
10047 [ // second polygon
10048 [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]
10049 ]
10050];
10051</code></pre>
10052
10053
10054
10055</section>
10056
10057
10058</section><section>
10059<h3 id='polygon-factory'>Creation</h3>
10060
10061<section >
10062
10063
10064
10065
10066<table><thead>
10067 <tr>
10068 <th>Factory</th>
10069 <th>Description</th>
10070 </tr>
10071 </thead><tbody>
10072 <tr id='polygon-l-polygon'>
10073 <td><code><b>L.polygon</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>, <nobr>&lt;<a href='#polyline-option'>Polyline options</a>&gt;</nobr> <i>options?</i>)</code></td>
10074 <td></td>
10075 </tr>
10076</tbody></table>
10077
10078</section>
10079
10080
10081</section><section>
10082<h3 id=''>Options</h3>
10083
10084
10085
10086
10087<div class='accordion'>
10088 <label><span class='expander'></span> Options inherited from <a href='#polyline'>Polyline</a></label>
10089 <div class='accordion-overflow'>
10090 <div class='accordion-content'><section >
10091
10092
10093
10094
10095<table><thead>
10096 <tr>
10097 <th>Option</th>
10098 <th>Type</th>
10099 <th>Default</th>
10100 <th>Description</th>
10101 </tr>
10102 </thead><tbody>
10103 <tr id='polygon-smoothfactor'>
10104 <td><code><b>smoothFactor</b></code></td>
10105 <td><code>Number</code></td>
10106 <td><code>1.0</code></td>
10107 <td>How much to simplify the polyline on each zoom level. More means
10108better performance and smoother look, and less means more accurate representation.</td>
10109 </tr>
10110 <tr id='polygon-noclip'>
10111 <td><code><b>noClip</b></code></td>
10112 <td><code>Boolean</code></td>
10113 <td><code>false</code></td>
10114 <td>Disable polyline clipping.</td>
10115 </tr>
10116</tbody></table>
10117
10118</section></div>
10119 </div>
10120</div>
10121
10122<div class='accordion'>
10123 <label><span class='expander'></span> Options inherited from <a href='#path'>Path</a></label>
10124 <div class='accordion-overflow'>
10125 <div class='accordion-content'><section >
10126
10127
10128
10129
10130<table><thead>
10131 <tr>
10132 <th>Option</th>
10133 <th>Type</th>
10134 <th>Default</th>
10135 <th>Description</th>
10136 </tr>
10137 </thead><tbody>
10138 <tr id='polygon-stroke'>
10139 <td><code><b>stroke</b></code></td>
10140 <td><code>Boolean</code></td>
10141 <td><code>true</code></td>
10142 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
10143 </tr>
10144 <tr id='polygon-color'>
10145 <td><code><b>color</b></code></td>
10146 <td><code>String</code></td>
10147 <td><code>&#x27;#3388ff&#x27;</code></td>
10148 <td>Stroke color</td>
10149 </tr>
10150 <tr id='polygon-weight'>
10151 <td><code><b>weight</b></code></td>
10152 <td><code>Number</code></td>
10153 <td><code>3</code></td>
10154 <td>Stroke width in pixels</td>
10155 </tr>
10156 <tr id='polygon-opacity'>
10157 <td><code><b>opacity</b></code></td>
10158 <td><code>Number</code></td>
10159 <td><code>1.0</code></td>
10160 <td>Stroke opacity</td>
10161 </tr>
10162 <tr id='polygon-linecap'>
10163 <td><code><b>lineCap</b></code></td>
10164 <td><code>String</code></td>
10165 <td><code>&#x27;round&#x27;</code></td>
10166 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
10167 </tr>
10168 <tr id='polygon-linejoin'>
10169 <td><code><b>lineJoin</b></code></td>
10170 <td><code>String</code></td>
10171 <td><code>&#x27;round&#x27;</code></td>
10172 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
10173 </tr>
10174 <tr id='polygon-dasharray'>
10175 <td><code><b>dashArray</b></code></td>
10176 <td><code>String</code></td>
10177 <td><code>null</code></td>
10178 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
10179 </tr>
10180 <tr id='polygon-dashoffset'>
10181 <td><code><b>dashOffset</b></code></td>
10182 <td><code>String</code></td>
10183 <td><code>null</code></td>
10184 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
10185 </tr>
10186 <tr id='polygon-fill'>
10187 <td><code><b>fill</b></code></td>
10188 <td><code>Boolean</code></td>
10189 <td><code>depends</code></td>
10190 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
10191 </tr>
10192 <tr id='polygon-fillcolor'>
10193 <td><code><b>fillColor</b></code></td>
10194 <td><code>String</code></td>
10195 <td><code>*</code></td>
10196 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
10197 </tr>
10198 <tr id='polygon-fillopacity'>
10199 <td><code><b>fillOpacity</b></code></td>
10200 <td><code>Number</code></td>
10201 <td><code>0.2</code></td>
10202 <td>Fill opacity.</td>
10203 </tr>
10204 <tr id='polygon-fillrule'>
10205 <td><code><b>fillRule</b></code></td>
10206 <td><code>String</code></td>
10207 <td><code>&#x27;evenodd&#x27;</code></td>
10208 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
10209 </tr>
10210 <tr id='polygon-bubblingmouseevents'>
10211 <td><code><b>bubblingMouseEvents</b></code></td>
10212 <td><code>Boolean</code></td>
10213 <td><code>true</code></td>
10214 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
10215(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
10216 </tr>
10217 <tr id='polygon-renderer'>
10218 <td><code><b>renderer</b></code></td>
10219 <td><code><a href='#renderer'>Renderer</a></code></td>
10220 <td><code></code></td>
10221 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
10222precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
10223 </tr>
10224 <tr id='polygon-classname'>
10225 <td><code><b>className</b></code></td>
10226 <td><code>String</code></td>
10227 <td><code>null</code></td>
10228 <td>Custom class name set on an element. Only for SVG renderer.</td>
10229 </tr>
10230</tbody></table>
10231
10232</section></div>
10233 </div>
10234</div>
10235
10236<div class='accordion'>
10237 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
10238 <div class='accordion-overflow'>
10239 <div class='accordion-content'><section >
10240
10241
10242
10243
10244<table><thead>
10245 <tr>
10246 <th>Option</th>
10247 <th>Type</th>
10248 <th>Default</th>
10249 <th>Description</th>
10250 </tr>
10251 </thead><tbody>
10252 <tr id='polygon-interactive'>
10253 <td><code><b>interactive</b></code></td>
10254 <td><code>Boolean</code></td>
10255 <td><code>true</code></td>
10256 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
10257 </tr>
10258</tbody></table>
10259
10260</section></div>
10261 </div>
10262</div>
10263
10264<div class='accordion'>
10265 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
10266 <div class='accordion-overflow'>
10267 <div class='accordion-content'><section >
10268
10269
10270
10271
10272<table><thead>
10273 <tr>
10274 <th>Option</th>
10275 <th>Type</th>
10276 <th>Default</th>
10277 <th>Description</th>
10278 </tr>
10279 </thead><tbody>
10280 <tr id='polygon-pane'>
10281 <td><code><b>pane</b></code></td>
10282 <td><code>String</code></td>
10283 <td><code>&#x27;overlayPane&#x27;</code></td>
10284 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
10285 </tr>
10286 <tr id='polygon-attribution'>
10287 <td><code><b>attribution</b></code></td>
10288 <td><code>String</code></td>
10289 <td><code>null</code></td>
10290 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
10291 </tr>
10292</tbody></table>
10293
10294</section></div>
10295 </div>
10296</div>
10297
10298</section><section>
10299<h3 id=''>Events</h3>
10300
10301
10302
10303
10304<div class='accordion'>
10305 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
10306 <div class='accordion-overflow'>
10307 <div class='accordion-content'><section >
10308
10309
10310
10311
10312<table><thead>
10313 <tr>
10314 <th>Event</th>
10315 <th>Data</th>
10316 <th>Description</th>
10317 </tr>
10318 </thead><tbody>
10319 <tr id='polygon-click'>
10320 <td><code><b>click</b></code></td>
10321 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10322 <td>Fired when the user clicks (or taps) the layer.</td>
10323 </tr>
10324 <tr id='polygon-dblclick'>
10325 <td><code><b>dblclick</b></code></td>
10326 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10327 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
10328 </tr>
10329 <tr id='polygon-mousedown'>
10330 <td><code><b>mousedown</b></code></td>
10331 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10332 <td>Fired when the user pushes the mouse button on the layer.</td>
10333 </tr>
10334 <tr id='polygon-mouseup'>
10335 <td><code><b>mouseup</b></code></td>
10336 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10337 <td>Fired when the user releases the mouse button pushed on the layer.</td>
10338 </tr>
10339 <tr id='polygon-mouseover'>
10340 <td><code><b>mouseover</b></code></td>
10341 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10342 <td>Fired when the mouse enters the layer.</td>
10343 </tr>
10344 <tr id='polygon-mouseout'>
10345 <td><code><b>mouseout</b></code></td>
10346 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10347 <td>Fired when the mouse leaves the layer.</td>
10348 </tr>
10349 <tr id='polygon-contextmenu'>
10350 <td><code><b>contextmenu</b></code></td>
10351 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
10352 <td>Fired when the user right-clicks on the layer, prevents
10353default browser context menu from showing if there are listeners on
10354this event. Also fired on mobile when the user holds a single touch
10355for a second (also called long press).</td>
10356 </tr>
10357</tbody></table>
10358
10359</section></div>
10360 </div>
10361</div>
10362
10363<div class='accordion'>
10364 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
10365 <div class='accordion-overflow'>
10366 <div class='accordion-content'><section >
10367
10368
10369
10370
10371<table><thead>
10372 <tr>
10373 <th>Event</th>
10374 <th>Data</th>
10375 <th>Description</th>
10376 </tr>
10377 </thead><tbody>
10378 <tr id='polygon-add'>
10379 <td><code><b>add</b></code></td>
10380 <td><code><a href='#event'>Event</a></code></td>
10381 <td>Fired after the layer is added to a map</td>
10382 </tr>
10383 <tr id='polygon-remove'>
10384 <td><code><b>remove</b></code></td>
10385 <td><code><a href='#event'>Event</a></code></td>
10386 <td>Fired after the layer is removed from a map</td>
10387 </tr>
10388</tbody></table>
10389
10390</section></div>
10391 </div>
10392</div>
10393
10394<div class='accordion'>
10395 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
10396 <div class='accordion-overflow'>
10397 <div class='accordion-content'><section >
10398
10399
10400
10401
10402<table><thead>
10403 <tr>
10404 <th>Event</th>
10405 <th>Data</th>
10406 <th>Description</th>
10407 </tr>
10408 </thead><tbody>
10409 <tr id='polygon-popupopen'>
10410 <td><code><b>popupopen</b></code></td>
10411 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
10412 <td>Fired when a popup bound to this layer is opened</td>
10413 </tr>
10414 <tr id='polygon-popupclose'>
10415 <td><code><b>popupclose</b></code></td>
10416 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
10417 <td>Fired when a popup bound to this layer is closed</td>
10418 </tr>
10419</tbody></table>
10420
10421</section></div>
10422 </div>
10423</div>
10424
10425<div class='accordion'>
10426 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
10427 <div class='accordion-overflow'>
10428 <div class='accordion-content'><section >
10429
10430
10431
10432
10433<table><thead>
10434 <tr>
10435 <th>Event</th>
10436 <th>Data</th>
10437 <th>Description</th>
10438 </tr>
10439 </thead><tbody>
10440 <tr id='polygon-tooltipopen'>
10441 <td><code><b>tooltipopen</b></code></td>
10442 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
10443 <td>Fired when a tooltip bound to this layer is opened.</td>
10444 </tr>
10445 <tr id='polygon-tooltipclose'>
10446 <td><code><b>tooltipclose</b></code></td>
10447 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
10448 <td>Fired when a tooltip bound to this layer is closed.</td>
10449 </tr>
10450</tbody></table>
10451
10452</section></div>
10453 </div>
10454</div>
10455
10456</section><section>
10457<h3 id='polygon-method'>Methods</h3>
10458
10459<section >
10460
10461
10462
10463
10464<table><thead>
10465 <tr>
10466 <th>Method</th>
10467 <th>Returns</th>
10468 <th>Description</th>
10469 </tr>
10470 </thead><tbody>
10471 <tr id='polygon-togeojson'>
10472 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
10473 <td><code>Object</code></td>
10474 <td><p><code>precision</code> is the number of decimal places for coordinates.
10475The default value is 6 places.
10476Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the polygon (as a GeoJSON <a href="#polygon"><code>Polygon</code></a> or <code>MultiPolygon</code> Feature).</p>
10477</td>
10478 </tr>
10479</tbody></table>
10480
10481</section>
10482
10483
10484<div class='accordion'>
10485 <label><span class='expander'></span> Methods inherited from <a href='#polyline'>Polyline</a></label>
10486 <div class='accordion-overflow'>
10487 <div class='accordion-content'><section >
10488
10489
10490
10491
10492<table><thead>
10493 <tr>
10494 <th>Method</th>
10495 <th>Returns</th>
10496 <th>Description</th>
10497 </tr>
10498 </thead><tbody>
10499 <tr id='polygon-getlatlngs'>
10500 <td><code><b>getLatLngs</b>()</code></td>
10501 <td><code>LatLng[]</code></td>
10502 <td><p>Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.</p>
10503</td>
10504 </tr>
10505 <tr id='polygon-setlatlngs'>
10506 <td><code><b>setLatLngs</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>)</code></td>
10507 <td><code>this</code></td>
10508 <td><p>Replaces all the points in the polyline with the given array of geographical points.</p>
10509</td>
10510 </tr>
10511 <tr id='polygon-isempty'>
10512 <td><code><b>isEmpty</b>()</code></td>
10513 <td><code>Boolean</code></td>
10514 <td><p>Returns <code>true</code> if the Polyline has no LatLngs.</p>
10515</td>
10516 </tr>
10517 <tr id='polygon-closestlayerpoint'>
10518 <td><code><b>closestLayerPoint</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p</i>)</code></td>
10519 <td><code><a href='#point'>Point</a></code></td>
10520 <td><p>Returns the point closest to <code>p</code> on the Polyline.</p>
10521</td>
10522 </tr>
10523 <tr id='polygon-getcenter'>
10524 <td><code><b>getCenter</b>()</code></td>
10525 <td><code><a href='#latlng'>LatLng</a></code></td>
10526 <td><p>Returns the center (<a href="http://en.wikipedia.org/wiki/Centroid">centroid</a>) of the polyline.</p>
10527</td>
10528 </tr>
10529 <tr id='polygon-getbounds'>
10530 <td><code><b>getBounds</b>()</code></td>
10531 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
10532 <td><p>Returns the <a href="#latlngbounds"><code>LatLngBounds</code></a> of the path.</p>
10533</td>
10534 </tr>
10535 <tr id='polygon-addlatlng'>
10536 <td><code><b>addLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs?</i>)</code></td>
10537 <td><code>this</code></td>
10538 <td><p>Adds a given point to the polyline. By default, adds to the first ring of
10539the polyline in case of a multi-polyline, but can be overridden by passing
10540a specific ring as a LatLng array (that you can earlier access with <a href="#polyline-getlatlngs"><code>getLatLngs</code></a>).</p>
10541</td>
10542 </tr>
10543</tbody></table>
10544
10545</section></div>
10546 </div>
10547</div>
10548
10549<div class='accordion'>
10550 <label><span class='expander'></span> Methods inherited from <a href='#path'>Path</a></label>
10551 <div class='accordion-overflow'>
10552 <div class='accordion-content'><section >
10553
10554
10555
10556
10557<table><thead>
10558 <tr>
10559 <th>Method</th>
10560 <th>Returns</th>
10561 <th>Description</th>
10562 </tr>
10563 </thead><tbody>
10564 <tr id='polygon-redraw'>
10565 <td><code><b>redraw</b>()</code></td>
10566 <td><code>this</code></td>
10567 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
10568</td>
10569 </tr>
10570 <tr id='polygon-setstyle'>
10571 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
10572 <td><code>this</code></td>
10573 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
10574</td>
10575 </tr>
10576 <tr id='polygon-bringtofront'>
10577 <td><code><b>bringToFront</b>()</code></td>
10578 <td><code>this</code></td>
10579 <td><p>Brings the layer to the top of all path layers.</p>
10580</td>
10581 </tr>
10582 <tr id='polygon-bringtoback'>
10583 <td><code><b>bringToBack</b>()</code></td>
10584 <td><code>this</code></td>
10585 <td><p>Brings the layer to the bottom of all path layers.</p>
10586</td>
10587 </tr>
10588</tbody></table>
10589
10590</section></div>
10591 </div>
10592</div>
10593
10594<div class='accordion'>
10595 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
10596 <div class='accordion-overflow'>
10597 <div class='accordion-content'><section >
10598
10599
10600
10601
10602<table><thead>
10603 <tr>
10604 <th>Method</th>
10605 <th>Returns</th>
10606 <th>Description</th>
10607 </tr>
10608 </thead><tbody>
10609 <tr id='polygon-addto'>
10610 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
10611 <td><code>this</code></td>
10612 <td><p>Adds the layer to the given map or layer group.</p>
10613</td>
10614 </tr>
10615 <tr id='polygon-remove'>
10616 <td><code><b>remove</b>()</code></td>
10617 <td><code>this</code></td>
10618 <td><p>Removes the layer from the map it is currently active on.</p>
10619</td>
10620 </tr>
10621 <tr id='polygon-removefrom'>
10622 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
10623 <td><code>this</code></td>
10624 <td><p>Removes the layer from the given map</p>
10625</td>
10626 </tr>
10627 <tr id='polygon-removefrom'>
10628 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
10629 <td><code>this</code></td>
10630 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
10631</td>
10632 </tr>
10633 <tr id='polygon-getpane'>
10634 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
10635 <td><code>HTMLElement</code></td>
10636 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
10637</td>
10638 </tr>
10639 <tr id='polygon-getattribution'>
10640 <td><code><b>getAttribution</b>()</code></td>
10641 <td><code>String</code></td>
10642 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
10643</td>
10644 </tr>
10645</tbody></table>
10646
10647</section></div>
10648 </div>
10649</div>
10650
10651<div class='accordion'>
10652 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
10653 <div class='accordion-overflow'>
10654 <div class='accordion-content'><section >
10655
10656
10657
10658
10659<table><thead>
10660 <tr>
10661 <th>Method</th>
10662 <th>Returns</th>
10663 <th>Description</th>
10664 </tr>
10665 </thead><tbody>
10666 <tr id='polygon-bindpopup'>
10667 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
10668 <td><code>this</code></td>
10669 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
10670necessary event listeners. If a <code>Function</code> is passed it will receive
10671the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
10672</td>
10673 </tr>
10674 <tr id='polygon-unbindpopup'>
10675 <td><code><b>unbindPopup</b>()</code></td>
10676 <td><code>this</code></td>
10677 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
10678</td>
10679 </tr>
10680 <tr id='polygon-openpopup'>
10681 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
10682 <td><code>this</code></td>
10683 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
10684</td>
10685 </tr>
10686 <tr id='polygon-closepopup'>
10687 <td><code><b>closePopup</b>()</code></td>
10688 <td><code>this</code></td>
10689 <td><p>Closes the popup bound to this layer if it is open.</p>
10690</td>
10691 </tr>
10692 <tr id='polygon-togglepopup'>
10693 <td><code><b>togglePopup</b>()</code></td>
10694 <td><code>this</code></td>
10695 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
10696</td>
10697 </tr>
10698 <tr id='polygon-ispopupopen'>
10699 <td><code><b>isPopupOpen</b>()</code></td>
10700 <td><code>boolean</code></td>
10701 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
10702</td>
10703 </tr>
10704 <tr id='polygon-setpopupcontent'>
10705 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
10706 <td><code>this</code></td>
10707 <td><p>Sets the content of the popup bound to this layer.</p>
10708</td>
10709 </tr>
10710 <tr id='polygon-getpopup'>
10711 <td><code><b>getPopup</b>()</code></td>
10712 <td><code><a href='#popup'>Popup</a></code></td>
10713 <td><p>Returns the popup bound to this layer.</p>
10714</td>
10715 </tr>
10716</tbody></table>
10717
10718</section></div>
10719 </div>
10720</div>
10721
10722<div class='accordion'>
10723 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
10724 <div class='accordion-overflow'>
10725 <div class='accordion-content'><section >
10726
10727
10728
10729
10730<table><thead>
10731 <tr>
10732 <th>Method</th>
10733 <th>Returns</th>
10734 <th>Description</th>
10735 </tr>
10736 </thead><tbody>
10737 <tr id='polygon-bindtooltip'>
10738 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
10739 <td><code>this</code></td>
10740 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
10741necessary event listeners. If a <code>Function</code> is passed it will receive
10742the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
10743</td>
10744 </tr>
10745 <tr id='polygon-unbindtooltip'>
10746 <td><code><b>unbindTooltip</b>()</code></td>
10747 <td><code>this</code></td>
10748 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
10749</td>
10750 </tr>
10751 <tr id='polygon-opentooltip'>
10752 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
10753 <td><code>this</code></td>
10754 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
10755</td>
10756 </tr>
10757 <tr id='polygon-closetooltip'>
10758 <td><code><b>closeTooltip</b>()</code></td>
10759 <td><code>this</code></td>
10760 <td><p>Closes the tooltip bound to this layer if it is open.</p>
10761</td>
10762 </tr>
10763 <tr id='polygon-toggletooltip'>
10764 <td><code><b>toggleTooltip</b>()</code></td>
10765 <td><code>this</code></td>
10766 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
10767</td>
10768 </tr>
10769 <tr id='polygon-istooltipopen'>
10770 <td><code><b>isTooltipOpen</b>()</code></td>
10771 <td><code>boolean</code></td>
10772 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
10773</td>
10774 </tr>
10775 <tr id='polygon-settooltipcontent'>
10776 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
10777 <td><code>this</code></td>
10778 <td><p>Sets the content of the tooltip bound to this layer.</p>
10779</td>
10780 </tr>
10781 <tr id='polygon-gettooltip'>
10782 <td><code><b>getTooltip</b>()</code></td>
10783 <td><code><a href='#tooltip'>Tooltip</a></code></td>
10784 <td><p>Returns the tooltip bound to this layer.</p>
10785</td>
10786 </tr>
10787</tbody></table>
10788
10789</section></div>
10790 </div>
10791</div>
10792
10793<div class='accordion'>
10794 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
10795 <div class='accordion-overflow'>
10796 <div class='accordion-content'><section >
10797
10798
10799
10800
10801<table><thead>
10802 <tr>
10803 <th>Method</th>
10804 <th>Returns</th>
10805 <th>Description</th>
10806 </tr>
10807 </thead><tbody>
10808 <tr id='polygon-on'>
10809 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
10810 <td><code>this</code></td>
10811 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
10812</td>
10813 </tr>
10814 <tr id='polygon-on'>
10815 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
10816 <td><code>this</code></td>
10817 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
10818</td>
10819 </tr>
10820 <tr id='polygon-off'>
10821 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
10822 <td><code>this</code></td>
10823 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
10824</td>
10825 </tr>
10826 <tr id='polygon-off'>
10827 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
10828 <td><code>this</code></td>
10829 <td><p>Removes a set of type/listener pairs.</p>
10830</td>
10831 </tr>
10832 <tr id='polygon-off'>
10833 <td><code><b>off</b>()</code></td>
10834 <td><code>this</code></td>
10835 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
10836</td>
10837 </tr>
10838 <tr id='polygon-fire'>
10839 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
10840 <td><code>this</code></td>
10841 <td><p>Fires an event of the specified type. You can optionally provide an data
10842object — the first argument of the listener function will contain its
10843properties. The event can optionally be propagated to event parents.</p>
10844</td>
10845 </tr>
10846 <tr id='polygon-listens'>
10847 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
10848 <td><code>Boolean</code></td>
10849 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
10850</td>
10851 </tr>
10852 <tr id='polygon-once'>
10853 <td><code><b>once</b>(<i></i>)</code></td>
10854 <td><code>this</code></td>
10855 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
10856</td>
10857 </tr>
10858 <tr id='polygon-addeventparent'>
10859 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
10860 <td><code>this</code></td>
10861 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
10862</td>
10863 </tr>
10864 <tr id='polygon-removeeventparent'>
10865 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
10866 <td><code>this</code></td>
10867 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
10868</td>
10869 </tr>
10870 <tr id='polygon-addeventlistener'>
10871 <td><code><b>addEventListener</b>(<i></i>)</code></td>
10872 <td><code>this</code></td>
10873 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
10874</td>
10875 </tr>
10876 <tr id='polygon-removeeventlistener'>
10877 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
10878 <td><code>this</code></td>
10879 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
10880</td>
10881 </tr>
10882 <tr id='polygon-clearalleventlisteners'>
10883 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
10884 <td><code>this</code></td>
10885 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
10886</td>
10887 </tr>
10888 <tr id='polygon-addonetimeeventlistener'>
10889 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
10890 <td><code>this</code></td>
10891 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
10892</td>
10893 </tr>
10894 <tr id='polygon-fireevent'>
10895 <td><code><b>fireEvent</b>(<i></i>)</code></td>
10896 <td><code>this</code></td>
10897 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
10898</td>
10899 </tr>
10900 <tr id='polygon-haseventlisteners'>
10901 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
10902 <td><code>Boolean</code></td>
10903 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
10904</td>
10905 </tr>
10906</tbody></table>
10907
10908</section></div>
10909 </div>
10910</div>
10911
10912</section><h2 id='rectangle'>Rectangle</h2><p>A class for drawing rectangle overlays on a map. Extends <a href="#polygon"><code>Polygon</code></a>.</p>
10913
10914<section>
10915<h3 id='rectangle-example'>Usage example</h3>
10916
10917<section >
10918
10919
10920
10921
10922
10923<pre><code class="lang-js">// define rectangle geographical bounds
10924var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
10925// create an orange rectangle
10926L.rectangle(bounds, {color: &quot;#ff7800&quot;, weight: 1}).addTo(map);
10927// zoom the map to the rectangle bounds
10928map.fitBounds(bounds);
10929</code></pre>
10930
10931
10932
10933</section>
10934
10935
10936</section><section>
10937<h3 id='rectangle-factory'>Creation</h3>
10938
10939<section >
10940
10941
10942
10943
10944<table><thead>
10945 <tr>
10946 <th>Factory</th>
10947 <th>Description</th>
10948 </tr>
10949 </thead><tbody>
10950 <tr id='rectangle-l-rectangle'>
10951 <td><code><b>L.rectangle</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>latLngBounds</i>, <nobr>&lt;<a href='#polyline-option'>Polyline options</a>&gt;</nobr> <i>options?</i>)</code></td>
10952 <td></td>
10953 </tr>
10954</tbody></table>
10955
10956</section>
10957
10958
10959</section><section>
10960<h3 id=''>Options</h3>
10961
10962
10963
10964
10965<div class='accordion'>
10966 <label><span class='expander'></span> Options inherited from <a href='#polyline'>Polyline</a></label>
10967 <div class='accordion-overflow'>
10968 <div class='accordion-content'><section >
10969
10970
10971
10972
10973<table><thead>
10974 <tr>
10975 <th>Option</th>
10976 <th>Type</th>
10977 <th>Default</th>
10978 <th>Description</th>
10979 </tr>
10980 </thead><tbody>
10981 <tr id='rectangle-smoothfactor'>
10982 <td><code><b>smoothFactor</b></code></td>
10983 <td><code>Number</code></td>
10984 <td><code>1.0</code></td>
10985 <td>How much to simplify the polyline on each zoom level. More means
10986better performance and smoother look, and less means more accurate representation.</td>
10987 </tr>
10988 <tr id='rectangle-noclip'>
10989 <td><code><b>noClip</b></code></td>
10990 <td><code>Boolean</code></td>
10991 <td><code>false</code></td>
10992 <td>Disable polyline clipping.</td>
10993 </tr>
10994</tbody></table>
10995
10996</section></div>
10997 </div>
10998</div>
10999
11000<div class='accordion'>
11001 <label><span class='expander'></span> Options inherited from <a href='#path'>Path</a></label>
11002 <div class='accordion-overflow'>
11003 <div class='accordion-content'><section >
11004
11005
11006
11007
11008<table><thead>
11009 <tr>
11010 <th>Option</th>
11011 <th>Type</th>
11012 <th>Default</th>
11013 <th>Description</th>
11014 </tr>
11015 </thead><tbody>
11016 <tr id='rectangle-stroke'>
11017 <td><code><b>stroke</b></code></td>
11018 <td><code>Boolean</code></td>
11019 <td><code>true</code></td>
11020 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
11021 </tr>
11022 <tr id='rectangle-color'>
11023 <td><code><b>color</b></code></td>
11024 <td><code>String</code></td>
11025 <td><code>&#x27;#3388ff&#x27;</code></td>
11026 <td>Stroke color</td>
11027 </tr>
11028 <tr id='rectangle-weight'>
11029 <td><code><b>weight</b></code></td>
11030 <td><code>Number</code></td>
11031 <td><code>3</code></td>
11032 <td>Stroke width in pixels</td>
11033 </tr>
11034 <tr id='rectangle-opacity'>
11035 <td><code><b>opacity</b></code></td>
11036 <td><code>Number</code></td>
11037 <td><code>1.0</code></td>
11038 <td>Stroke opacity</td>
11039 </tr>
11040 <tr id='rectangle-linecap'>
11041 <td><code><b>lineCap</b></code></td>
11042 <td><code>String</code></td>
11043 <td><code>&#x27;round&#x27;</code></td>
11044 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
11045 </tr>
11046 <tr id='rectangle-linejoin'>
11047 <td><code><b>lineJoin</b></code></td>
11048 <td><code>String</code></td>
11049 <td><code>&#x27;round&#x27;</code></td>
11050 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
11051 </tr>
11052 <tr id='rectangle-dasharray'>
11053 <td><code><b>dashArray</b></code></td>
11054 <td><code>String</code></td>
11055 <td><code>null</code></td>
11056 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
11057 </tr>
11058 <tr id='rectangle-dashoffset'>
11059 <td><code><b>dashOffset</b></code></td>
11060 <td><code>String</code></td>
11061 <td><code>null</code></td>
11062 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
11063 </tr>
11064 <tr id='rectangle-fill'>
11065 <td><code><b>fill</b></code></td>
11066 <td><code>Boolean</code></td>
11067 <td><code>depends</code></td>
11068 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
11069 </tr>
11070 <tr id='rectangle-fillcolor'>
11071 <td><code><b>fillColor</b></code></td>
11072 <td><code>String</code></td>
11073 <td><code>*</code></td>
11074 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
11075 </tr>
11076 <tr id='rectangle-fillopacity'>
11077 <td><code><b>fillOpacity</b></code></td>
11078 <td><code>Number</code></td>
11079 <td><code>0.2</code></td>
11080 <td>Fill opacity.</td>
11081 </tr>
11082 <tr id='rectangle-fillrule'>
11083 <td><code><b>fillRule</b></code></td>
11084 <td><code>String</code></td>
11085 <td><code>&#x27;evenodd&#x27;</code></td>
11086 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
11087 </tr>
11088 <tr id='rectangle-bubblingmouseevents'>
11089 <td><code><b>bubblingMouseEvents</b></code></td>
11090 <td><code>Boolean</code></td>
11091 <td><code>true</code></td>
11092 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
11093(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
11094 </tr>
11095 <tr id='rectangle-renderer'>
11096 <td><code><b>renderer</b></code></td>
11097 <td><code><a href='#renderer'>Renderer</a></code></td>
11098 <td><code></code></td>
11099 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
11100precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
11101 </tr>
11102 <tr id='rectangle-classname'>
11103 <td><code><b>className</b></code></td>
11104 <td><code>String</code></td>
11105 <td><code>null</code></td>
11106 <td>Custom class name set on an element. Only for SVG renderer.</td>
11107 </tr>
11108</tbody></table>
11109
11110</section></div>
11111 </div>
11112</div>
11113
11114<div class='accordion'>
11115 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
11116 <div class='accordion-overflow'>
11117 <div class='accordion-content'><section >
11118
11119
11120
11121
11122<table><thead>
11123 <tr>
11124 <th>Option</th>
11125 <th>Type</th>
11126 <th>Default</th>
11127 <th>Description</th>
11128 </tr>
11129 </thead><tbody>
11130 <tr id='rectangle-interactive'>
11131 <td><code><b>interactive</b></code></td>
11132 <td><code>Boolean</code></td>
11133 <td><code>true</code></td>
11134 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
11135 </tr>
11136</tbody></table>
11137
11138</section></div>
11139 </div>
11140</div>
11141
11142<div class='accordion'>
11143 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
11144 <div class='accordion-overflow'>
11145 <div class='accordion-content'><section >
11146
11147
11148
11149
11150<table><thead>
11151 <tr>
11152 <th>Option</th>
11153 <th>Type</th>
11154 <th>Default</th>
11155 <th>Description</th>
11156 </tr>
11157 </thead><tbody>
11158 <tr id='rectangle-pane'>
11159 <td><code><b>pane</b></code></td>
11160 <td><code>String</code></td>
11161 <td><code>&#x27;overlayPane&#x27;</code></td>
11162 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
11163 </tr>
11164 <tr id='rectangle-attribution'>
11165 <td><code><b>attribution</b></code></td>
11166 <td><code>String</code></td>
11167 <td><code>null</code></td>
11168 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
11169 </tr>
11170</tbody></table>
11171
11172</section></div>
11173 </div>
11174</div>
11175
11176</section><section>
11177<h3 id=''>Events</h3>
11178
11179
11180
11181
11182<div class='accordion'>
11183 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
11184 <div class='accordion-overflow'>
11185 <div class='accordion-content'><section >
11186
11187
11188
11189
11190<table><thead>
11191 <tr>
11192 <th>Event</th>
11193 <th>Data</th>
11194 <th>Description</th>
11195 </tr>
11196 </thead><tbody>
11197 <tr id='rectangle-click'>
11198 <td><code><b>click</b></code></td>
11199 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11200 <td>Fired when the user clicks (or taps) the layer.</td>
11201 </tr>
11202 <tr id='rectangle-dblclick'>
11203 <td><code><b>dblclick</b></code></td>
11204 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11205 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
11206 </tr>
11207 <tr id='rectangle-mousedown'>
11208 <td><code><b>mousedown</b></code></td>
11209 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11210 <td>Fired when the user pushes the mouse button on the layer.</td>
11211 </tr>
11212 <tr id='rectangle-mouseup'>
11213 <td><code><b>mouseup</b></code></td>
11214 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11215 <td>Fired when the user releases the mouse button pushed on the layer.</td>
11216 </tr>
11217 <tr id='rectangle-mouseover'>
11218 <td><code><b>mouseover</b></code></td>
11219 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11220 <td>Fired when the mouse enters the layer.</td>
11221 </tr>
11222 <tr id='rectangle-mouseout'>
11223 <td><code><b>mouseout</b></code></td>
11224 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11225 <td>Fired when the mouse leaves the layer.</td>
11226 </tr>
11227 <tr id='rectangle-contextmenu'>
11228 <td><code><b>contextmenu</b></code></td>
11229 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
11230 <td>Fired when the user right-clicks on the layer, prevents
11231default browser context menu from showing if there are listeners on
11232this event. Also fired on mobile when the user holds a single touch
11233for a second (also called long press).</td>
11234 </tr>
11235</tbody></table>
11236
11237</section></div>
11238 </div>
11239</div>
11240
11241<div class='accordion'>
11242 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
11243 <div class='accordion-overflow'>
11244 <div class='accordion-content'><section >
11245
11246
11247
11248
11249<table><thead>
11250 <tr>
11251 <th>Event</th>
11252 <th>Data</th>
11253 <th>Description</th>
11254 </tr>
11255 </thead><tbody>
11256 <tr id='rectangle-add'>
11257 <td><code><b>add</b></code></td>
11258 <td><code><a href='#event'>Event</a></code></td>
11259 <td>Fired after the layer is added to a map</td>
11260 </tr>
11261 <tr id='rectangle-remove'>
11262 <td><code><b>remove</b></code></td>
11263 <td><code><a href='#event'>Event</a></code></td>
11264 <td>Fired after the layer is removed from a map</td>
11265 </tr>
11266</tbody></table>
11267
11268</section></div>
11269 </div>
11270</div>
11271
11272<div class='accordion'>
11273 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
11274 <div class='accordion-overflow'>
11275 <div class='accordion-content'><section >
11276
11277
11278
11279
11280<table><thead>
11281 <tr>
11282 <th>Event</th>
11283 <th>Data</th>
11284 <th>Description</th>
11285 </tr>
11286 </thead><tbody>
11287 <tr id='rectangle-popupopen'>
11288 <td><code><b>popupopen</b></code></td>
11289 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
11290 <td>Fired when a popup bound to this layer is opened</td>
11291 </tr>
11292 <tr id='rectangle-popupclose'>
11293 <td><code><b>popupclose</b></code></td>
11294 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
11295 <td>Fired when a popup bound to this layer is closed</td>
11296 </tr>
11297</tbody></table>
11298
11299</section></div>
11300 </div>
11301</div>
11302
11303<div class='accordion'>
11304 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
11305 <div class='accordion-overflow'>
11306 <div class='accordion-content'><section >
11307
11308
11309
11310
11311<table><thead>
11312 <tr>
11313 <th>Event</th>
11314 <th>Data</th>
11315 <th>Description</th>
11316 </tr>
11317 </thead><tbody>
11318 <tr id='rectangle-tooltipopen'>
11319 <td><code><b>tooltipopen</b></code></td>
11320 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
11321 <td>Fired when a tooltip bound to this layer is opened.</td>
11322 </tr>
11323 <tr id='rectangle-tooltipclose'>
11324 <td><code><b>tooltipclose</b></code></td>
11325 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
11326 <td>Fired when a tooltip bound to this layer is closed.</td>
11327 </tr>
11328</tbody></table>
11329
11330</section></div>
11331 </div>
11332</div>
11333
11334</section><section>
11335<h3 id='rectangle-method'>Methods</h3>
11336
11337<section >
11338
11339
11340
11341
11342<table><thead>
11343 <tr>
11344 <th>Method</th>
11345 <th>Returns</th>
11346 <th>Description</th>
11347 </tr>
11348 </thead><tbody>
11349 <tr id='rectangle-setbounds'>
11350 <td><code><b>setBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>latLngBounds</i>)</code></td>
11351 <td><code>this</code></td>
11352 <td><p>Redraws the rectangle with the passed bounds.</p>
11353</td>
11354 </tr>
11355</tbody></table>
11356
11357</section>
11358
11359
11360<div class='accordion'>
11361 <label><span class='expander'></span> Methods inherited from <a href='#polygon'>Polygon</a></label>
11362 <div class='accordion-overflow'>
11363 <div class='accordion-content'><section >
11364
11365
11366
11367
11368<table><thead>
11369 <tr>
11370 <th>Method</th>
11371 <th>Returns</th>
11372 <th>Description</th>
11373 </tr>
11374 </thead><tbody>
11375 <tr id='rectangle-togeojson'>
11376 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
11377 <td><code>Object</code></td>
11378 <td><p><code>precision</code> is the number of decimal places for coordinates.
11379The default value is 6 places.
11380Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the polygon (as a GeoJSON <a href="#polygon"><code>Polygon</code></a> or <code>MultiPolygon</code> Feature).</p>
11381</td>
11382 </tr>
11383</tbody></table>
11384
11385</section></div>
11386 </div>
11387</div>
11388
11389<div class='accordion'>
11390 <label><span class='expander'></span> Methods inherited from <a href='#polyline'>Polyline</a></label>
11391 <div class='accordion-overflow'>
11392 <div class='accordion-content'><section >
11393
11394
11395
11396
11397<table><thead>
11398 <tr>
11399 <th>Method</th>
11400 <th>Returns</th>
11401 <th>Description</th>
11402 </tr>
11403 </thead><tbody>
11404 <tr id='rectangle-getlatlngs'>
11405 <td><code><b>getLatLngs</b>()</code></td>
11406 <td><code>LatLng[]</code></td>
11407 <td><p>Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.</p>
11408</td>
11409 </tr>
11410 <tr id='rectangle-setlatlngs'>
11411 <td><code><b>setLatLngs</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>)</code></td>
11412 <td><code>this</code></td>
11413 <td><p>Replaces all the points in the polyline with the given array of geographical points.</p>
11414</td>
11415 </tr>
11416 <tr id='rectangle-isempty'>
11417 <td><code><b>isEmpty</b>()</code></td>
11418 <td><code>Boolean</code></td>
11419 <td><p>Returns <code>true</code> if the Polyline has no LatLngs.</p>
11420</td>
11421 </tr>
11422 <tr id='rectangle-closestlayerpoint'>
11423 <td><code><b>closestLayerPoint</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p</i>)</code></td>
11424 <td><code><a href='#point'>Point</a></code></td>
11425 <td><p>Returns the point closest to <code>p</code> on the Polyline.</p>
11426</td>
11427 </tr>
11428 <tr id='rectangle-getcenter'>
11429 <td><code><b>getCenter</b>()</code></td>
11430 <td><code><a href='#latlng'>LatLng</a></code></td>
11431 <td><p>Returns the center (<a href="http://en.wikipedia.org/wiki/Centroid">centroid</a>) of the polyline.</p>
11432</td>
11433 </tr>
11434 <tr id='rectangle-getbounds'>
11435 <td><code><b>getBounds</b>()</code></td>
11436 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
11437 <td><p>Returns the <a href="#latlngbounds"><code>LatLngBounds</code></a> of the path.</p>
11438</td>
11439 </tr>
11440 <tr id='rectangle-addlatlng'>
11441 <td><code><b>addLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs?</i>)</code></td>
11442 <td><code>this</code></td>
11443 <td><p>Adds a given point to the polyline. By default, adds to the first ring of
11444the polyline in case of a multi-polyline, but can be overridden by passing
11445a specific ring as a LatLng array (that you can earlier access with <a href="#polyline-getlatlngs"><code>getLatLngs</code></a>).</p>
11446</td>
11447 </tr>
11448</tbody></table>
11449
11450</section></div>
11451 </div>
11452</div>
11453
11454<div class='accordion'>
11455 <label><span class='expander'></span> Methods inherited from <a href='#path'>Path</a></label>
11456 <div class='accordion-overflow'>
11457 <div class='accordion-content'><section >
11458
11459
11460
11461
11462<table><thead>
11463 <tr>
11464 <th>Method</th>
11465 <th>Returns</th>
11466 <th>Description</th>
11467 </tr>
11468 </thead><tbody>
11469 <tr id='rectangle-redraw'>
11470 <td><code><b>redraw</b>()</code></td>
11471 <td><code>this</code></td>
11472 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
11473</td>
11474 </tr>
11475 <tr id='rectangle-setstyle'>
11476 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
11477 <td><code>this</code></td>
11478 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
11479</td>
11480 </tr>
11481 <tr id='rectangle-bringtofront'>
11482 <td><code><b>bringToFront</b>()</code></td>
11483 <td><code>this</code></td>
11484 <td><p>Brings the layer to the top of all path layers.</p>
11485</td>
11486 </tr>
11487 <tr id='rectangle-bringtoback'>
11488 <td><code><b>bringToBack</b>()</code></td>
11489 <td><code>this</code></td>
11490 <td><p>Brings the layer to the bottom of all path layers.</p>
11491</td>
11492 </tr>
11493</tbody></table>
11494
11495</section></div>
11496 </div>
11497</div>
11498
11499<div class='accordion'>
11500 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
11501 <div class='accordion-overflow'>
11502 <div class='accordion-content'><section >
11503
11504
11505
11506
11507<table><thead>
11508 <tr>
11509 <th>Method</th>
11510 <th>Returns</th>
11511 <th>Description</th>
11512 </tr>
11513 </thead><tbody>
11514 <tr id='rectangle-addto'>
11515 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
11516 <td><code>this</code></td>
11517 <td><p>Adds the layer to the given map or layer group.</p>
11518</td>
11519 </tr>
11520 <tr id='rectangle-remove'>
11521 <td><code><b>remove</b>()</code></td>
11522 <td><code>this</code></td>
11523 <td><p>Removes the layer from the map it is currently active on.</p>
11524</td>
11525 </tr>
11526 <tr id='rectangle-removefrom'>
11527 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
11528 <td><code>this</code></td>
11529 <td><p>Removes the layer from the given map</p>
11530</td>
11531 </tr>
11532 <tr id='rectangle-removefrom'>
11533 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
11534 <td><code>this</code></td>
11535 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
11536</td>
11537 </tr>
11538 <tr id='rectangle-getpane'>
11539 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
11540 <td><code>HTMLElement</code></td>
11541 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
11542</td>
11543 </tr>
11544 <tr id='rectangle-getattribution'>
11545 <td><code><b>getAttribution</b>()</code></td>
11546 <td><code>String</code></td>
11547 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
11548</td>
11549 </tr>
11550</tbody></table>
11551
11552</section></div>
11553 </div>
11554</div>
11555
11556<div class='accordion'>
11557 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
11558 <div class='accordion-overflow'>
11559 <div class='accordion-content'><section >
11560
11561
11562
11563
11564<table><thead>
11565 <tr>
11566 <th>Method</th>
11567 <th>Returns</th>
11568 <th>Description</th>
11569 </tr>
11570 </thead><tbody>
11571 <tr id='rectangle-bindpopup'>
11572 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
11573 <td><code>this</code></td>
11574 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
11575necessary event listeners. If a <code>Function</code> is passed it will receive
11576the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
11577</td>
11578 </tr>
11579 <tr id='rectangle-unbindpopup'>
11580 <td><code><b>unbindPopup</b>()</code></td>
11581 <td><code>this</code></td>
11582 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
11583</td>
11584 </tr>
11585 <tr id='rectangle-openpopup'>
11586 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
11587 <td><code>this</code></td>
11588 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
11589</td>
11590 </tr>
11591 <tr id='rectangle-closepopup'>
11592 <td><code><b>closePopup</b>()</code></td>
11593 <td><code>this</code></td>
11594 <td><p>Closes the popup bound to this layer if it is open.</p>
11595</td>
11596 </tr>
11597 <tr id='rectangle-togglepopup'>
11598 <td><code><b>togglePopup</b>()</code></td>
11599 <td><code>this</code></td>
11600 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
11601</td>
11602 </tr>
11603 <tr id='rectangle-ispopupopen'>
11604 <td><code><b>isPopupOpen</b>()</code></td>
11605 <td><code>boolean</code></td>
11606 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
11607</td>
11608 </tr>
11609 <tr id='rectangle-setpopupcontent'>
11610 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
11611 <td><code>this</code></td>
11612 <td><p>Sets the content of the popup bound to this layer.</p>
11613</td>
11614 </tr>
11615 <tr id='rectangle-getpopup'>
11616 <td><code><b>getPopup</b>()</code></td>
11617 <td><code><a href='#popup'>Popup</a></code></td>
11618 <td><p>Returns the popup bound to this layer.</p>
11619</td>
11620 </tr>
11621</tbody></table>
11622
11623</section></div>
11624 </div>
11625</div>
11626
11627<div class='accordion'>
11628 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
11629 <div class='accordion-overflow'>
11630 <div class='accordion-content'><section >
11631
11632
11633
11634
11635<table><thead>
11636 <tr>
11637 <th>Method</th>
11638 <th>Returns</th>
11639 <th>Description</th>
11640 </tr>
11641 </thead><tbody>
11642 <tr id='rectangle-bindtooltip'>
11643 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
11644 <td><code>this</code></td>
11645 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
11646necessary event listeners. If a <code>Function</code> is passed it will receive
11647the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
11648</td>
11649 </tr>
11650 <tr id='rectangle-unbindtooltip'>
11651 <td><code><b>unbindTooltip</b>()</code></td>
11652 <td><code>this</code></td>
11653 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
11654</td>
11655 </tr>
11656 <tr id='rectangle-opentooltip'>
11657 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
11658 <td><code>this</code></td>
11659 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
11660</td>
11661 </tr>
11662 <tr id='rectangle-closetooltip'>
11663 <td><code><b>closeTooltip</b>()</code></td>
11664 <td><code>this</code></td>
11665 <td><p>Closes the tooltip bound to this layer if it is open.</p>
11666</td>
11667 </tr>
11668 <tr id='rectangle-toggletooltip'>
11669 <td><code><b>toggleTooltip</b>()</code></td>
11670 <td><code>this</code></td>
11671 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
11672</td>
11673 </tr>
11674 <tr id='rectangle-istooltipopen'>
11675 <td><code><b>isTooltipOpen</b>()</code></td>
11676 <td><code>boolean</code></td>
11677 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
11678</td>
11679 </tr>
11680 <tr id='rectangle-settooltipcontent'>
11681 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
11682 <td><code>this</code></td>
11683 <td><p>Sets the content of the tooltip bound to this layer.</p>
11684</td>
11685 </tr>
11686 <tr id='rectangle-gettooltip'>
11687 <td><code><b>getTooltip</b>()</code></td>
11688 <td><code><a href='#tooltip'>Tooltip</a></code></td>
11689 <td><p>Returns the tooltip bound to this layer.</p>
11690</td>
11691 </tr>
11692</tbody></table>
11693
11694</section></div>
11695 </div>
11696</div>
11697
11698<div class='accordion'>
11699 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
11700 <div class='accordion-overflow'>
11701 <div class='accordion-content'><section >
11702
11703
11704
11705
11706<table><thead>
11707 <tr>
11708 <th>Method</th>
11709 <th>Returns</th>
11710 <th>Description</th>
11711 </tr>
11712 </thead><tbody>
11713 <tr id='rectangle-on'>
11714 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
11715 <td><code>this</code></td>
11716 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
11717</td>
11718 </tr>
11719 <tr id='rectangle-on'>
11720 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
11721 <td><code>this</code></td>
11722 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
11723</td>
11724 </tr>
11725 <tr id='rectangle-off'>
11726 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
11727 <td><code>this</code></td>
11728 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
11729</td>
11730 </tr>
11731 <tr id='rectangle-off'>
11732 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
11733 <td><code>this</code></td>
11734 <td><p>Removes a set of type/listener pairs.</p>
11735</td>
11736 </tr>
11737 <tr id='rectangle-off'>
11738 <td><code><b>off</b>()</code></td>
11739 <td><code>this</code></td>
11740 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
11741</td>
11742 </tr>
11743 <tr id='rectangle-fire'>
11744 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
11745 <td><code>this</code></td>
11746 <td><p>Fires an event of the specified type. You can optionally provide an data
11747object — the first argument of the listener function will contain its
11748properties. The event can optionally be propagated to event parents.</p>
11749</td>
11750 </tr>
11751 <tr id='rectangle-listens'>
11752 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
11753 <td><code>Boolean</code></td>
11754 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
11755</td>
11756 </tr>
11757 <tr id='rectangle-once'>
11758 <td><code><b>once</b>(<i></i>)</code></td>
11759 <td><code>this</code></td>
11760 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
11761</td>
11762 </tr>
11763 <tr id='rectangle-addeventparent'>
11764 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
11765 <td><code>this</code></td>
11766 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
11767</td>
11768 </tr>
11769 <tr id='rectangle-removeeventparent'>
11770 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
11771 <td><code>this</code></td>
11772 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
11773</td>
11774 </tr>
11775 <tr id='rectangle-addeventlistener'>
11776 <td><code><b>addEventListener</b>(<i></i>)</code></td>
11777 <td><code>this</code></td>
11778 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
11779</td>
11780 </tr>
11781 <tr id='rectangle-removeeventlistener'>
11782 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
11783 <td><code>this</code></td>
11784 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
11785</td>
11786 </tr>
11787 <tr id='rectangle-clearalleventlisteners'>
11788 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
11789 <td><code>this</code></td>
11790 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
11791</td>
11792 </tr>
11793 <tr id='rectangle-addonetimeeventlistener'>
11794 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
11795 <td><code>this</code></td>
11796 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
11797</td>
11798 </tr>
11799 <tr id='rectangle-fireevent'>
11800 <td><code><b>fireEvent</b>(<i></i>)</code></td>
11801 <td><code>this</code></td>
11802 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
11803</td>
11804 </tr>
11805 <tr id='rectangle-haseventlisteners'>
11806 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
11807 <td><code>Boolean</code></td>
11808 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
11809</td>
11810 </tr>
11811</tbody></table>
11812
11813</section></div>
11814 </div>
11815</div>
11816
11817</section><h2 id='circle'>Circle</h2><p>A class for drawing circle overlays on a map. Extends <a href="#circlemarker"><code>CircleMarker</code></a>.
11818It&#39;s an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).</p>
11819
11820<section>
11821<h3 id='circle-example'>Usage example</h3>
11822
11823<section >
11824
11825
11826
11827
11828
11829<pre><code class="lang-js">L.circle([50.5, 30.5], {radius: 200}).addTo(map);
11830</code></pre>
11831
11832
11833
11834</section>
11835
11836
11837</section><section>
11838<h3 id='circle-factory'>Creation</h3>
11839
11840<section >
11841
11842
11843
11844
11845<table><thead>
11846 <tr>
11847 <th>Factory</th>
11848 <th>Description</th>
11849 </tr>
11850 </thead><tbody>
11851 <tr id='circle-l-circle'>
11852 <td><code><b>L.circle</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#circle-option'>Circle options</a>&gt;</nobr> <i>options?</i>)</code></td>
11853 <td>Instantiates a circle object given a geographical point, and an options object
11854which contains the circle radius.</td>
11855 </tr>
11856 <tr id='circle-l-circle'>
11857 <td><code><b>L.circle</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>radius</i>, <nobr>&lt;<a href='#circle-option'>Circle options</a>&gt;</nobr> <i>options?</i>)</code></td>
11858 <td>Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
11859Do not use in new applications or plugins.</td>
11860 </tr>
11861</tbody></table>
11862
11863</section>
11864
11865
11866</section><section>
11867<h3 id='circle-option'>Options</h3>
11868
11869<section >
11870
11871
11872
11873
11874<table><thead>
11875 <tr>
11876 <th>Option</th>
11877 <th>Type</th>
11878 <th>Default</th>
11879 <th>Description</th>
11880 </tr>
11881 </thead><tbody>
11882 <tr id='circle-radius'>
11883 <td><code><b>radius</b></code></td>
11884 <td><code>Number</code></td>
11885 <td><code></code></td>
11886 <td>Radius of the circle, in meters.</td>
11887 </tr>
11888</tbody></table>
11889
11890</section>
11891
11892
11893<div class='accordion'>
11894 <label><span class='expander'></span> Options inherited from <a href='#path'>Path</a></label>
11895 <div class='accordion-overflow'>
11896 <div class='accordion-content'><section >
11897
11898
11899
11900
11901<table><thead>
11902 <tr>
11903 <th>Option</th>
11904 <th>Type</th>
11905 <th>Default</th>
11906 <th>Description</th>
11907 </tr>
11908 </thead><tbody>
11909 <tr id='circle-stroke'>
11910 <td><code><b>stroke</b></code></td>
11911 <td><code>Boolean</code></td>
11912 <td><code>true</code></td>
11913 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
11914 </tr>
11915 <tr id='circle-color'>
11916 <td><code><b>color</b></code></td>
11917 <td><code>String</code></td>
11918 <td><code>&#x27;#3388ff&#x27;</code></td>
11919 <td>Stroke color</td>
11920 </tr>
11921 <tr id='circle-weight'>
11922 <td><code><b>weight</b></code></td>
11923 <td><code>Number</code></td>
11924 <td><code>3</code></td>
11925 <td>Stroke width in pixels</td>
11926 </tr>
11927 <tr id='circle-opacity'>
11928 <td><code><b>opacity</b></code></td>
11929 <td><code>Number</code></td>
11930 <td><code>1.0</code></td>
11931 <td>Stroke opacity</td>
11932 </tr>
11933 <tr id='circle-linecap'>
11934 <td><code><b>lineCap</b></code></td>
11935 <td><code>String</code></td>
11936 <td><code>&#x27;round&#x27;</code></td>
11937 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
11938 </tr>
11939 <tr id='circle-linejoin'>
11940 <td><code><b>lineJoin</b></code></td>
11941 <td><code>String</code></td>
11942 <td><code>&#x27;round&#x27;</code></td>
11943 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
11944 </tr>
11945 <tr id='circle-dasharray'>
11946 <td><code><b>dashArray</b></code></td>
11947 <td><code>String</code></td>
11948 <td><code>null</code></td>
11949 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
11950 </tr>
11951 <tr id='circle-dashoffset'>
11952 <td><code><b>dashOffset</b></code></td>
11953 <td><code>String</code></td>
11954 <td><code>null</code></td>
11955 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
11956 </tr>
11957 <tr id='circle-fill'>
11958 <td><code><b>fill</b></code></td>
11959 <td><code>Boolean</code></td>
11960 <td><code>depends</code></td>
11961 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
11962 </tr>
11963 <tr id='circle-fillcolor'>
11964 <td><code><b>fillColor</b></code></td>
11965 <td><code>String</code></td>
11966 <td><code>*</code></td>
11967 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
11968 </tr>
11969 <tr id='circle-fillopacity'>
11970 <td><code><b>fillOpacity</b></code></td>
11971 <td><code>Number</code></td>
11972 <td><code>0.2</code></td>
11973 <td>Fill opacity.</td>
11974 </tr>
11975 <tr id='circle-fillrule'>
11976 <td><code><b>fillRule</b></code></td>
11977 <td><code>String</code></td>
11978 <td><code>&#x27;evenodd&#x27;</code></td>
11979 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
11980 </tr>
11981 <tr id='circle-bubblingmouseevents'>
11982 <td><code><b>bubblingMouseEvents</b></code></td>
11983 <td><code>Boolean</code></td>
11984 <td><code>true</code></td>
11985 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
11986(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
11987 </tr>
11988 <tr id='circle-renderer'>
11989 <td><code><b>renderer</b></code></td>
11990 <td><code><a href='#renderer'>Renderer</a></code></td>
11991 <td><code></code></td>
11992 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
11993precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
11994 </tr>
11995 <tr id='circle-classname'>
11996 <td><code><b>className</b></code></td>
11997 <td><code>String</code></td>
11998 <td><code>null</code></td>
11999 <td>Custom class name set on an element. Only for SVG renderer.</td>
12000 </tr>
12001</tbody></table>
12002
12003</section></div>
12004 </div>
12005</div>
12006
12007<div class='accordion'>
12008 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
12009 <div class='accordion-overflow'>
12010 <div class='accordion-content'><section >
12011
12012
12013
12014
12015<table><thead>
12016 <tr>
12017 <th>Option</th>
12018 <th>Type</th>
12019 <th>Default</th>
12020 <th>Description</th>
12021 </tr>
12022 </thead><tbody>
12023 <tr id='circle-interactive'>
12024 <td><code><b>interactive</b></code></td>
12025 <td><code>Boolean</code></td>
12026 <td><code>true</code></td>
12027 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
12028 </tr>
12029</tbody></table>
12030
12031</section></div>
12032 </div>
12033</div>
12034
12035<div class='accordion'>
12036 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
12037 <div class='accordion-overflow'>
12038 <div class='accordion-content'><section >
12039
12040
12041
12042
12043<table><thead>
12044 <tr>
12045 <th>Option</th>
12046 <th>Type</th>
12047 <th>Default</th>
12048 <th>Description</th>
12049 </tr>
12050 </thead><tbody>
12051 <tr id='circle-pane'>
12052 <td><code><b>pane</b></code></td>
12053 <td><code>String</code></td>
12054 <td><code>&#x27;overlayPane&#x27;</code></td>
12055 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
12056 </tr>
12057 <tr id='circle-attribution'>
12058 <td><code><b>attribution</b></code></td>
12059 <td><code>String</code></td>
12060 <td><code>null</code></td>
12061 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
12062 </tr>
12063</tbody></table>
12064
12065</section></div>
12066 </div>
12067</div>
12068
12069</section><section>
12070<h3 id=''>Events</h3>
12071
12072
12073
12074
12075<div class='accordion'>
12076 <label><span class='expander'></span> Events inherited from <a href='#circlemarker'>CircleMarker</a></label>
12077 <div class='accordion-overflow'>
12078 <div class='accordion-content'><section >
12079
12080
12081
12082
12083<table><thead>
12084 <tr>
12085 <th>Event</th>
12086 <th>Data</th>
12087 <th>Description</th>
12088 </tr>
12089 </thead><tbody>
12090 <tr id='circle-move'>
12091 <td><code><b>move</b></code></td>
12092 <td><code><a href='#event'>Event</a></code></td>
12093 <td>Fired when the marker is moved via <a href="#circlemarker-setlatlng"><code>setLatLng</code></a>. Old and new coordinates are included in event arguments as <code>oldLatLng</code>, <a href="#latlng"><code>latlng</code></a>.</td>
12094 </tr>
12095</tbody></table>
12096
12097</section></div>
12098 </div>
12099</div>
12100
12101<div class='accordion'>
12102 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
12103 <div class='accordion-overflow'>
12104 <div class='accordion-content'><section >
12105
12106
12107
12108
12109<table><thead>
12110 <tr>
12111 <th>Event</th>
12112 <th>Data</th>
12113 <th>Description</th>
12114 </tr>
12115 </thead><tbody>
12116 <tr id='circle-click'>
12117 <td><code><b>click</b></code></td>
12118 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12119 <td>Fired when the user clicks (or taps) the layer.</td>
12120 </tr>
12121 <tr id='circle-dblclick'>
12122 <td><code><b>dblclick</b></code></td>
12123 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12124 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
12125 </tr>
12126 <tr id='circle-mousedown'>
12127 <td><code><b>mousedown</b></code></td>
12128 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12129 <td>Fired when the user pushes the mouse button on the layer.</td>
12130 </tr>
12131 <tr id='circle-mouseup'>
12132 <td><code><b>mouseup</b></code></td>
12133 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12134 <td>Fired when the user releases the mouse button pushed on the layer.</td>
12135 </tr>
12136 <tr id='circle-mouseover'>
12137 <td><code><b>mouseover</b></code></td>
12138 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12139 <td>Fired when the mouse enters the layer.</td>
12140 </tr>
12141 <tr id='circle-mouseout'>
12142 <td><code><b>mouseout</b></code></td>
12143 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12144 <td>Fired when the mouse leaves the layer.</td>
12145 </tr>
12146 <tr id='circle-contextmenu'>
12147 <td><code><b>contextmenu</b></code></td>
12148 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12149 <td>Fired when the user right-clicks on the layer, prevents
12150default browser context menu from showing if there are listeners on
12151this event. Also fired on mobile when the user holds a single touch
12152for a second (also called long press).</td>
12153 </tr>
12154</tbody></table>
12155
12156</section></div>
12157 </div>
12158</div>
12159
12160<div class='accordion'>
12161 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
12162 <div class='accordion-overflow'>
12163 <div class='accordion-content'><section >
12164
12165
12166
12167
12168<table><thead>
12169 <tr>
12170 <th>Event</th>
12171 <th>Data</th>
12172 <th>Description</th>
12173 </tr>
12174 </thead><tbody>
12175 <tr id='circle-add'>
12176 <td><code><b>add</b></code></td>
12177 <td><code><a href='#event'>Event</a></code></td>
12178 <td>Fired after the layer is added to a map</td>
12179 </tr>
12180 <tr id='circle-remove'>
12181 <td><code><b>remove</b></code></td>
12182 <td><code><a href='#event'>Event</a></code></td>
12183 <td>Fired after the layer is removed from a map</td>
12184 </tr>
12185</tbody></table>
12186
12187</section></div>
12188 </div>
12189</div>
12190
12191<div class='accordion'>
12192 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
12193 <div class='accordion-overflow'>
12194 <div class='accordion-content'><section >
12195
12196
12197
12198
12199<table><thead>
12200 <tr>
12201 <th>Event</th>
12202 <th>Data</th>
12203 <th>Description</th>
12204 </tr>
12205 </thead><tbody>
12206 <tr id='circle-popupopen'>
12207 <td><code><b>popupopen</b></code></td>
12208 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
12209 <td>Fired when a popup bound to this layer is opened</td>
12210 </tr>
12211 <tr id='circle-popupclose'>
12212 <td><code><b>popupclose</b></code></td>
12213 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
12214 <td>Fired when a popup bound to this layer is closed</td>
12215 </tr>
12216</tbody></table>
12217
12218</section></div>
12219 </div>
12220</div>
12221
12222<div class='accordion'>
12223 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
12224 <div class='accordion-overflow'>
12225 <div class='accordion-content'><section >
12226
12227
12228
12229
12230<table><thead>
12231 <tr>
12232 <th>Event</th>
12233 <th>Data</th>
12234 <th>Description</th>
12235 </tr>
12236 </thead><tbody>
12237 <tr id='circle-tooltipopen'>
12238 <td><code><b>tooltipopen</b></code></td>
12239 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
12240 <td>Fired when a tooltip bound to this layer is opened.</td>
12241 </tr>
12242 <tr id='circle-tooltipclose'>
12243 <td><code><b>tooltipclose</b></code></td>
12244 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
12245 <td>Fired when a tooltip bound to this layer is closed.</td>
12246 </tr>
12247</tbody></table>
12248
12249</section></div>
12250 </div>
12251</div>
12252
12253</section><section>
12254<h3 id='circle-method'>Methods</h3>
12255
12256<section >
12257
12258
12259
12260
12261<table><thead>
12262 <tr>
12263 <th>Method</th>
12264 <th>Returns</th>
12265 <th>Description</th>
12266 </tr>
12267 </thead><tbody>
12268 <tr id='circle-setradius'>
12269 <td><code><b>setRadius</b>(<nobr>&lt;Number&gt;</nobr> <i>radius</i>)</code></td>
12270 <td><code>this</code></td>
12271 <td><p>Sets the radius of a circle. Units are in meters.</p>
12272</td>
12273 </tr>
12274 <tr id='circle-getradius'>
12275 <td><code><b>getRadius</b>()</code></td>
12276 <td><code>Number</code></td>
12277 <td><p>Returns the current radius of a circle. Units are in meters.</p>
12278</td>
12279 </tr>
12280 <tr id='circle-getbounds'>
12281 <td><code><b>getBounds</b>()</code></td>
12282 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
12283 <td><p>Returns the <a href="#latlngbounds"><code>LatLngBounds</code></a> of the path.</p>
12284</td>
12285 </tr>
12286</tbody></table>
12287
12288</section>
12289
12290
12291<div class='accordion'>
12292 <label><span class='expander'></span> Methods inherited from <a href='#circlemarker'>CircleMarker</a></label>
12293 <div class='accordion-overflow'>
12294 <div class='accordion-content'><section >
12295
12296
12297
12298
12299<table><thead>
12300 <tr>
12301 <th>Method</th>
12302 <th>Returns</th>
12303 <th>Description</th>
12304 </tr>
12305 </thead><tbody>
12306 <tr id='circle-togeojson'>
12307 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
12308 <td><code>Object</code></td>
12309 <td><p><code>precision</code> is the number of decimal places for coordinates.
12310The default value is 6 places.
12311Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the circle marker (as a GeoJSON <a href="#point"><code>Point</code></a> Feature).</p>
12312</td>
12313 </tr>
12314 <tr id='circle-setlatlng'>
12315 <td><code><b>setLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latLng</i>)</code></td>
12316 <td><code>this</code></td>
12317 <td><p>Sets the position of a circle marker to a new location.</p>
12318</td>
12319 </tr>
12320 <tr id='circle-getlatlng'>
12321 <td><code><b>getLatLng</b>()</code></td>
12322 <td><code><a href='#latlng'>LatLng</a></code></td>
12323 <td><p>Returns the current geographical position of the circle marker</p>
12324</td>
12325 </tr>
12326</tbody></table>
12327
12328</section></div>
12329 </div>
12330</div>
12331
12332<div class='accordion'>
12333 <label><span class='expander'></span> Methods inherited from <a href='#path'>Path</a></label>
12334 <div class='accordion-overflow'>
12335 <div class='accordion-content'><section >
12336
12337
12338
12339
12340<table><thead>
12341 <tr>
12342 <th>Method</th>
12343 <th>Returns</th>
12344 <th>Description</th>
12345 </tr>
12346 </thead><tbody>
12347 <tr id='circle-redraw'>
12348 <td><code><b>redraw</b>()</code></td>
12349 <td><code>this</code></td>
12350 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
12351</td>
12352 </tr>
12353 <tr id='circle-setstyle'>
12354 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
12355 <td><code>this</code></td>
12356 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
12357</td>
12358 </tr>
12359 <tr id='circle-bringtofront'>
12360 <td><code><b>bringToFront</b>()</code></td>
12361 <td><code>this</code></td>
12362 <td><p>Brings the layer to the top of all path layers.</p>
12363</td>
12364 </tr>
12365 <tr id='circle-bringtoback'>
12366 <td><code><b>bringToBack</b>()</code></td>
12367 <td><code>this</code></td>
12368 <td><p>Brings the layer to the bottom of all path layers.</p>
12369</td>
12370 </tr>
12371</tbody></table>
12372
12373</section></div>
12374 </div>
12375</div>
12376
12377<div class='accordion'>
12378 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
12379 <div class='accordion-overflow'>
12380 <div class='accordion-content'><section >
12381
12382
12383
12384
12385<table><thead>
12386 <tr>
12387 <th>Method</th>
12388 <th>Returns</th>
12389 <th>Description</th>
12390 </tr>
12391 </thead><tbody>
12392 <tr id='circle-addto'>
12393 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
12394 <td><code>this</code></td>
12395 <td><p>Adds the layer to the given map or layer group.</p>
12396</td>
12397 </tr>
12398 <tr id='circle-remove'>
12399 <td><code><b>remove</b>()</code></td>
12400 <td><code>this</code></td>
12401 <td><p>Removes the layer from the map it is currently active on.</p>
12402</td>
12403 </tr>
12404 <tr id='circle-removefrom'>
12405 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
12406 <td><code>this</code></td>
12407 <td><p>Removes the layer from the given map</p>
12408</td>
12409 </tr>
12410 <tr id='circle-removefrom'>
12411 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
12412 <td><code>this</code></td>
12413 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
12414</td>
12415 </tr>
12416 <tr id='circle-getpane'>
12417 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
12418 <td><code>HTMLElement</code></td>
12419 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
12420</td>
12421 </tr>
12422 <tr id='circle-getattribution'>
12423 <td><code><b>getAttribution</b>()</code></td>
12424 <td><code>String</code></td>
12425 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
12426</td>
12427 </tr>
12428</tbody></table>
12429
12430</section></div>
12431 </div>
12432</div>
12433
12434<div class='accordion'>
12435 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
12436 <div class='accordion-overflow'>
12437 <div class='accordion-content'><section >
12438
12439
12440
12441
12442<table><thead>
12443 <tr>
12444 <th>Method</th>
12445 <th>Returns</th>
12446 <th>Description</th>
12447 </tr>
12448 </thead><tbody>
12449 <tr id='circle-bindpopup'>
12450 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
12451 <td><code>this</code></td>
12452 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
12453necessary event listeners. If a <code>Function</code> is passed it will receive
12454the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
12455</td>
12456 </tr>
12457 <tr id='circle-unbindpopup'>
12458 <td><code><b>unbindPopup</b>()</code></td>
12459 <td><code>this</code></td>
12460 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
12461</td>
12462 </tr>
12463 <tr id='circle-openpopup'>
12464 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
12465 <td><code>this</code></td>
12466 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
12467</td>
12468 </tr>
12469 <tr id='circle-closepopup'>
12470 <td><code><b>closePopup</b>()</code></td>
12471 <td><code>this</code></td>
12472 <td><p>Closes the popup bound to this layer if it is open.</p>
12473</td>
12474 </tr>
12475 <tr id='circle-togglepopup'>
12476 <td><code><b>togglePopup</b>()</code></td>
12477 <td><code>this</code></td>
12478 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
12479</td>
12480 </tr>
12481 <tr id='circle-ispopupopen'>
12482 <td><code><b>isPopupOpen</b>()</code></td>
12483 <td><code>boolean</code></td>
12484 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
12485</td>
12486 </tr>
12487 <tr id='circle-setpopupcontent'>
12488 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
12489 <td><code>this</code></td>
12490 <td><p>Sets the content of the popup bound to this layer.</p>
12491</td>
12492 </tr>
12493 <tr id='circle-getpopup'>
12494 <td><code><b>getPopup</b>()</code></td>
12495 <td><code><a href='#popup'>Popup</a></code></td>
12496 <td><p>Returns the popup bound to this layer.</p>
12497</td>
12498 </tr>
12499</tbody></table>
12500
12501</section></div>
12502 </div>
12503</div>
12504
12505<div class='accordion'>
12506 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
12507 <div class='accordion-overflow'>
12508 <div class='accordion-content'><section >
12509
12510
12511
12512
12513<table><thead>
12514 <tr>
12515 <th>Method</th>
12516 <th>Returns</th>
12517 <th>Description</th>
12518 </tr>
12519 </thead><tbody>
12520 <tr id='circle-bindtooltip'>
12521 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
12522 <td><code>this</code></td>
12523 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
12524necessary event listeners. If a <code>Function</code> is passed it will receive
12525the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
12526</td>
12527 </tr>
12528 <tr id='circle-unbindtooltip'>
12529 <td><code><b>unbindTooltip</b>()</code></td>
12530 <td><code>this</code></td>
12531 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
12532</td>
12533 </tr>
12534 <tr id='circle-opentooltip'>
12535 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
12536 <td><code>this</code></td>
12537 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
12538</td>
12539 </tr>
12540 <tr id='circle-closetooltip'>
12541 <td><code><b>closeTooltip</b>()</code></td>
12542 <td><code>this</code></td>
12543 <td><p>Closes the tooltip bound to this layer if it is open.</p>
12544</td>
12545 </tr>
12546 <tr id='circle-toggletooltip'>
12547 <td><code><b>toggleTooltip</b>()</code></td>
12548 <td><code>this</code></td>
12549 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
12550</td>
12551 </tr>
12552 <tr id='circle-istooltipopen'>
12553 <td><code><b>isTooltipOpen</b>()</code></td>
12554 <td><code>boolean</code></td>
12555 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
12556</td>
12557 </tr>
12558 <tr id='circle-settooltipcontent'>
12559 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
12560 <td><code>this</code></td>
12561 <td><p>Sets the content of the tooltip bound to this layer.</p>
12562</td>
12563 </tr>
12564 <tr id='circle-gettooltip'>
12565 <td><code><b>getTooltip</b>()</code></td>
12566 <td><code><a href='#tooltip'>Tooltip</a></code></td>
12567 <td><p>Returns the tooltip bound to this layer.</p>
12568</td>
12569 </tr>
12570</tbody></table>
12571
12572</section></div>
12573 </div>
12574</div>
12575
12576<div class='accordion'>
12577 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
12578 <div class='accordion-overflow'>
12579 <div class='accordion-content'><section >
12580
12581
12582
12583
12584<table><thead>
12585 <tr>
12586 <th>Method</th>
12587 <th>Returns</th>
12588 <th>Description</th>
12589 </tr>
12590 </thead><tbody>
12591 <tr id='circle-on'>
12592 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
12593 <td><code>this</code></td>
12594 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
12595</td>
12596 </tr>
12597 <tr id='circle-on'>
12598 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
12599 <td><code>this</code></td>
12600 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
12601</td>
12602 </tr>
12603 <tr id='circle-off'>
12604 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
12605 <td><code>this</code></td>
12606 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
12607</td>
12608 </tr>
12609 <tr id='circle-off'>
12610 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
12611 <td><code>this</code></td>
12612 <td><p>Removes a set of type/listener pairs.</p>
12613</td>
12614 </tr>
12615 <tr id='circle-off'>
12616 <td><code><b>off</b>()</code></td>
12617 <td><code>this</code></td>
12618 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
12619</td>
12620 </tr>
12621 <tr id='circle-fire'>
12622 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
12623 <td><code>this</code></td>
12624 <td><p>Fires an event of the specified type. You can optionally provide an data
12625object — the first argument of the listener function will contain its
12626properties. The event can optionally be propagated to event parents.</p>
12627</td>
12628 </tr>
12629 <tr id='circle-listens'>
12630 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
12631 <td><code>Boolean</code></td>
12632 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
12633</td>
12634 </tr>
12635 <tr id='circle-once'>
12636 <td><code><b>once</b>(<i></i>)</code></td>
12637 <td><code>this</code></td>
12638 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
12639</td>
12640 </tr>
12641 <tr id='circle-addeventparent'>
12642 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
12643 <td><code>this</code></td>
12644 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
12645</td>
12646 </tr>
12647 <tr id='circle-removeeventparent'>
12648 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
12649 <td><code>this</code></td>
12650 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
12651</td>
12652 </tr>
12653 <tr id='circle-addeventlistener'>
12654 <td><code><b>addEventListener</b>(<i></i>)</code></td>
12655 <td><code>this</code></td>
12656 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
12657</td>
12658 </tr>
12659 <tr id='circle-removeeventlistener'>
12660 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
12661 <td><code>this</code></td>
12662 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
12663</td>
12664 </tr>
12665 <tr id='circle-clearalleventlisteners'>
12666 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
12667 <td><code>this</code></td>
12668 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
12669</td>
12670 </tr>
12671 <tr id='circle-addonetimeeventlistener'>
12672 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
12673 <td><code>this</code></td>
12674 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
12675</td>
12676 </tr>
12677 <tr id='circle-fireevent'>
12678 <td><code><b>fireEvent</b>(<i></i>)</code></td>
12679 <td><code>this</code></td>
12680 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
12681</td>
12682 </tr>
12683 <tr id='circle-haseventlisteners'>
12684 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
12685 <td><code>Boolean</code></td>
12686 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
12687</td>
12688 </tr>
12689</tbody></table>
12690
12691</section></div>
12692 </div>
12693</div>
12694
12695</section><h2 id='circlemarker'>CircleMarker</h2><p>A circle of a fixed size with radius specified in pixels. Extends <a href="#path"><code>Path</code></a>.</p>
12696
12697<section>
12698<h3 id='circlemarker-factory'>Creation</h3>
12699
12700<section >
12701
12702
12703
12704
12705<table><thead>
12706 <tr>
12707 <th>Factory</th>
12708 <th>Description</th>
12709 </tr>
12710 </thead><tbody>
12711 <tr id='circlemarker-l-circlemarker'>
12712 <td><code><b>L.circleMarker</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;<a href='#circlemarker-option'>CircleMarker options</a>&gt;</nobr> <i>options?</i>)</code></td>
12713 <td>Instantiates a circle marker object given a geographical point, and an optional options object.</td>
12714 </tr>
12715</tbody></table>
12716
12717</section>
12718
12719
12720</section><section>
12721<h3 id='circlemarker-option'>Options</h3>
12722
12723<section >
12724
12725
12726
12727
12728<table><thead>
12729 <tr>
12730 <th>Option</th>
12731 <th>Type</th>
12732 <th>Default</th>
12733 <th>Description</th>
12734 </tr>
12735 </thead><tbody>
12736 <tr id='circlemarker-radius'>
12737 <td><code><b>radius</b></code></td>
12738 <td><code>Number</code></td>
12739 <td><code>10</code></td>
12740 <td>Radius of the circle marker, in pixels</td>
12741 </tr>
12742</tbody></table>
12743
12744</section>
12745
12746
12747<div class='accordion'>
12748 <label><span class='expander'></span> Options inherited from <a href='#path'>Path</a></label>
12749 <div class='accordion-overflow'>
12750 <div class='accordion-content'><section >
12751
12752
12753
12754
12755<table><thead>
12756 <tr>
12757 <th>Option</th>
12758 <th>Type</th>
12759 <th>Default</th>
12760 <th>Description</th>
12761 </tr>
12762 </thead><tbody>
12763 <tr id='circlemarker-stroke'>
12764 <td><code><b>stroke</b></code></td>
12765 <td><code>Boolean</code></td>
12766 <td><code>true</code></td>
12767 <td>Whether to draw stroke along the path. Set it to <code>false</code> to disable borders on polygons or circles.</td>
12768 </tr>
12769 <tr id='circlemarker-color'>
12770 <td><code><b>color</b></code></td>
12771 <td><code>String</code></td>
12772 <td><code>&#x27;#3388ff&#x27;</code></td>
12773 <td>Stroke color</td>
12774 </tr>
12775 <tr id='circlemarker-weight'>
12776 <td><code><b>weight</b></code></td>
12777 <td><code>Number</code></td>
12778 <td><code>3</code></td>
12779 <td>Stroke width in pixels</td>
12780 </tr>
12781 <tr id='circlemarker-opacity'>
12782 <td><code><b>opacity</b></code></td>
12783 <td><code>Number</code></td>
12784 <td><code>1.0</code></td>
12785 <td>Stroke opacity</td>
12786 </tr>
12787 <tr id='circlemarker-linecap'>
12788 <td><code><b>lineCap</b></code></td>
12789 <td><code>String</code></td>
12790 <td><code>&#x27;round&#x27;</code></td>
12791 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap">shape to be used at the end</a> of the stroke.</td>
12792 </tr>
12793 <tr id='circlemarker-linejoin'>
12794 <td><code><b>lineJoin</b></code></td>
12795 <td><code>String</code></td>
12796 <td><code>&#x27;round&#x27;</code></td>
12797 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin">shape to be used at the corners</a> of the stroke.</td>
12798 </tr>
12799 <tr id='circlemarker-dasharray'>
12800 <td><code><b>dashArray</b></code></td>
12801 <td><code>String</code></td>
12802 <td><code>null</code></td>
12803 <td>A string that defines the stroke <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray">dash pattern</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
12804 </tr>
12805 <tr id='circlemarker-dashoffset'>
12806 <td><code><b>dashOffset</b></code></td>
12807 <td><code>String</code></td>
12808 <td><code>null</code></td>
12809 <td>A string that defines the <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset">distance into the dash pattern to start the dash</a>. Doesn&#39;t work on <a href="#canvas"><code>Canvas</code></a>-powered layers in <a href="https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility">some old browsers</a>.</td>
12810 </tr>
12811 <tr id='circlemarker-fill'>
12812 <td><code><b>fill</b></code></td>
12813 <td><code>Boolean</code></td>
12814 <td><code>depends</code></td>
12815 <td>Whether to fill the path with color. Set it to <code>false</code> to disable filling on polygons or circles.</td>
12816 </tr>
12817 <tr id='circlemarker-fillcolor'>
12818 <td><code><b>fillColor</b></code></td>
12819 <td><code>String</code></td>
12820 <td><code>*</code></td>
12821 <td>Fill color. Defaults to the value of the <a href="#path-color"><code>color</code></a> option</td>
12822 </tr>
12823 <tr id='circlemarker-fillopacity'>
12824 <td><code><b>fillOpacity</b></code></td>
12825 <td><code>Number</code></td>
12826 <td><code>0.2</code></td>
12827 <td>Fill opacity.</td>
12828 </tr>
12829 <tr id='circlemarker-fillrule'>
12830 <td><code><b>fillRule</b></code></td>
12831 <td><code>String</code></td>
12832 <td><code>&#x27;evenodd&#x27;</code></td>
12833 <td>A string that defines <a href="https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule">how the inside of a shape</a> is determined.</td>
12834 </tr>
12835 <tr id='circlemarker-bubblingmouseevents'>
12836 <td><code><b>bubblingMouseEvents</b></code></td>
12837 <td><code>Boolean</code></td>
12838 <td><code>true</code></td>
12839 <td>When <code>true</code>, a mouse event on this path will trigger the same event on the map
12840(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
12841 </tr>
12842 <tr id='circlemarker-renderer'>
12843 <td><code><b>renderer</b></code></td>
12844 <td><code><a href='#renderer'>Renderer</a></code></td>
12845 <td><code></code></td>
12846 <td>Use this specific instance of <a href="#renderer"><code>Renderer</code></a> for this path. Takes
12847precedence over the map&#39;s <a href="#map-renderer">default renderer</a>.</td>
12848 </tr>
12849 <tr id='circlemarker-classname'>
12850 <td><code><b>className</b></code></td>
12851 <td><code>String</code></td>
12852 <td><code>null</code></td>
12853 <td>Custom class name set on an element. Only for SVG renderer.</td>
12854 </tr>
12855</tbody></table>
12856
12857</section></div>
12858 </div>
12859</div>
12860
12861<div class='accordion'>
12862 <label><span class='expander'></span> Options inherited from <a href='#interactive-layer'>Interactive layer</a></label>
12863 <div class='accordion-overflow'>
12864 <div class='accordion-content'><section >
12865
12866
12867
12868
12869<table><thead>
12870 <tr>
12871 <th>Option</th>
12872 <th>Type</th>
12873 <th>Default</th>
12874 <th>Description</th>
12875 </tr>
12876 </thead><tbody>
12877 <tr id='circlemarker-interactive'>
12878 <td><code><b>interactive</b></code></td>
12879 <td><code>Boolean</code></td>
12880 <td><code>true</code></td>
12881 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
12882 </tr>
12883</tbody></table>
12884
12885</section></div>
12886 </div>
12887</div>
12888
12889<div class='accordion'>
12890 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
12891 <div class='accordion-overflow'>
12892 <div class='accordion-content'><section >
12893
12894
12895
12896
12897<table><thead>
12898 <tr>
12899 <th>Option</th>
12900 <th>Type</th>
12901 <th>Default</th>
12902 <th>Description</th>
12903 </tr>
12904 </thead><tbody>
12905 <tr id='circlemarker-pane'>
12906 <td><code><b>pane</b></code></td>
12907 <td><code>String</code></td>
12908 <td><code>&#x27;overlayPane&#x27;</code></td>
12909 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
12910 </tr>
12911 <tr id='circlemarker-attribution'>
12912 <td><code><b>attribution</b></code></td>
12913 <td><code>String</code></td>
12914 <td><code>null</code></td>
12915 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
12916 </tr>
12917</tbody></table>
12918
12919</section></div>
12920 </div>
12921</div>
12922
12923</section><section>
12924<h3 id='circlemarker-event'>Events</h3>
12925
12926<section >
12927
12928
12929
12930
12931<table><thead>
12932 <tr>
12933 <th>Event</th>
12934 <th>Data</th>
12935 <th>Description</th>
12936 </tr>
12937 </thead><tbody>
12938 <tr id='circlemarker-move'>
12939 <td><code><b>move</b></code></td>
12940 <td><code><a href='#event'>Event</a></code></td>
12941 <td>Fired when the marker is moved via <a href="#circlemarker-setlatlng"><code>setLatLng</code></a>. Old and new coordinates are included in event arguments as <code>oldLatLng</code>, <a href="#latlng"><code>latlng</code></a>.</td>
12942 </tr>
12943</tbody></table>
12944
12945</section>
12946
12947
12948<div class='accordion'>
12949 <label><span class='expander'></span> Mouse events inherited from <a href='#interactive-layer'>Interactive layer</a></label>
12950 <div class='accordion-overflow'>
12951 <div class='accordion-content'><section >
12952
12953
12954
12955
12956<table><thead>
12957 <tr>
12958 <th>Event</th>
12959 <th>Data</th>
12960 <th>Description</th>
12961 </tr>
12962 </thead><tbody>
12963 <tr id='circlemarker-click'>
12964 <td><code><b>click</b></code></td>
12965 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12966 <td>Fired when the user clicks (or taps) the layer.</td>
12967 </tr>
12968 <tr id='circlemarker-dblclick'>
12969 <td><code><b>dblclick</b></code></td>
12970 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12971 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
12972 </tr>
12973 <tr id='circlemarker-mousedown'>
12974 <td><code><b>mousedown</b></code></td>
12975 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12976 <td>Fired when the user pushes the mouse button on the layer.</td>
12977 </tr>
12978 <tr id='circlemarker-mouseup'>
12979 <td><code><b>mouseup</b></code></td>
12980 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12981 <td>Fired when the user releases the mouse button pushed on the layer.</td>
12982 </tr>
12983 <tr id='circlemarker-mouseover'>
12984 <td><code><b>mouseover</b></code></td>
12985 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12986 <td>Fired when the mouse enters the layer.</td>
12987 </tr>
12988 <tr id='circlemarker-mouseout'>
12989 <td><code><b>mouseout</b></code></td>
12990 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12991 <td>Fired when the mouse leaves the layer.</td>
12992 </tr>
12993 <tr id='circlemarker-contextmenu'>
12994 <td><code><b>contextmenu</b></code></td>
12995 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
12996 <td>Fired when the user right-clicks on the layer, prevents
12997default browser context menu from showing if there are listeners on
12998this event. Also fired on mobile when the user holds a single touch
12999for a second (also called long press).</td>
13000 </tr>
13001</tbody></table>
13002
13003</section></div>
13004 </div>
13005</div>
13006
13007<div class='accordion'>
13008 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
13009 <div class='accordion-overflow'>
13010 <div class='accordion-content'><section >
13011
13012
13013
13014
13015<table><thead>
13016 <tr>
13017 <th>Event</th>
13018 <th>Data</th>
13019 <th>Description</th>
13020 </tr>
13021 </thead><tbody>
13022 <tr id='circlemarker-add'>
13023 <td><code><b>add</b></code></td>
13024 <td><code><a href='#event'>Event</a></code></td>
13025 <td>Fired after the layer is added to a map</td>
13026 </tr>
13027 <tr id='circlemarker-remove'>
13028 <td><code><b>remove</b></code></td>
13029 <td><code><a href='#event'>Event</a></code></td>
13030 <td>Fired after the layer is removed from a map</td>
13031 </tr>
13032</tbody></table>
13033
13034</section></div>
13035 </div>
13036</div>
13037
13038<div class='accordion'>
13039 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
13040 <div class='accordion-overflow'>
13041 <div class='accordion-content'><section >
13042
13043
13044
13045
13046<table><thead>
13047 <tr>
13048 <th>Event</th>
13049 <th>Data</th>
13050 <th>Description</th>
13051 </tr>
13052 </thead><tbody>
13053 <tr id='circlemarker-popupopen'>
13054 <td><code><b>popupopen</b></code></td>
13055 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
13056 <td>Fired when a popup bound to this layer is opened</td>
13057 </tr>
13058 <tr id='circlemarker-popupclose'>
13059 <td><code><b>popupclose</b></code></td>
13060 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
13061 <td>Fired when a popup bound to this layer is closed</td>
13062 </tr>
13063</tbody></table>
13064
13065</section></div>
13066 </div>
13067</div>
13068
13069<div class='accordion'>
13070 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
13071 <div class='accordion-overflow'>
13072 <div class='accordion-content'><section >
13073
13074
13075
13076
13077<table><thead>
13078 <tr>
13079 <th>Event</th>
13080 <th>Data</th>
13081 <th>Description</th>
13082 </tr>
13083 </thead><tbody>
13084 <tr id='circlemarker-tooltipopen'>
13085 <td><code><b>tooltipopen</b></code></td>
13086 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
13087 <td>Fired when a tooltip bound to this layer is opened.</td>
13088 </tr>
13089 <tr id='circlemarker-tooltipclose'>
13090 <td><code><b>tooltipclose</b></code></td>
13091 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
13092 <td>Fired when a tooltip bound to this layer is closed.</td>
13093 </tr>
13094</tbody></table>
13095
13096</section></div>
13097 </div>
13098</div>
13099
13100</section><section>
13101<h3 id='circlemarker-method'>Methods</h3>
13102
13103<section >
13104
13105
13106
13107
13108<table><thead>
13109 <tr>
13110 <th>Method</th>
13111 <th>Returns</th>
13112 <th>Description</th>
13113 </tr>
13114 </thead><tbody>
13115 <tr id='circlemarker-togeojson'>
13116 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
13117 <td><code>Object</code></td>
13118 <td><p><code>precision</code> is the number of decimal places for coordinates.
13119The default value is 6 places.
13120Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the circle marker (as a GeoJSON <a href="#point"><code>Point</code></a> Feature).</p>
13121</td>
13122 </tr>
13123 <tr id='circlemarker-setlatlng'>
13124 <td><code><b>setLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latLng</i>)</code></td>
13125 <td><code>this</code></td>
13126 <td><p>Sets the position of a circle marker to a new location.</p>
13127</td>
13128 </tr>
13129 <tr id='circlemarker-getlatlng'>
13130 <td><code><b>getLatLng</b>()</code></td>
13131 <td><code><a href='#latlng'>LatLng</a></code></td>
13132 <td><p>Returns the current geographical position of the circle marker</p>
13133</td>
13134 </tr>
13135 <tr id='circlemarker-setradius'>
13136 <td><code><b>setRadius</b>(<nobr>&lt;Number&gt;</nobr> <i>radius</i>)</code></td>
13137 <td><code>this</code></td>
13138 <td><p>Sets the radius of a circle marker. Units are in pixels.</p>
13139</td>
13140 </tr>
13141 <tr id='circlemarker-getradius'>
13142 <td><code><b>getRadius</b>()</code></td>
13143 <td><code>Number</code></td>
13144 <td><p>Returns the current radius of the circle</p>
13145</td>
13146 </tr>
13147</tbody></table>
13148
13149</section>
13150
13151
13152<div class='accordion'>
13153 <label><span class='expander'></span> Methods inherited from <a href='#path'>Path</a></label>
13154 <div class='accordion-overflow'>
13155 <div class='accordion-content'><section >
13156
13157
13158
13159
13160<table><thead>
13161 <tr>
13162 <th>Method</th>
13163 <th>Returns</th>
13164 <th>Description</th>
13165 </tr>
13166 </thead><tbody>
13167 <tr id='circlemarker-redraw'>
13168 <td><code><b>redraw</b>()</code></td>
13169 <td><code>this</code></td>
13170 <td><p>Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.</p>
13171</td>
13172 </tr>
13173 <tr id='circlemarker-setstyle'>
13174 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
13175 <td><code>this</code></td>
13176 <td><p>Changes the appearance of a Path based on the options in the <a href="#path-option"><code>Path options</code></a> object.</p>
13177</td>
13178 </tr>
13179 <tr id='circlemarker-bringtofront'>
13180 <td><code><b>bringToFront</b>()</code></td>
13181 <td><code>this</code></td>
13182 <td><p>Brings the layer to the top of all path layers.</p>
13183</td>
13184 </tr>
13185 <tr id='circlemarker-bringtoback'>
13186 <td><code><b>bringToBack</b>()</code></td>
13187 <td><code>this</code></td>
13188 <td><p>Brings the layer to the bottom of all path layers.</p>
13189</td>
13190 </tr>
13191</tbody></table>
13192
13193</section></div>
13194 </div>
13195</div>
13196
13197<div class='accordion'>
13198 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
13199 <div class='accordion-overflow'>
13200 <div class='accordion-content'><section >
13201
13202
13203
13204
13205<table><thead>
13206 <tr>
13207 <th>Method</th>
13208 <th>Returns</th>
13209 <th>Description</th>
13210 </tr>
13211 </thead><tbody>
13212 <tr id='circlemarker-addto'>
13213 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
13214 <td><code>this</code></td>
13215 <td><p>Adds the layer to the given map or layer group.</p>
13216</td>
13217 </tr>
13218 <tr id='circlemarker-remove'>
13219 <td><code><b>remove</b>()</code></td>
13220 <td><code>this</code></td>
13221 <td><p>Removes the layer from the map it is currently active on.</p>
13222</td>
13223 </tr>
13224 <tr id='circlemarker-removefrom'>
13225 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
13226 <td><code>this</code></td>
13227 <td><p>Removes the layer from the given map</p>
13228</td>
13229 </tr>
13230 <tr id='circlemarker-removefrom'>
13231 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
13232 <td><code>this</code></td>
13233 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
13234</td>
13235 </tr>
13236 <tr id='circlemarker-getpane'>
13237 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
13238 <td><code>HTMLElement</code></td>
13239 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
13240</td>
13241 </tr>
13242 <tr id='circlemarker-getattribution'>
13243 <td><code><b>getAttribution</b>()</code></td>
13244 <td><code>String</code></td>
13245 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
13246</td>
13247 </tr>
13248</tbody></table>
13249
13250</section></div>
13251 </div>
13252</div>
13253
13254<div class='accordion'>
13255 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
13256 <div class='accordion-overflow'>
13257 <div class='accordion-content'><section >
13258
13259
13260
13261
13262<table><thead>
13263 <tr>
13264 <th>Method</th>
13265 <th>Returns</th>
13266 <th>Description</th>
13267 </tr>
13268 </thead><tbody>
13269 <tr id='circlemarker-bindpopup'>
13270 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
13271 <td><code>this</code></td>
13272 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
13273necessary event listeners. If a <code>Function</code> is passed it will receive
13274the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
13275</td>
13276 </tr>
13277 <tr id='circlemarker-unbindpopup'>
13278 <td><code><b>unbindPopup</b>()</code></td>
13279 <td><code>this</code></td>
13280 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
13281</td>
13282 </tr>
13283 <tr id='circlemarker-openpopup'>
13284 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
13285 <td><code>this</code></td>
13286 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
13287</td>
13288 </tr>
13289 <tr id='circlemarker-closepopup'>
13290 <td><code><b>closePopup</b>()</code></td>
13291 <td><code>this</code></td>
13292 <td><p>Closes the popup bound to this layer if it is open.</p>
13293</td>
13294 </tr>
13295 <tr id='circlemarker-togglepopup'>
13296 <td><code><b>togglePopup</b>()</code></td>
13297 <td><code>this</code></td>
13298 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
13299</td>
13300 </tr>
13301 <tr id='circlemarker-ispopupopen'>
13302 <td><code><b>isPopupOpen</b>()</code></td>
13303 <td><code>boolean</code></td>
13304 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
13305</td>
13306 </tr>
13307 <tr id='circlemarker-setpopupcontent'>
13308 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
13309 <td><code>this</code></td>
13310 <td><p>Sets the content of the popup bound to this layer.</p>
13311</td>
13312 </tr>
13313 <tr id='circlemarker-getpopup'>
13314 <td><code><b>getPopup</b>()</code></td>
13315 <td><code><a href='#popup'>Popup</a></code></td>
13316 <td><p>Returns the popup bound to this layer.</p>
13317</td>
13318 </tr>
13319</tbody></table>
13320
13321</section></div>
13322 </div>
13323</div>
13324
13325<div class='accordion'>
13326 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
13327 <div class='accordion-overflow'>
13328 <div class='accordion-content'><section >
13329
13330
13331
13332
13333<table><thead>
13334 <tr>
13335 <th>Method</th>
13336 <th>Returns</th>
13337 <th>Description</th>
13338 </tr>
13339 </thead><tbody>
13340 <tr id='circlemarker-bindtooltip'>
13341 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
13342 <td><code>this</code></td>
13343 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
13344necessary event listeners. If a <code>Function</code> is passed it will receive
13345the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
13346</td>
13347 </tr>
13348 <tr id='circlemarker-unbindtooltip'>
13349 <td><code><b>unbindTooltip</b>()</code></td>
13350 <td><code>this</code></td>
13351 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
13352</td>
13353 </tr>
13354 <tr id='circlemarker-opentooltip'>
13355 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
13356 <td><code>this</code></td>
13357 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
13358</td>
13359 </tr>
13360 <tr id='circlemarker-closetooltip'>
13361 <td><code><b>closeTooltip</b>()</code></td>
13362 <td><code>this</code></td>
13363 <td><p>Closes the tooltip bound to this layer if it is open.</p>
13364</td>
13365 </tr>
13366 <tr id='circlemarker-toggletooltip'>
13367 <td><code><b>toggleTooltip</b>()</code></td>
13368 <td><code>this</code></td>
13369 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
13370</td>
13371 </tr>
13372 <tr id='circlemarker-istooltipopen'>
13373 <td><code><b>isTooltipOpen</b>()</code></td>
13374 <td><code>boolean</code></td>
13375 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
13376</td>
13377 </tr>
13378 <tr id='circlemarker-settooltipcontent'>
13379 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
13380 <td><code>this</code></td>
13381 <td><p>Sets the content of the tooltip bound to this layer.</p>
13382</td>
13383 </tr>
13384 <tr id='circlemarker-gettooltip'>
13385 <td><code><b>getTooltip</b>()</code></td>
13386 <td><code><a href='#tooltip'>Tooltip</a></code></td>
13387 <td><p>Returns the tooltip bound to this layer.</p>
13388</td>
13389 </tr>
13390</tbody></table>
13391
13392</section></div>
13393 </div>
13394</div>
13395
13396<div class='accordion'>
13397 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
13398 <div class='accordion-overflow'>
13399 <div class='accordion-content'><section >
13400
13401
13402
13403
13404<table><thead>
13405 <tr>
13406 <th>Method</th>
13407 <th>Returns</th>
13408 <th>Description</th>
13409 </tr>
13410 </thead><tbody>
13411 <tr id='circlemarker-on'>
13412 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
13413 <td><code>this</code></td>
13414 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
13415</td>
13416 </tr>
13417 <tr id='circlemarker-on'>
13418 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
13419 <td><code>this</code></td>
13420 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
13421</td>
13422 </tr>
13423 <tr id='circlemarker-off'>
13424 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
13425 <td><code>this</code></td>
13426 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
13427</td>
13428 </tr>
13429 <tr id='circlemarker-off'>
13430 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
13431 <td><code>this</code></td>
13432 <td><p>Removes a set of type/listener pairs.</p>
13433</td>
13434 </tr>
13435 <tr id='circlemarker-off'>
13436 <td><code><b>off</b>()</code></td>
13437 <td><code>this</code></td>
13438 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
13439</td>
13440 </tr>
13441 <tr id='circlemarker-fire'>
13442 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
13443 <td><code>this</code></td>
13444 <td><p>Fires an event of the specified type. You can optionally provide an data
13445object — the first argument of the listener function will contain its
13446properties. The event can optionally be propagated to event parents.</p>
13447</td>
13448 </tr>
13449 <tr id='circlemarker-listens'>
13450 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
13451 <td><code>Boolean</code></td>
13452 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
13453</td>
13454 </tr>
13455 <tr id='circlemarker-once'>
13456 <td><code><b>once</b>(<i></i>)</code></td>
13457 <td><code>this</code></td>
13458 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
13459</td>
13460 </tr>
13461 <tr id='circlemarker-addeventparent'>
13462 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
13463 <td><code>this</code></td>
13464 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
13465</td>
13466 </tr>
13467 <tr id='circlemarker-removeeventparent'>
13468 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
13469 <td><code>this</code></td>
13470 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
13471</td>
13472 </tr>
13473 <tr id='circlemarker-addeventlistener'>
13474 <td><code><b>addEventListener</b>(<i></i>)</code></td>
13475 <td><code>this</code></td>
13476 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
13477</td>
13478 </tr>
13479 <tr id='circlemarker-removeeventlistener'>
13480 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
13481 <td><code>this</code></td>
13482 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
13483</td>
13484 </tr>
13485 <tr id='circlemarker-clearalleventlisteners'>
13486 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
13487 <td><code>this</code></td>
13488 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
13489</td>
13490 </tr>
13491 <tr id='circlemarker-addonetimeeventlistener'>
13492 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
13493 <td><code>this</code></td>
13494 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
13495</td>
13496 </tr>
13497 <tr id='circlemarker-fireevent'>
13498 <td><code><b>fireEvent</b>(<i></i>)</code></td>
13499 <td><code>this</code></td>
13500 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
13501</td>
13502 </tr>
13503 <tr id='circlemarker-haseventlisteners'>
13504 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
13505 <td><code>Boolean</code></td>
13506 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
13507</td>
13508 </tr>
13509</tbody></table>
13510
13511</section></div>
13512 </div>
13513</div>
13514
13515</section><h2 id='svg'>SVG</h2><p>VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
13516with old versions of Internet Explorer.</p>
13517<p>Allows vector layers to be displayed with <a href="https://developer.mozilla.org/docs/Web/SVG">SVG</a>.
13518Inherits <a href="#renderer"><code>Renderer</code></a>.
13519Due to <a href="http://caniuse.com/#search=svg">technical limitations</a>, SVG is not
13520available in all web browsers, notably Android 2.x and 3.x.
13521Although SVG is not available on IE7 and IE8, these browsers support
13522<a href="https://en.wikipedia.org/wiki/Vector_Markup_Language">VML</a>
13523(a now deprecated technology), and the SVG renderer will fall back to VML in
13524this case.</p>
13525
13526<section>
13527<h3 id='svg-example'>Usage example</h3>
13528
13529<section >
13530
13531
13532
13533
13534
13535<p>Use SVG by default for all paths in the map:</p>
13536<pre><code class="lang-js">var map = L.map(&#39;map&#39;, {
13537 renderer: L.svg()
13538});
13539</code></pre>
13540<p>Use a SVG renderer with extra padding for specific vector geometries:</p>
13541<pre><code class="lang-js">var map = L.map(&#39;map&#39;);
13542var myRenderer = L.svg({ padding: 0.5 });
13543var line = L.polyline( coordinates, { renderer: myRenderer } );
13544var circle = L.circle( center, { renderer: myRenderer } );
13545</code></pre>
13546
13547
13548
13549</section>
13550
13551
13552</section><section>
13553<h3 id='svg-factory'>Creation</h3>
13554
13555<section >
13556
13557
13558
13559
13560<table><thead>
13561 <tr>
13562 <th>Factory</th>
13563 <th>Description</th>
13564 </tr>
13565 </thead><tbody>
13566 <tr id='svg-l-svg'>
13567 <td><code><b>L.svg</b>(<nobr>&lt;<a href='#renderer-option'>Renderer options</a>&gt;</nobr> <i>options?</i>)</code></td>
13568 <td>Creates a SVG renderer with the given options.</td>
13569 </tr>
13570</tbody></table>
13571
13572</section>
13573
13574
13575</section><section>
13576<h3 id=''>Options</h3>
13577
13578
13579
13580
13581<div class='accordion'>
13582 <label><span class='expander'></span> Options inherited from <a href='#renderer'>Renderer</a></label>
13583 <div class='accordion-overflow'>
13584 <div class='accordion-content'><section >
13585
13586
13587
13588
13589<table><thead>
13590 <tr>
13591 <th>Option</th>
13592 <th>Type</th>
13593 <th>Default</th>
13594 <th>Description</th>
13595 </tr>
13596 </thead><tbody>
13597 <tr id='svg-padding'>
13598 <td><code><b>padding</b></code></td>
13599 <td><code>Number</code></td>
13600 <td><code>0.1</code></td>
13601 <td>How much to extend the clip area around the map view (relative to its size)
13602e.g. 0.1 would be 10% of map view in each direction</td>
13603 </tr>
13604 <tr id='svg-tolerance'>
13605 <td><code><b>tolerance</b></code></td>
13606 <td><code>Number</code></td>
13607 <td><code>0</code></td>
13608 <td>How much to extend click tolerance round a path/object on the map</td>
13609 </tr>
13610</tbody></table>
13611
13612</section></div>
13613 </div>
13614</div>
13615
13616<div class='accordion'>
13617 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
13618 <div class='accordion-overflow'>
13619 <div class='accordion-content'><section >
13620
13621
13622
13623
13624<table><thead>
13625 <tr>
13626 <th>Option</th>
13627 <th>Type</th>
13628 <th>Default</th>
13629 <th>Description</th>
13630 </tr>
13631 </thead><tbody>
13632 <tr id='svg-pane'>
13633 <td><code><b>pane</b></code></td>
13634 <td><code>String</code></td>
13635 <td><code>&#x27;overlayPane&#x27;</code></td>
13636 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
13637 </tr>
13638 <tr id='svg-attribution'>
13639 <td><code><b>attribution</b></code></td>
13640 <td><code>String</code></td>
13641 <td><code>null</code></td>
13642 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
13643 </tr>
13644</tbody></table>
13645
13646</section></div>
13647 </div>
13648</div>
13649
13650</section><section>
13651<h3 id=''>Events</h3>
13652
13653
13654
13655
13656<div class='accordion'>
13657 <label><span class='expander'></span> Events inherited from <a href='#renderer'>Renderer</a></label>
13658 <div class='accordion-overflow'>
13659 <div class='accordion-content'><section >
13660
13661
13662
13663
13664<table><thead>
13665 <tr>
13666 <th>Event</th>
13667 <th>Data</th>
13668 <th>Description</th>
13669 </tr>
13670 </thead><tbody>
13671 <tr id='svg-update'>
13672 <td><code><b>update</b></code></td>
13673 <td><code><a href='#event'>Event</a></code></td>
13674 <td>Fired when the renderer updates its bounds, center and zoom, for example when
13675its map has moved</td>
13676 </tr>
13677</tbody></table>
13678
13679</section></div>
13680 </div>
13681</div>
13682
13683<div class='accordion'>
13684 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
13685 <div class='accordion-overflow'>
13686 <div class='accordion-content'><section >
13687
13688
13689
13690
13691<table><thead>
13692 <tr>
13693 <th>Event</th>
13694 <th>Data</th>
13695 <th>Description</th>
13696 </tr>
13697 </thead><tbody>
13698 <tr id='svg-add'>
13699 <td><code><b>add</b></code></td>
13700 <td><code><a href='#event'>Event</a></code></td>
13701 <td>Fired after the layer is added to a map</td>
13702 </tr>
13703 <tr id='svg-remove'>
13704 <td><code><b>remove</b></code></td>
13705 <td><code><a href='#event'>Event</a></code></td>
13706 <td>Fired after the layer is removed from a map</td>
13707 </tr>
13708</tbody></table>
13709
13710</section></div>
13711 </div>
13712</div>
13713
13714<div class='accordion'>
13715 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
13716 <div class='accordion-overflow'>
13717 <div class='accordion-content'><section >
13718
13719
13720
13721
13722<table><thead>
13723 <tr>
13724 <th>Event</th>
13725 <th>Data</th>
13726 <th>Description</th>
13727 </tr>
13728 </thead><tbody>
13729 <tr id='svg-popupopen'>
13730 <td><code><b>popupopen</b></code></td>
13731 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
13732 <td>Fired when a popup bound to this layer is opened</td>
13733 </tr>
13734 <tr id='svg-popupclose'>
13735 <td><code><b>popupclose</b></code></td>
13736 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
13737 <td>Fired when a popup bound to this layer is closed</td>
13738 </tr>
13739</tbody></table>
13740
13741</section></div>
13742 </div>
13743</div>
13744
13745<div class='accordion'>
13746 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
13747 <div class='accordion-overflow'>
13748 <div class='accordion-content'><section >
13749
13750
13751
13752
13753<table><thead>
13754 <tr>
13755 <th>Event</th>
13756 <th>Data</th>
13757 <th>Description</th>
13758 </tr>
13759 </thead><tbody>
13760 <tr id='svg-tooltipopen'>
13761 <td><code><b>tooltipopen</b></code></td>
13762 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
13763 <td>Fired when a tooltip bound to this layer is opened.</td>
13764 </tr>
13765 <tr id='svg-tooltipclose'>
13766 <td><code><b>tooltipclose</b></code></td>
13767 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
13768 <td>Fired when a tooltip bound to this layer is closed.</td>
13769 </tr>
13770</tbody></table>
13771
13772</section></div>
13773 </div>
13774</div>
13775
13776</section><section>
13777<h3 id=''>Methods</h3>
13778
13779
13780
13781
13782<div class='accordion'>
13783 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
13784 <div class='accordion-overflow'>
13785 <div class='accordion-content'><section >
13786
13787
13788
13789
13790<table><thead>
13791 <tr>
13792 <th>Method</th>
13793 <th>Returns</th>
13794 <th>Description</th>
13795 </tr>
13796 </thead><tbody>
13797 <tr id='svg-addto'>
13798 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
13799 <td><code>this</code></td>
13800 <td><p>Adds the layer to the given map or layer group.</p>
13801</td>
13802 </tr>
13803 <tr id='svg-remove'>
13804 <td><code><b>remove</b>()</code></td>
13805 <td><code>this</code></td>
13806 <td><p>Removes the layer from the map it is currently active on.</p>
13807</td>
13808 </tr>
13809 <tr id='svg-removefrom'>
13810 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
13811 <td><code>this</code></td>
13812 <td><p>Removes the layer from the given map</p>
13813</td>
13814 </tr>
13815 <tr id='svg-removefrom'>
13816 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
13817 <td><code>this</code></td>
13818 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
13819</td>
13820 </tr>
13821 <tr id='svg-getpane'>
13822 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
13823 <td><code>HTMLElement</code></td>
13824 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
13825</td>
13826 </tr>
13827 <tr id='svg-getattribution'>
13828 <td><code><b>getAttribution</b>()</code></td>
13829 <td><code>String</code></td>
13830 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
13831</td>
13832 </tr>
13833</tbody></table>
13834
13835</section></div>
13836 </div>
13837</div>
13838
13839<div class='accordion'>
13840 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
13841 <div class='accordion-overflow'>
13842 <div class='accordion-content'><section >
13843
13844
13845
13846
13847<table><thead>
13848 <tr>
13849 <th>Method</th>
13850 <th>Returns</th>
13851 <th>Description</th>
13852 </tr>
13853 </thead><tbody>
13854 <tr id='svg-bindpopup'>
13855 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
13856 <td><code>this</code></td>
13857 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
13858necessary event listeners. If a <code>Function</code> is passed it will receive
13859the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
13860</td>
13861 </tr>
13862 <tr id='svg-unbindpopup'>
13863 <td><code><b>unbindPopup</b>()</code></td>
13864 <td><code>this</code></td>
13865 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
13866</td>
13867 </tr>
13868 <tr id='svg-openpopup'>
13869 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
13870 <td><code>this</code></td>
13871 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
13872</td>
13873 </tr>
13874 <tr id='svg-closepopup'>
13875 <td><code><b>closePopup</b>()</code></td>
13876 <td><code>this</code></td>
13877 <td><p>Closes the popup bound to this layer if it is open.</p>
13878</td>
13879 </tr>
13880 <tr id='svg-togglepopup'>
13881 <td><code><b>togglePopup</b>()</code></td>
13882 <td><code>this</code></td>
13883 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
13884</td>
13885 </tr>
13886 <tr id='svg-ispopupopen'>
13887 <td><code><b>isPopupOpen</b>()</code></td>
13888 <td><code>boolean</code></td>
13889 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
13890</td>
13891 </tr>
13892 <tr id='svg-setpopupcontent'>
13893 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
13894 <td><code>this</code></td>
13895 <td><p>Sets the content of the popup bound to this layer.</p>
13896</td>
13897 </tr>
13898 <tr id='svg-getpopup'>
13899 <td><code><b>getPopup</b>()</code></td>
13900 <td><code><a href='#popup'>Popup</a></code></td>
13901 <td><p>Returns the popup bound to this layer.</p>
13902</td>
13903 </tr>
13904</tbody></table>
13905
13906</section></div>
13907 </div>
13908</div>
13909
13910<div class='accordion'>
13911 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
13912 <div class='accordion-overflow'>
13913 <div class='accordion-content'><section >
13914
13915
13916
13917
13918<table><thead>
13919 <tr>
13920 <th>Method</th>
13921 <th>Returns</th>
13922 <th>Description</th>
13923 </tr>
13924 </thead><tbody>
13925 <tr id='svg-bindtooltip'>
13926 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
13927 <td><code>this</code></td>
13928 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
13929necessary event listeners. If a <code>Function</code> is passed it will receive
13930the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
13931</td>
13932 </tr>
13933 <tr id='svg-unbindtooltip'>
13934 <td><code><b>unbindTooltip</b>()</code></td>
13935 <td><code>this</code></td>
13936 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
13937</td>
13938 </tr>
13939 <tr id='svg-opentooltip'>
13940 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
13941 <td><code>this</code></td>
13942 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
13943</td>
13944 </tr>
13945 <tr id='svg-closetooltip'>
13946 <td><code><b>closeTooltip</b>()</code></td>
13947 <td><code>this</code></td>
13948 <td><p>Closes the tooltip bound to this layer if it is open.</p>
13949</td>
13950 </tr>
13951 <tr id='svg-toggletooltip'>
13952 <td><code><b>toggleTooltip</b>()</code></td>
13953 <td><code>this</code></td>
13954 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
13955</td>
13956 </tr>
13957 <tr id='svg-istooltipopen'>
13958 <td><code><b>isTooltipOpen</b>()</code></td>
13959 <td><code>boolean</code></td>
13960 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
13961</td>
13962 </tr>
13963 <tr id='svg-settooltipcontent'>
13964 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
13965 <td><code>this</code></td>
13966 <td><p>Sets the content of the tooltip bound to this layer.</p>
13967</td>
13968 </tr>
13969 <tr id='svg-gettooltip'>
13970 <td><code><b>getTooltip</b>()</code></td>
13971 <td><code><a href='#tooltip'>Tooltip</a></code></td>
13972 <td><p>Returns the tooltip bound to this layer.</p>
13973</td>
13974 </tr>
13975</tbody></table>
13976
13977</section></div>
13978 </div>
13979</div>
13980
13981<div class='accordion'>
13982 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
13983 <div class='accordion-overflow'>
13984 <div class='accordion-content'><section >
13985
13986
13987
13988
13989<table><thead>
13990 <tr>
13991 <th>Method</th>
13992 <th>Returns</th>
13993 <th>Description</th>
13994 </tr>
13995 </thead><tbody>
13996 <tr id='svg-on'>
13997 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
13998 <td><code>this</code></td>
13999 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
14000</td>
14001 </tr>
14002 <tr id='svg-on'>
14003 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
14004 <td><code>this</code></td>
14005 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
14006</td>
14007 </tr>
14008 <tr id='svg-off'>
14009 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
14010 <td><code>this</code></td>
14011 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
14012</td>
14013 </tr>
14014 <tr id='svg-off'>
14015 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
14016 <td><code>this</code></td>
14017 <td><p>Removes a set of type/listener pairs.</p>
14018</td>
14019 </tr>
14020 <tr id='svg-off'>
14021 <td><code><b>off</b>()</code></td>
14022 <td><code>this</code></td>
14023 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
14024</td>
14025 </tr>
14026 <tr id='svg-fire'>
14027 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
14028 <td><code>this</code></td>
14029 <td><p>Fires an event of the specified type. You can optionally provide an data
14030object — the first argument of the listener function will contain its
14031properties. The event can optionally be propagated to event parents.</p>
14032</td>
14033 </tr>
14034 <tr id='svg-listens'>
14035 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
14036 <td><code>Boolean</code></td>
14037 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
14038</td>
14039 </tr>
14040 <tr id='svg-once'>
14041 <td><code><b>once</b>(<i></i>)</code></td>
14042 <td><code>this</code></td>
14043 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
14044</td>
14045 </tr>
14046 <tr id='svg-addeventparent'>
14047 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
14048 <td><code>this</code></td>
14049 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
14050</td>
14051 </tr>
14052 <tr id='svg-removeeventparent'>
14053 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
14054 <td><code>this</code></td>
14055 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
14056</td>
14057 </tr>
14058 <tr id='svg-addeventlistener'>
14059 <td><code><b>addEventListener</b>(<i></i>)</code></td>
14060 <td><code>this</code></td>
14061 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
14062</td>
14063 </tr>
14064 <tr id='svg-removeeventlistener'>
14065 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
14066 <td><code>this</code></td>
14067 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
14068</td>
14069 </tr>
14070 <tr id='svg-clearalleventlisteners'>
14071 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
14072 <td><code>this</code></td>
14073 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
14074</td>
14075 </tr>
14076 <tr id='svg-addonetimeeventlistener'>
14077 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
14078 <td><code>this</code></td>
14079 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
14080</td>
14081 </tr>
14082 <tr id='svg-fireevent'>
14083 <td><code><b>fireEvent</b>(<i></i>)</code></td>
14084 <td><code>this</code></td>
14085 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
14086</td>
14087 </tr>
14088 <tr id='svg-haseventlisteners'>
14089 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
14090 <td><code>Boolean</code></td>
14091 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
14092</td>
14093 </tr>
14094</tbody></table>
14095
14096</section></div>
14097 </div>
14098</div>
14099
14100</section><section>
14101<h3 id='svg-function'>Functions</h3>
14102
14103<section >
14104
14105
14106
14107<div class='section-comments'>There are several static functions which can be called without instantiating L.SVG:</div>
14108
14109<table><thead>
14110 <tr>
14111 <th>Function</th>
14112 <th>Returns</th>
14113 <th>Description</th>
14114 </tr>
14115 </thead><tbody>
14116 <tr id='svg-create'>
14117 <td><code><b>create</b>(<nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
14118 <td><code>SVGElement</code></td>
14119 <td>Returns a instance of <a href="https://developer.mozilla.org/docs/Web/API/SVGElement">SVGElement</a>,
14120corresponding to the class name passed. For example, using &#39;line&#39; will return
14121an instance of <a href="https://developer.mozilla.org/docs/Web/API/SVGLineElement">SVGLineElement</a>.</td>
14122 </tr>
14123 <tr id='svg-pointstopath'>
14124 <td><code><b>pointsToPath</b>(<nobr>&lt;Point[]&gt;</nobr> <i>rings</i>, <nobr>&lt;Boolean&gt;</nobr> <i>closed</i>)</code></td>
14125 <td><code>String</code></td>
14126 <td>Generates a SVG path string for multiple rings, with each ring turning
14127into &quot;M..L..L..&quot; instructions</td>
14128 </tr>
14129</tbody></table>
14130
14131</section>
14132
14133
14134</section><h2 id='canvas'>Canvas</h2><p>Allows vector layers to be displayed with <a href="https://developer.mozilla.org/docs/Web/API/Canvas_API"><code>&lt;canvas&gt;</code></a>.
14135Inherits <a href="#renderer"><code>Renderer</code></a>.
14136Due to <a href="http://caniuse.com/#search=canvas">technical limitations</a>, Canvas is not
14137available in all web browsers, notably IE8, and overlapping geometries might
14138not display properly in some edge cases.</p>
14139
14140<section>
14141<h3 id='canvas-example'>Usage example</h3>
14142
14143<section >
14144
14145
14146
14147
14148
14149<p>Use Canvas by default for all paths in the map:</p>
14150<pre><code class="lang-js">var map = L.map(&#39;map&#39;, {
14151 renderer: L.canvas()
14152});
14153</code></pre>
14154<p>Use a Canvas renderer with extra padding for specific vector geometries:</p>
14155<pre><code class="lang-js">var map = L.map(&#39;map&#39;);
14156var myRenderer = L.canvas({ padding: 0.5 });
14157var line = L.polyline( coordinates, { renderer: myRenderer } );
14158var circle = L.circle( center, { renderer: myRenderer } );
14159</code></pre>
14160
14161
14162
14163</section>
14164
14165
14166</section><section>
14167<h3 id='canvas-factory'>Creation</h3>
14168
14169<section >
14170
14171
14172
14173
14174<table><thead>
14175 <tr>
14176 <th>Factory</th>
14177 <th>Description</th>
14178 </tr>
14179 </thead><tbody>
14180 <tr id='canvas-l-canvas'>
14181 <td><code><b>L.canvas</b>(<nobr>&lt;<a href='#renderer-option'>Renderer options</a>&gt;</nobr> <i>options?</i>)</code></td>
14182 <td>Creates a Canvas renderer with the given options.</td>
14183 </tr>
14184</tbody></table>
14185
14186</section>
14187
14188
14189</section><section>
14190<h3 id=''>Options</h3>
14191
14192
14193
14194
14195<div class='accordion'>
14196 <label><span class='expander'></span> Options inherited from <a href='#renderer'>Renderer</a></label>
14197 <div class='accordion-overflow'>
14198 <div class='accordion-content'><section >
14199
14200
14201
14202
14203<table><thead>
14204 <tr>
14205 <th>Option</th>
14206 <th>Type</th>
14207 <th>Default</th>
14208 <th>Description</th>
14209 </tr>
14210 </thead><tbody>
14211 <tr id='canvas-padding'>
14212 <td><code><b>padding</b></code></td>
14213 <td><code>Number</code></td>
14214 <td><code>0.1</code></td>
14215 <td>How much to extend the clip area around the map view (relative to its size)
14216e.g. 0.1 would be 10% of map view in each direction</td>
14217 </tr>
14218 <tr id='canvas-tolerance'>
14219 <td><code><b>tolerance</b></code></td>
14220 <td><code>Number</code></td>
14221 <td><code>0</code></td>
14222 <td>How much to extend click tolerance round a path/object on the map</td>
14223 </tr>
14224</tbody></table>
14225
14226</section></div>
14227 </div>
14228</div>
14229
14230<div class='accordion'>
14231 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
14232 <div class='accordion-overflow'>
14233 <div class='accordion-content'><section >
14234
14235
14236
14237
14238<table><thead>
14239 <tr>
14240 <th>Option</th>
14241 <th>Type</th>
14242 <th>Default</th>
14243 <th>Description</th>
14244 </tr>
14245 </thead><tbody>
14246 <tr id='canvas-pane'>
14247 <td><code><b>pane</b></code></td>
14248 <td><code>String</code></td>
14249 <td><code>&#x27;overlayPane&#x27;</code></td>
14250 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
14251 </tr>
14252 <tr id='canvas-attribution'>
14253 <td><code><b>attribution</b></code></td>
14254 <td><code>String</code></td>
14255 <td><code>null</code></td>
14256 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
14257 </tr>
14258</tbody></table>
14259
14260</section></div>
14261 </div>
14262</div>
14263
14264</section><section>
14265<h3 id=''>Events</h3>
14266
14267
14268
14269
14270<div class='accordion'>
14271 <label><span class='expander'></span> Events inherited from <a href='#renderer'>Renderer</a></label>
14272 <div class='accordion-overflow'>
14273 <div class='accordion-content'><section >
14274
14275
14276
14277
14278<table><thead>
14279 <tr>
14280 <th>Event</th>
14281 <th>Data</th>
14282 <th>Description</th>
14283 </tr>
14284 </thead><tbody>
14285 <tr id='canvas-update'>
14286 <td><code><b>update</b></code></td>
14287 <td><code><a href='#event'>Event</a></code></td>
14288 <td>Fired when the renderer updates its bounds, center and zoom, for example when
14289its map has moved</td>
14290 </tr>
14291</tbody></table>
14292
14293</section></div>
14294 </div>
14295</div>
14296
14297<div class='accordion'>
14298 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
14299 <div class='accordion-overflow'>
14300 <div class='accordion-content'><section >
14301
14302
14303
14304
14305<table><thead>
14306 <tr>
14307 <th>Event</th>
14308 <th>Data</th>
14309 <th>Description</th>
14310 </tr>
14311 </thead><tbody>
14312 <tr id='canvas-add'>
14313 <td><code><b>add</b></code></td>
14314 <td><code><a href='#event'>Event</a></code></td>
14315 <td>Fired after the layer is added to a map</td>
14316 </tr>
14317 <tr id='canvas-remove'>
14318 <td><code><b>remove</b></code></td>
14319 <td><code><a href='#event'>Event</a></code></td>
14320 <td>Fired after the layer is removed from a map</td>
14321 </tr>
14322</tbody></table>
14323
14324</section></div>
14325 </div>
14326</div>
14327
14328<div class='accordion'>
14329 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
14330 <div class='accordion-overflow'>
14331 <div class='accordion-content'><section >
14332
14333
14334
14335
14336<table><thead>
14337 <tr>
14338 <th>Event</th>
14339 <th>Data</th>
14340 <th>Description</th>
14341 </tr>
14342 </thead><tbody>
14343 <tr id='canvas-popupopen'>
14344 <td><code><b>popupopen</b></code></td>
14345 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
14346 <td>Fired when a popup bound to this layer is opened</td>
14347 </tr>
14348 <tr id='canvas-popupclose'>
14349 <td><code><b>popupclose</b></code></td>
14350 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
14351 <td>Fired when a popup bound to this layer is closed</td>
14352 </tr>
14353</tbody></table>
14354
14355</section></div>
14356 </div>
14357</div>
14358
14359<div class='accordion'>
14360 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
14361 <div class='accordion-overflow'>
14362 <div class='accordion-content'><section >
14363
14364
14365
14366
14367<table><thead>
14368 <tr>
14369 <th>Event</th>
14370 <th>Data</th>
14371 <th>Description</th>
14372 </tr>
14373 </thead><tbody>
14374 <tr id='canvas-tooltipopen'>
14375 <td><code><b>tooltipopen</b></code></td>
14376 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
14377 <td>Fired when a tooltip bound to this layer is opened.</td>
14378 </tr>
14379 <tr id='canvas-tooltipclose'>
14380 <td><code><b>tooltipclose</b></code></td>
14381 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
14382 <td>Fired when a tooltip bound to this layer is closed.</td>
14383 </tr>
14384</tbody></table>
14385
14386</section></div>
14387 </div>
14388</div>
14389
14390</section><section>
14391<h3 id=''>Methods</h3>
14392
14393
14394
14395
14396<div class='accordion'>
14397 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
14398 <div class='accordion-overflow'>
14399 <div class='accordion-content'><section >
14400
14401
14402
14403
14404<table><thead>
14405 <tr>
14406 <th>Method</th>
14407 <th>Returns</th>
14408 <th>Description</th>
14409 </tr>
14410 </thead><tbody>
14411 <tr id='canvas-addto'>
14412 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
14413 <td><code>this</code></td>
14414 <td><p>Adds the layer to the given map or layer group.</p>
14415</td>
14416 </tr>
14417 <tr id='canvas-remove'>
14418 <td><code><b>remove</b>()</code></td>
14419 <td><code>this</code></td>
14420 <td><p>Removes the layer from the map it is currently active on.</p>
14421</td>
14422 </tr>
14423 <tr id='canvas-removefrom'>
14424 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
14425 <td><code>this</code></td>
14426 <td><p>Removes the layer from the given map</p>
14427</td>
14428 </tr>
14429 <tr id='canvas-removefrom'>
14430 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
14431 <td><code>this</code></td>
14432 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
14433</td>
14434 </tr>
14435 <tr id='canvas-getpane'>
14436 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
14437 <td><code>HTMLElement</code></td>
14438 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
14439</td>
14440 </tr>
14441 <tr id='canvas-getattribution'>
14442 <td><code><b>getAttribution</b>()</code></td>
14443 <td><code>String</code></td>
14444 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
14445</td>
14446 </tr>
14447</tbody></table>
14448
14449</section></div>
14450 </div>
14451</div>
14452
14453<div class='accordion'>
14454 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
14455 <div class='accordion-overflow'>
14456 <div class='accordion-content'><section >
14457
14458
14459
14460
14461<table><thead>
14462 <tr>
14463 <th>Method</th>
14464 <th>Returns</th>
14465 <th>Description</th>
14466 </tr>
14467 </thead><tbody>
14468 <tr id='canvas-bindpopup'>
14469 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
14470 <td><code>this</code></td>
14471 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
14472necessary event listeners. If a <code>Function</code> is passed it will receive
14473the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
14474</td>
14475 </tr>
14476 <tr id='canvas-unbindpopup'>
14477 <td><code><b>unbindPopup</b>()</code></td>
14478 <td><code>this</code></td>
14479 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
14480</td>
14481 </tr>
14482 <tr id='canvas-openpopup'>
14483 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
14484 <td><code>this</code></td>
14485 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
14486</td>
14487 </tr>
14488 <tr id='canvas-closepopup'>
14489 <td><code><b>closePopup</b>()</code></td>
14490 <td><code>this</code></td>
14491 <td><p>Closes the popup bound to this layer if it is open.</p>
14492</td>
14493 </tr>
14494 <tr id='canvas-togglepopup'>
14495 <td><code><b>togglePopup</b>()</code></td>
14496 <td><code>this</code></td>
14497 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
14498</td>
14499 </tr>
14500 <tr id='canvas-ispopupopen'>
14501 <td><code><b>isPopupOpen</b>()</code></td>
14502 <td><code>boolean</code></td>
14503 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
14504</td>
14505 </tr>
14506 <tr id='canvas-setpopupcontent'>
14507 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
14508 <td><code>this</code></td>
14509 <td><p>Sets the content of the popup bound to this layer.</p>
14510</td>
14511 </tr>
14512 <tr id='canvas-getpopup'>
14513 <td><code><b>getPopup</b>()</code></td>
14514 <td><code><a href='#popup'>Popup</a></code></td>
14515 <td><p>Returns the popup bound to this layer.</p>
14516</td>
14517 </tr>
14518</tbody></table>
14519
14520</section></div>
14521 </div>
14522</div>
14523
14524<div class='accordion'>
14525 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
14526 <div class='accordion-overflow'>
14527 <div class='accordion-content'><section >
14528
14529
14530
14531
14532<table><thead>
14533 <tr>
14534 <th>Method</th>
14535 <th>Returns</th>
14536 <th>Description</th>
14537 </tr>
14538 </thead><tbody>
14539 <tr id='canvas-bindtooltip'>
14540 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
14541 <td><code>this</code></td>
14542 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
14543necessary event listeners. If a <code>Function</code> is passed it will receive
14544the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
14545</td>
14546 </tr>
14547 <tr id='canvas-unbindtooltip'>
14548 <td><code><b>unbindTooltip</b>()</code></td>
14549 <td><code>this</code></td>
14550 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
14551</td>
14552 </tr>
14553 <tr id='canvas-opentooltip'>
14554 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
14555 <td><code>this</code></td>
14556 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
14557</td>
14558 </tr>
14559 <tr id='canvas-closetooltip'>
14560 <td><code><b>closeTooltip</b>()</code></td>
14561 <td><code>this</code></td>
14562 <td><p>Closes the tooltip bound to this layer if it is open.</p>
14563</td>
14564 </tr>
14565 <tr id='canvas-toggletooltip'>
14566 <td><code><b>toggleTooltip</b>()</code></td>
14567 <td><code>this</code></td>
14568 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
14569</td>
14570 </tr>
14571 <tr id='canvas-istooltipopen'>
14572 <td><code><b>isTooltipOpen</b>()</code></td>
14573 <td><code>boolean</code></td>
14574 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
14575</td>
14576 </tr>
14577 <tr id='canvas-settooltipcontent'>
14578 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
14579 <td><code>this</code></td>
14580 <td><p>Sets the content of the tooltip bound to this layer.</p>
14581</td>
14582 </tr>
14583 <tr id='canvas-gettooltip'>
14584 <td><code><b>getTooltip</b>()</code></td>
14585 <td><code><a href='#tooltip'>Tooltip</a></code></td>
14586 <td><p>Returns the tooltip bound to this layer.</p>
14587</td>
14588 </tr>
14589</tbody></table>
14590
14591</section></div>
14592 </div>
14593</div>
14594
14595<div class='accordion'>
14596 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
14597 <div class='accordion-overflow'>
14598 <div class='accordion-content'><section >
14599
14600
14601
14602
14603<table><thead>
14604 <tr>
14605 <th>Method</th>
14606 <th>Returns</th>
14607 <th>Description</th>
14608 </tr>
14609 </thead><tbody>
14610 <tr id='canvas-on'>
14611 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
14612 <td><code>this</code></td>
14613 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
14614</td>
14615 </tr>
14616 <tr id='canvas-on'>
14617 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
14618 <td><code>this</code></td>
14619 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
14620</td>
14621 </tr>
14622 <tr id='canvas-off'>
14623 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
14624 <td><code>this</code></td>
14625 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
14626</td>
14627 </tr>
14628 <tr id='canvas-off'>
14629 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
14630 <td><code>this</code></td>
14631 <td><p>Removes a set of type/listener pairs.</p>
14632</td>
14633 </tr>
14634 <tr id='canvas-off'>
14635 <td><code><b>off</b>()</code></td>
14636 <td><code>this</code></td>
14637 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
14638</td>
14639 </tr>
14640 <tr id='canvas-fire'>
14641 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
14642 <td><code>this</code></td>
14643 <td><p>Fires an event of the specified type. You can optionally provide an data
14644object — the first argument of the listener function will contain its
14645properties. The event can optionally be propagated to event parents.</p>
14646</td>
14647 </tr>
14648 <tr id='canvas-listens'>
14649 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
14650 <td><code>Boolean</code></td>
14651 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
14652</td>
14653 </tr>
14654 <tr id='canvas-once'>
14655 <td><code><b>once</b>(<i></i>)</code></td>
14656 <td><code>this</code></td>
14657 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
14658</td>
14659 </tr>
14660 <tr id='canvas-addeventparent'>
14661 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
14662 <td><code>this</code></td>
14663 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
14664</td>
14665 </tr>
14666 <tr id='canvas-removeeventparent'>
14667 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
14668 <td><code>this</code></td>
14669 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
14670</td>
14671 </tr>
14672 <tr id='canvas-addeventlistener'>
14673 <td><code><b>addEventListener</b>(<i></i>)</code></td>
14674 <td><code>this</code></td>
14675 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
14676</td>
14677 </tr>
14678 <tr id='canvas-removeeventlistener'>
14679 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
14680 <td><code>this</code></td>
14681 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
14682</td>
14683 </tr>
14684 <tr id='canvas-clearalleventlisteners'>
14685 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
14686 <td><code>this</code></td>
14687 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
14688</td>
14689 </tr>
14690 <tr id='canvas-addonetimeeventlistener'>
14691 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
14692 <td><code>this</code></td>
14693 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
14694</td>
14695 </tr>
14696 <tr id='canvas-fireevent'>
14697 <td><code><b>fireEvent</b>(<i></i>)</code></td>
14698 <td><code>this</code></td>
14699 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
14700</td>
14701 </tr>
14702 <tr id='canvas-haseventlisteners'>
14703 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
14704 <td><code>Boolean</code></td>
14705 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
14706</td>
14707 </tr>
14708</tbody></table>
14709
14710</section></div>
14711 </div>
14712</div>
14713
14714</section><h2 id='layergroup'>LayerGroup</h2><p>Used to group several layers and handle them as one. If you add it to the map,
14715any layers added or removed from the group will be added/removed on the map as
14716well. Extends <a href="#layer"><code>Layer</code></a>.</p>
14717
14718<section>
14719<h3 id='layergroup-example'>Usage example</h3>
14720
14721<section >
14722
14723
14724
14725
14726
14727<pre><code class="lang-js">L.layerGroup([marker1, marker2])
14728 .addLayer(polyline)
14729 .addTo(map);
14730</code></pre>
14731
14732
14733
14734</section>
14735
14736
14737</section><section>
14738<h3 id='layergroup-factory'>Creation</h3>
14739
14740<section >
14741
14742
14743
14744
14745<table><thead>
14746 <tr>
14747 <th>Factory</th>
14748 <th>Description</th>
14749 </tr>
14750 </thead><tbody>
14751 <tr id='layergroup-l-layergroup'>
14752 <td><code><b>L.layerGroup</b>(<nobr>&lt;Layer[]&gt;</nobr> <i>layers?</i>, <nobr>&lt;Object&gt;</nobr> <i>options?</i>)</code></td>
14753 <td>Create a layer group, optionally given an initial set of layers and an <code>options</code> object.</td>
14754 </tr>
14755</tbody></table>
14756
14757</section>
14758
14759
14760</section><section>
14761<h3 id=''>Options</h3>
14762
14763
14764
14765
14766<div class='accordion'>
14767 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
14768 <div class='accordion-overflow'>
14769 <div class='accordion-content'><section >
14770
14771
14772
14773
14774<table><thead>
14775 <tr>
14776 <th>Option</th>
14777 <th>Type</th>
14778 <th>Default</th>
14779 <th>Description</th>
14780 </tr>
14781 </thead><tbody>
14782 <tr id='layergroup-pane'>
14783 <td><code><b>pane</b></code></td>
14784 <td><code>String</code></td>
14785 <td><code>&#x27;overlayPane&#x27;</code></td>
14786 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
14787 </tr>
14788 <tr id='layergroup-attribution'>
14789 <td><code><b>attribution</b></code></td>
14790 <td><code>String</code></td>
14791 <td><code>null</code></td>
14792 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
14793 </tr>
14794</tbody></table>
14795
14796</section></div>
14797 </div>
14798</div>
14799
14800</section><section>
14801<h3 id=''>Events</h3>
14802
14803
14804
14805
14806<div class='accordion'>
14807 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
14808 <div class='accordion-overflow'>
14809 <div class='accordion-content'><section >
14810
14811
14812
14813
14814<table><thead>
14815 <tr>
14816 <th>Event</th>
14817 <th>Data</th>
14818 <th>Description</th>
14819 </tr>
14820 </thead><tbody>
14821 <tr id='layergroup-add'>
14822 <td><code><b>add</b></code></td>
14823 <td><code><a href='#event'>Event</a></code></td>
14824 <td>Fired after the layer is added to a map</td>
14825 </tr>
14826 <tr id='layergroup-remove'>
14827 <td><code><b>remove</b></code></td>
14828 <td><code><a href='#event'>Event</a></code></td>
14829 <td>Fired after the layer is removed from a map</td>
14830 </tr>
14831</tbody></table>
14832
14833</section></div>
14834 </div>
14835</div>
14836
14837<div class='accordion'>
14838 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
14839 <div class='accordion-overflow'>
14840 <div class='accordion-content'><section >
14841
14842
14843
14844
14845<table><thead>
14846 <tr>
14847 <th>Event</th>
14848 <th>Data</th>
14849 <th>Description</th>
14850 </tr>
14851 </thead><tbody>
14852 <tr id='layergroup-popupopen'>
14853 <td><code><b>popupopen</b></code></td>
14854 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
14855 <td>Fired when a popup bound to this layer is opened</td>
14856 </tr>
14857 <tr id='layergroup-popupclose'>
14858 <td><code><b>popupclose</b></code></td>
14859 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
14860 <td>Fired when a popup bound to this layer is closed</td>
14861 </tr>
14862</tbody></table>
14863
14864</section></div>
14865 </div>
14866</div>
14867
14868<div class='accordion'>
14869 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
14870 <div class='accordion-overflow'>
14871 <div class='accordion-content'><section >
14872
14873
14874
14875
14876<table><thead>
14877 <tr>
14878 <th>Event</th>
14879 <th>Data</th>
14880 <th>Description</th>
14881 </tr>
14882 </thead><tbody>
14883 <tr id='layergroup-tooltipopen'>
14884 <td><code><b>tooltipopen</b></code></td>
14885 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
14886 <td>Fired when a tooltip bound to this layer is opened.</td>
14887 </tr>
14888 <tr id='layergroup-tooltipclose'>
14889 <td><code><b>tooltipclose</b></code></td>
14890 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
14891 <td>Fired when a tooltip bound to this layer is closed.</td>
14892 </tr>
14893</tbody></table>
14894
14895</section></div>
14896 </div>
14897</div>
14898
14899</section><section>
14900<h3 id='layergroup-method'>Methods</h3>
14901
14902<section >
14903
14904
14905
14906
14907<table><thead>
14908 <tr>
14909 <th>Method</th>
14910 <th>Returns</th>
14911 <th>Description</th>
14912 </tr>
14913 </thead><tbody>
14914 <tr id='layergroup-togeojson'>
14915 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
14916 <td><code>Object</code></td>
14917 <td><p><code>precision</code> is the number of decimal places for coordinates.
14918The default value is 6 places.
14919Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the layer group (as a GeoJSON <code>FeatureCollection</code>, <code>GeometryCollection</code>, or <code>MultiPoint</code>).</p>
14920</td>
14921 </tr>
14922 <tr id='layergroup-addlayer'>
14923 <td><code><b>addLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
14924 <td><code>this</code></td>
14925 <td><p>Adds the given layer to the group.</p>
14926</td>
14927 </tr>
14928 <tr id='layergroup-removelayer'>
14929 <td><code><b>removeLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
14930 <td><code>this</code></td>
14931 <td><p>Removes the given layer from the group.</p>
14932</td>
14933 </tr>
14934 <tr id='layergroup-removelayer'>
14935 <td><code><b>removeLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
14936 <td><code>this</code></td>
14937 <td><p>Removes the layer with the given internal ID from the group.</p>
14938</td>
14939 </tr>
14940 <tr id='layergroup-haslayer'>
14941 <td><code><b>hasLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
14942 <td><code>Boolean</code></td>
14943 <td><p>Returns <code>true</code> if the given layer is currently added to the group.</p>
14944</td>
14945 </tr>
14946 <tr id='layergroup-haslayer'>
14947 <td><code><b>hasLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
14948 <td><code>Boolean</code></td>
14949 <td><p>Returns <code>true</code> if the given internal ID is currently added to the group.</p>
14950</td>
14951 </tr>
14952 <tr id='layergroup-clearlayers'>
14953 <td><code><b>clearLayers</b>()</code></td>
14954 <td><code>this</code></td>
14955 <td><p>Removes all the layers from the group.</p>
14956</td>
14957 </tr>
14958 <tr id='layergroup-invoke'>
14959 <td><code><b>invoke</b>(<nobr>&lt;String&gt;</nobr> <i>methodName</i>, <i></i>)</code></td>
14960 <td><code>this</code></td>
14961 <td><p>Calls <code>methodName</code> on every layer contained in this group, passing any
14962additional parameters. Has no effect if the layers contained do not
14963implement <code>methodName</code>.</p>
14964</td>
14965 </tr>
14966 <tr id='layergroup-eachlayer'>
14967 <td><code><b>eachLayer</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
14968 <td><code>this</code></td>
14969 <td><p>Iterates over the layers of the group, optionally specifying context of the iterator function.</p>
14970<pre><code class="lang-js">group.eachLayer(function (layer) {
14971 layer.bindPopup(&#39;Hello&#39;);
14972});
14973</code></pre>
14974</td>
14975 </tr>
14976 <tr id='layergroup-getlayer'>
14977 <td><code><b>getLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
14978 <td><code><a href='#layer'>Layer</a></code></td>
14979 <td><p>Returns the layer with the given internal ID.</p>
14980</td>
14981 </tr>
14982 <tr id='layergroup-getlayers'>
14983 <td><code><b>getLayers</b>()</code></td>
14984 <td><code>Layer[]</code></td>
14985 <td><p>Returns an array of all the layers added to the group.</p>
14986</td>
14987 </tr>
14988 <tr id='layergroup-setzindex'>
14989 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
14990 <td><code>this</code></td>
14991 <td><p>Calls <code>setZIndex</code> on every layer contained in this group, passing the z-index.</p>
14992</td>
14993 </tr>
14994 <tr id='layergroup-getlayerid'>
14995 <td><code><b>getLayerId</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
14996 <td><code>Number</code></td>
14997 <td><p>Returns the internal ID for a layer</p>
14998</td>
14999 </tr>
15000</tbody></table>
15001
15002</section>
15003
15004
15005<div class='accordion'>
15006 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
15007 <div class='accordion-overflow'>
15008 <div class='accordion-content'><section >
15009
15010
15011
15012
15013<table><thead>
15014 <tr>
15015 <th>Method</th>
15016 <th>Returns</th>
15017 <th>Description</th>
15018 </tr>
15019 </thead><tbody>
15020 <tr id='layergroup-addto'>
15021 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
15022 <td><code>this</code></td>
15023 <td><p>Adds the layer to the given map or layer group.</p>
15024</td>
15025 </tr>
15026 <tr id='layergroup-remove'>
15027 <td><code><b>remove</b>()</code></td>
15028 <td><code>this</code></td>
15029 <td><p>Removes the layer from the map it is currently active on.</p>
15030</td>
15031 </tr>
15032 <tr id='layergroup-removefrom'>
15033 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
15034 <td><code>this</code></td>
15035 <td><p>Removes the layer from the given map</p>
15036</td>
15037 </tr>
15038 <tr id='layergroup-removefrom'>
15039 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
15040 <td><code>this</code></td>
15041 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
15042</td>
15043 </tr>
15044 <tr id='layergroup-getpane'>
15045 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
15046 <td><code>HTMLElement</code></td>
15047 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
15048</td>
15049 </tr>
15050 <tr id='layergroup-getattribution'>
15051 <td><code><b>getAttribution</b>()</code></td>
15052 <td><code>String</code></td>
15053 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
15054</td>
15055 </tr>
15056</tbody></table>
15057
15058</section></div>
15059 </div>
15060</div>
15061
15062<div class='accordion'>
15063 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
15064 <div class='accordion-overflow'>
15065 <div class='accordion-content'><section >
15066
15067
15068
15069
15070<table><thead>
15071 <tr>
15072 <th>Method</th>
15073 <th>Returns</th>
15074 <th>Description</th>
15075 </tr>
15076 </thead><tbody>
15077 <tr id='layergroup-bindpopup'>
15078 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
15079 <td><code>this</code></td>
15080 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
15081necessary event listeners. If a <code>Function</code> is passed it will receive
15082the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
15083</td>
15084 </tr>
15085 <tr id='layergroup-unbindpopup'>
15086 <td><code><b>unbindPopup</b>()</code></td>
15087 <td><code>this</code></td>
15088 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
15089</td>
15090 </tr>
15091 <tr id='layergroup-openpopup'>
15092 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
15093 <td><code>this</code></td>
15094 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
15095</td>
15096 </tr>
15097 <tr id='layergroup-closepopup'>
15098 <td><code><b>closePopup</b>()</code></td>
15099 <td><code>this</code></td>
15100 <td><p>Closes the popup bound to this layer if it is open.</p>
15101</td>
15102 </tr>
15103 <tr id='layergroup-togglepopup'>
15104 <td><code><b>togglePopup</b>()</code></td>
15105 <td><code>this</code></td>
15106 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
15107</td>
15108 </tr>
15109 <tr id='layergroup-ispopupopen'>
15110 <td><code><b>isPopupOpen</b>()</code></td>
15111 <td><code>boolean</code></td>
15112 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
15113</td>
15114 </tr>
15115 <tr id='layergroup-setpopupcontent'>
15116 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
15117 <td><code>this</code></td>
15118 <td><p>Sets the content of the popup bound to this layer.</p>
15119</td>
15120 </tr>
15121 <tr id='layergroup-getpopup'>
15122 <td><code><b>getPopup</b>()</code></td>
15123 <td><code><a href='#popup'>Popup</a></code></td>
15124 <td><p>Returns the popup bound to this layer.</p>
15125</td>
15126 </tr>
15127</tbody></table>
15128
15129</section></div>
15130 </div>
15131</div>
15132
15133<div class='accordion'>
15134 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
15135 <div class='accordion-overflow'>
15136 <div class='accordion-content'><section >
15137
15138
15139
15140
15141<table><thead>
15142 <tr>
15143 <th>Method</th>
15144 <th>Returns</th>
15145 <th>Description</th>
15146 </tr>
15147 </thead><tbody>
15148 <tr id='layergroup-bindtooltip'>
15149 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
15150 <td><code>this</code></td>
15151 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
15152necessary event listeners. If a <code>Function</code> is passed it will receive
15153the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
15154</td>
15155 </tr>
15156 <tr id='layergroup-unbindtooltip'>
15157 <td><code><b>unbindTooltip</b>()</code></td>
15158 <td><code>this</code></td>
15159 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
15160</td>
15161 </tr>
15162 <tr id='layergroup-opentooltip'>
15163 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
15164 <td><code>this</code></td>
15165 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
15166</td>
15167 </tr>
15168 <tr id='layergroup-closetooltip'>
15169 <td><code><b>closeTooltip</b>()</code></td>
15170 <td><code>this</code></td>
15171 <td><p>Closes the tooltip bound to this layer if it is open.</p>
15172</td>
15173 </tr>
15174 <tr id='layergroup-toggletooltip'>
15175 <td><code><b>toggleTooltip</b>()</code></td>
15176 <td><code>this</code></td>
15177 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
15178</td>
15179 </tr>
15180 <tr id='layergroup-istooltipopen'>
15181 <td><code><b>isTooltipOpen</b>()</code></td>
15182 <td><code>boolean</code></td>
15183 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
15184</td>
15185 </tr>
15186 <tr id='layergroup-settooltipcontent'>
15187 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
15188 <td><code>this</code></td>
15189 <td><p>Sets the content of the tooltip bound to this layer.</p>
15190</td>
15191 </tr>
15192 <tr id='layergroup-gettooltip'>
15193 <td><code><b>getTooltip</b>()</code></td>
15194 <td><code><a href='#tooltip'>Tooltip</a></code></td>
15195 <td><p>Returns the tooltip bound to this layer.</p>
15196</td>
15197 </tr>
15198</tbody></table>
15199
15200</section></div>
15201 </div>
15202</div>
15203
15204<div class='accordion'>
15205 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
15206 <div class='accordion-overflow'>
15207 <div class='accordion-content'><section >
15208
15209
15210
15211
15212<table><thead>
15213 <tr>
15214 <th>Method</th>
15215 <th>Returns</th>
15216 <th>Description</th>
15217 </tr>
15218 </thead><tbody>
15219 <tr id='layergroup-on'>
15220 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
15221 <td><code>this</code></td>
15222 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
15223</td>
15224 </tr>
15225 <tr id='layergroup-on'>
15226 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
15227 <td><code>this</code></td>
15228 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
15229</td>
15230 </tr>
15231 <tr id='layergroup-off'>
15232 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
15233 <td><code>this</code></td>
15234 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
15235</td>
15236 </tr>
15237 <tr id='layergroup-off'>
15238 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
15239 <td><code>this</code></td>
15240 <td><p>Removes a set of type/listener pairs.</p>
15241</td>
15242 </tr>
15243 <tr id='layergroup-off'>
15244 <td><code><b>off</b>()</code></td>
15245 <td><code>this</code></td>
15246 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
15247</td>
15248 </tr>
15249 <tr id='layergroup-fire'>
15250 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
15251 <td><code>this</code></td>
15252 <td><p>Fires an event of the specified type. You can optionally provide an data
15253object — the first argument of the listener function will contain its
15254properties. The event can optionally be propagated to event parents.</p>
15255</td>
15256 </tr>
15257 <tr id='layergroup-listens'>
15258 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
15259 <td><code>Boolean</code></td>
15260 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
15261</td>
15262 </tr>
15263 <tr id='layergroup-once'>
15264 <td><code><b>once</b>(<i></i>)</code></td>
15265 <td><code>this</code></td>
15266 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
15267</td>
15268 </tr>
15269 <tr id='layergroup-addeventparent'>
15270 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
15271 <td><code>this</code></td>
15272 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
15273</td>
15274 </tr>
15275 <tr id='layergroup-removeeventparent'>
15276 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
15277 <td><code>this</code></td>
15278 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
15279</td>
15280 </tr>
15281 <tr id='layergroup-addeventlistener'>
15282 <td><code><b>addEventListener</b>(<i></i>)</code></td>
15283 <td><code>this</code></td>
15284 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
15285</td>
15286 </tr>
15287 <tr id='layergroup-removeeventlistener'>
15288 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
15289 <td><code>this</code></td>
15290 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
15291</td>
15292 </tr>
15293 <tr id='layergroup-clearalleventlisteners'>
15294 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
15295 <td><code>this</code></td>
15296 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
15297</td>
15298 </tr>
15299 <tr id='layergroup-addonetimeeventlistener'>
15300 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
15301 <td><code>this</code></td>
15302 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
15303</td>
15304 </tr>
15305 <tr id='layergroup-fireevent'>
15306 <td><code><b>fireEvent</b>(<i></i>)</code></td>
15307 <td><code>this</code></td>
15308 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
15309</td>
15310 </tr>
15311 <tr id='layergroup-haseventlisteners'>
15312 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
15313 <td><code>Boolean</code></td>
15314 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
15315</td>
15316 </tr>
15317</tbody></table>
15318
15319</section></div>
15320 </div>
15321</div>
15322
15323</section><h2 id='featuregroup'>FeatureGroup</h2><p>Extended <a href="#layergroup"><code>LayerGroup</code></a> that makes it easier to do the same thing to all its member layers:</p>
15324<ul>
15325<li><a href="#layer-bindpopup"><code>bindPopup</code></a> binds a popup to all of the layers at once (likewise with <a href="#layer-bindtooltip"><code>bindTooltip</code></a>)</li>
15326<li>Events are propagated to the <a href="#featuregroup"><code>FeatureGroup</code></a>, so if the group has an event
15327handler, it will handle events from any of the layers. This includes mouse events
15328and custom events.</li>
15329<li>Has <code>layeradd</code> and <code>layerremove</code> events</li>
15330</ul>
15331
15332<section>
15333<h3 id='featuregroup-example'>Usage example</h3>
15334
15335<section >
15336
15337
15338
15339
15340
15341<pre><code class="lang-js">L.featureGroup([marker1, marker2, polyline])
15342 .bindPopup(&#39;Hello world!&#39;)
15343 .on(&#39;click&#39;, function() { alert(&#39;Clicked on a member of the group!&#39;); })
15344 .addTo(map);
15345</code></pre>
15346
15347
15348
15349</section>
15350
15351
15352</section><section>
15353<h3 id='featuregroup-factory'>Creation</h3>
15354
15355<section >
15356
15357
15358
15359
15360<table><thead>
15361 <tr>
15362 <th>Factory</th>
15363 <th>Description</th>
15364 </tr>
15365 </thead><tbody>
15366 <tr id='featuregroup-l-featuregroup'>
15367 <td><code><b>L.featureGroup</b>(<nobr>&lt;Layer[]&gt;</nobr> <i>layers?</i>, <nobr>&lt;Object&gt;</nobr> <i>options?</i>)</code></td>
15368 <td>Create a feature group, optionally given an initial set of layers and an <code>options</code> object.</td>
15369 </tr>
15370</tbody></table>
15371
15372</section>
15373
15374
15375</section><section>
15376<h3 id=''>Options</h3>
15377
15378
15379
15380
15381<div class='accordion'>
15382 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
15383 <div class='accordion-overflow'>
15384 <div class='accordion-content'><section >
15385
15386
15387
15388
15389<table><thead>
15390 <tr>
15391 <th>Option</th>
15392 <th>Type</th>
15393 <th>Default</th>
15394 <th>Description</th>
15395 </tr>
15396 </thead><tbody>
15397 <tr id='featuregroup-pane'>
15398 <td><code><b>pane</b></code></td>
15399 <td><code>String</code></td>
15400 <td><code>&#x27;overlayPane&#x27;</code></td>
15401 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
15402 </tr>
15403 <tr id='featuregroup-attribution'>
15404 <td><code><b>attribution</b></code></td>
15405 <td><code>String</code></td>
15406 <td><code>null</code></td>
15407 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
15408 </tr>
15409</tbody></table>
15410
15411</section></div>
15412 </div>
15413</div>
15414
15415</section><section>
15416<h3 id='featuregroup-event'>Events</h3>
15417
15418<section >
15419
15420
15421
15422
15423<table><thead>
15424 <tr>
15425 <th>Event</th>
15426 <th>Data</th>
15427 <th>Description</th>
15428 </tr>
15429 </thead><tbody>
15430 <tr id='featuregroup-layeradd'>
15431 <td><code><b>layeradd</b></code></td>
15432 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
15433 <td>Fired when a layer is added to this <a href="#featuregroup"><code>FeatureGroup</code></a></td>
15434 </tr>
15435 <tr id='featuregroup-layerremove'>
15436 <td><code><b>layerremove</b></code></td>
15437 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
15438 <td>Fired when a layer is removed from this <a href="#featuregroup"><code>FeatureGroup</code></a></td>
15439 </tr>
15440</tbody></table>
15441
15442</section>
15443
15444
15445<div class='accordion'>
15446 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
15447 <div class='accordion-overflow'>
15448 <div class='accordion-content'><section >
15449
15450
15451
15452
15453<table><thead>
15454 <tr>
15455 <th>Event</th>
15456 <th>Data</th>
15457 <th>Description</th>
15458 </tr>
15459 </thead><tbody>
15460 <tr id='featuregroup-add'>
15461 <td><code><b>add</b></code></td>
15462 <td><code><a href='#event'>Event</a></code></td>
15463 <td>Fired after the layer is added to a map</td>
15464 </tr>
15465 <tr id='featuregroup-remove'>
15466 <td><code><b>remove</b></code></td>
15467 <td><code><a href='#event'>Event</a></code></td>
15468 <td>Fired after the layer is removed from a map</td>
15469 </tr>
15470</tbody></table>
15471
15472</section></div>
15473 </div>
15474</div>
15475
15476<div class='accordion'>
15477 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
15478 <div class='accordion-overflow'>
15479 <div class='accordion-content'><section >
15480
15481
15482
15483
15484<table><thead>
15485 <tr>
15486 <th>Event</th>
15487 <th>Data</th>
15488 <th>Description</th>
15489 </tr>
15490 </thead><tbody>
15491 <tr id='featuregroup-popupopen'>
15492 <td><code><b>popupopen</b></code></td>
15493 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
15494 <td>Fired when a popup bound to this layer is opened</td>
15495 </tr>
15496 <tr id='featuregroup-popupclose'>
15497 <td><code><b>popupclose</b></code></td>
15498 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
15499 <td>Fired when a popup bound to this layer is closed</td>
15500 </tr>
15501</tbody></table>
15502
15503</section></div>
15504 </div>
15505</div>
15506
15507<div class='accordion'>
15508 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
15509 <div class='accordion-overflow'>
15510 <div class='accordion-content'><section >
15511
15512
15513
15514
15515<table><thead>
15516 <tr>
15517 <th>Event</th>
15518 <th>Data</th>
15519 <th>Description</th>
15520 </tr>
15521 </thead><tbody>
15522 <tr id='featuregroup-tooltipopen'>
15523 <td><code><b>tooltipopen</b></code></td>
15524 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
15525 <td>Fired when a tooltip bound to this layer is opened.</td>
15526 </tr>
15527 <tr id='featuregroup-tooltipclose'>
15528 <td><code><b>tooltipclose</b></code></td>
15529 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
15530 <td>Fired when a tooltip bound to this layer is closed.</td>
15531 </tr>
15532</tbody></table>
15533
15534</section></div>
15535 </div>
15536</div>
15537
15538</section><section>
15539<h3 id='featuregroup-method'>Methods</h3>
15540
15541<section >
15542
15543
15544
15545
15546<table><thead>
15547 <tr>
15548 <th>Method</th>
15549 <th>Returns</th>
15550 <th>Description</th>
15551 </tr>
15552 </thead><tbody>
15553 <tr id='featuregroup-setstyle'>
15554 <td><code><b>setStyle</b>(<nobr>&lt;<a href='#path-option'>Path options</a>&gt;</nobr> <i>style</i>)</code></td>
15555 <td><code>this</code></td>
15556 <td><p>Sets the given path options to each layer of the group that has a <code>setStyle</code> method.</p>
15557</td>
15558 </tr>
15559 <tr id='featuregroup-bringtofront'>
15560 <td><code><b>bringToFront</b>()</code></td>
15561 <td><code>this</code></td>
15562 <td><p>Brings the layer group to the top of all other layers</p>
15563</td>
15564 </tr>
15565 <tr id='featuregroup-bringtoback'>
15566 <td><code><b>bringToBack</b>()</code></td>
15567 <td><code>this</code></td>
15568 <td><p>Brings the layer group to the back of all other layers</p>
15569</td>
15570 </tr>
15571 <tr id='featuregroup-getbounds'>
15572 <td><code><b>getBounds</b>()</code></td>
15573 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
15574 <td><p>Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).</p>
15575</td>
15576 </tr>
15577</tbody></table>
15578
15579</section>
15580
15581
15582<div class='accordion'>
15583 <label><span class='expander'></span> Methods inherited from <a href='#layergroup'>LayerGroup</a></label>
15584 <div class='accordion-overflow'>
15585 <div class='accordion-content'><section >
15586
15587
15588
15589
15590<table><thead>
15591 <tr>
15592 <th>Method</th>
15593 <th>Returns</th>
15594 <th>Description</th>
15595 </tr>
15596 </thead><tbody>
15597 <tr id='featuregroup-togeojson'>
15598 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
15599 <td><code>Object</code></td>
15600 <td><p><code>precision</code> is the number of decimal places for coordinates.
15601The default value is 6 places.
15602Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the layer group (as a GeoJSON <code>FeatureCollection</code>, <code>GeometryCollection</code>, or <code>MultiPoint</code>).</p>
15603</td>
15604 </tr>
15605 <tr id='featuregroup-addlayer'>
15606 <td><code><b>addLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
15607 <td><code>this</code></td>
15608 <td><p>Adds the given layer to the group.</p>
15609</td>
15610 </tr>
15611 <tr id='featuregroup-removelayer'>
15612 <td><code><b>removeLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
15613 <td><code>this</code></td>
15614 <td><p>Removes the given layer from the group.</p>
15615</td>
15616 </tr>
15617 <tr id='featuregroup-removelayer'>
15618 <td><code><b>removeLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
15619 <td><code>this</code></td>
15620 <td><p>Removes the layer with the given internal ID from the group.</p>
15621</td>
15622 </tr>
15623 <tr id='featuregroup-haslayer'>
15624 <td><code><b>hasLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
15625 <td><code>Boolean</code></td>
15626 <td><p>Returns <code>true</code> if the given layer is currently added to the group.</p>
15627</td>
15628 </tr>
15629 <tr id='featuregroup-haslayer'>
15630 <td><code><b>hasLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
15631 <td><code>Boolean</code></td>
15632 <td><p>Returns <code>true</code> if the given internal ID is currently added to the group.</p>
15633</td>
15634 </tr>
15635 <tr id='featuregroup-clearlayers'>
15636 <td><code><b>clearLayers</b>()</code></td>
15637 <td><code>this</code></td>
15638 <td><p>Removes all the layers from the group.</p>
15639</td>
15640 </tr>
15641 <tr id='featuregroup-invoke'>
15642 <td><code><b>invoke</b>(<nobr>&lt;String&gt;</nobr> <i>methodName</i>, <i></i>)</code></td>
15643 <td><code>this</code></td>
15644 <td><p>Calls <code>methodName</code> on every layer contained in this group, passing any
15645additional parameters. Has no effect if the layers contained do not
15646implement <code>methodName</code>.</p>
15647</td>
15648 </tr>
15649 <tr id='featuregroup-eachlayer'>
15650 <td><code><b>eachLayer</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
15651 <td><code>this</code></td>
15652 <td><p>Iterates over the layers of the group, optionally specifying context of the iterator function.</p>
15653<pre><code class="lang-js">group.eachLayer(function (layer) {
15654 layer.bindPopup(&#39;Hello&#39;);
15655});
15656</code></pre>
15657</td>
15658 </tr>
15659 <tr id='featuregroup-getlayer'>
15660 <td><code><b>getLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
15661 <td><code><a href='#layer'>Layer</a></code></td>
15662 <td><p>Returns the layer with the given internal ID.</p>
15663</td>
15664 </tr>
15665 <tr id='featuregroup-getlayers'>
15666 <td><code><b>getLayers</b>()</code></td>
15667 <td><code>Layer[]</code></td>
15668 <td><p>Returns an array of all the layers added to the group.</p>
15669</td>
15670 </tr>
15671 <tr id='featuregroup-setzindex'>
15672 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
15673 <td><code>this</code></td>
15674 <td><p>Calls <code>setZIndex</code> on every layer contained in this group, passing the z-index.</p>
15675</td>
15676 </tr>
15677 <tr id='featuregroup-getlayerid'>
15678 <td><code><b>getLayerId</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
15679 <td><code>Number</code></td>
15680 <td><p>Returns the internal ID for a layer</p>
15681</td>
15682 </tr>
15683</tbody></table>
15684
15685</section></div>
15686 </div>
15687</div>
15688
15689<div class='accordion'>
15690 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
15691 <div class='accordion-overflow'>
15692 <div class='accordion-content'><section >
15693
15694
15695
15696
15697<table><thead>
15698 <tr>
15699 <th>Method</th>
15700 <th>Returns</th>
15701 <th>Description</th>
15702 </tr>
15703 </thead><tbody>
15704 <tr id='featuregroup-addto'>
15705 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
15706 <td><code>this</code></td>
15707 <td><p>Adds the layer to the given map or layer group.</p>
15708</td>
15709 </tr>
15710 <tr id='featuregroup-remove'>
15711 <td><code><b>remove</b>()</code></td>
15712 <td><code>this</code></td>
15713 <td><p>Removes the layer from the map it is currently active on.</p>
15714</td>
15715 </tr>
15716 <tr id='featuregroup-removefrom'>
15717 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
15718 <td><code>this</code></td>
15719 <td><p>Removes the layer from the given map</p>
15720</td>
15721 </tr>
15722 <tr id='featuregroup-removefrom'>
15723 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
15724 <td><code>this</code></td>
15725 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
15726</td>
15727 </tr>
15728 <tr id='featuregroup-getpane'>
15729 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
15730 <td><code>HTMLElement</code></td>
15731 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
15732</td>
15733 </tr>
15734 <tr id='featuregroup-getattribution'>
15735 <td><code><b>getAttribution</b>()</code></td>
15736 <td><code>String</code></td>
15737 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
15738</td>
15739 </tr>
15740</tbody></table>
15741
15742</section></div>
15743 </div>
15744</div>
15745
15746<div class='accordion'>
15747 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
15748 <div class='accordion-overflow'>
15749 <div class='accordion-content'><section >
15750
15751
15752
15753
15754<table><thead>
15755 <tr>
15756 <th>Method</th>
15757 <th>Returns</th>
15758 <th>Description</th>
15759 </tr>
15760 </thead><tbody>
15761 <tr id='featuregroup-bindpopup'>
15762 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
15763 <td><code>this</code></td>
15764 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
15765necessary event listeners. If a <code>Function</code> is passed it will receive
15766the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
15767</td>
15768 </tr>
15769 <tr id='featuregroup-unbindpopup'>
15770 <td><code><b>unbindPopup</b>()</code></td>
15771 <td><code>this</code></td>
15772 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
15773</td>
15774 </tr>
15775 <tr id='featuregroup-openpopup'>
15776 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
15777 <td><code>this</code></td>
15778 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
15779</td>
15780 </tr>
15781 <tr id='featuregroup-closepopup'>
15782 <td><code><b>closePopup</b>()</code></td>
15783 <td><code>this</code></td>
15784 <td><p>Closes the popup bound to this layer if it is open.</p>
15785</td>
15786 </tr>
15787 <tr id='featuregroup-togglepopup'>
15788 <td><code><b>togglePopup</b>()</code></td>
15789 <td><code>this</code></td>
15790 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
15791</td>
15792 </tr>
15793 <tr id='featuregroup-ispopupopen'>
15794 <td><code><b>isPopupOpen</b>()</code></td>
15795 <td><code>boolean</code></td>
15796 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
15797</td>
15798 </tr>
15799 <tr id='featuregroup-setpopupcontent'>
15800 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
15801 <td><code>this</code></td>
15802 <td><p>Sets the content of the popup bound to this layer.</p>
15803</td>
15804 </tr>
15805 <tr id='featuregroup-getpopup'>
15806 <td><code><b>getPopup</b>()</code></td>
15807 <td><code><a href='#popup'>Popup</a></code></td>
15808 <td><p>Returns the popup bound to this layer.</p>
15809</td>
15810 </tr>
15811</tbody></table>
15812
15813</section></div>
15814 </div>
15815</div>
15816
15817<div class='accordion'>
15818 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
15819 <div class='accordion-overflow'>
15820 <div class='accordion-content'><section >
15821
15822
15823
15824
15825<table><thead>
15826 <tr>
15827 <th>Method</th>
15828 <th>Returns</th>
15829 <th>Description</th>
15830 </tr>
15831 </thead><tbody>
15832 <tr id='featuregroup-bindtooltip'>
15833 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
15834 <td><code>this</code></td>
15835 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
15836necessary event listeners. If a <code>Function</code> is passed it will receive
15837the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
15838</td>
15839 </tr>
15840 <tr id='featuregroup-unbindtooltip'>
15841 <td><code><b>unbindTooltip</b>()</code></td>
15842 <td><code>this</code></td>
15843 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
15844</td>
15845 </tr>
15846 <tr id='featuregroup-opentooltip'>
15847 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
15848 <td><code>this</code></td>
15849 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
15850</td>
15851 </tr>
15852 <tr id='featuregroup-closetooltip'>
15853 <td><code><b>closeTooltip</b>()</code></td>
15854 <td><code>this</code></td>
15855 <td><p>Closes the tooltip bound to this layer if it is open.</p>
15856</td>
15857 </tr>
15858 <tr id='featuregroup-toggletooltip'>
15859 <td><code><b>toggleTooltip</b>()</code></td>
15860 <td><code>this</code></td>
15861 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
15862</td>
15863 </tr>
15864 <tr id='featuregroup-istooltipopen'>
15865 <td><code><b>isTooltipOpen</b>()</code></td>
15866 <td><code>boolean</code></td>
15867 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
15868</td>
15869 </tr>
15870 <tr id='featuregroup-settooltipcontent'>
15871 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
15872 <td><code>this</code></td>
15873 <td><p>Sets the content of the tooltip bound to this layer.</p>
15874</td>
15875 </tr>
15876 <tr id='featuregroup-gettooltip'>
15877 <td><code><b>getTooltip</b>()</code></td>
15878 <td><code><a href='#tooltip'>Tooltip</a></code></td>
15879 <td><p>Returns the tooltip bound to this layer.</p>
15880</td>
15881 </tr>
15882</tbody></table>
15883
15884</section></div>
15885 </div>
15886</div>
15887
15888<div class='accordion'>
15889 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
15890 <div class='accordion-overflow'>
15891 <div class='accordion-content'><section >
15892
15893
15894
15895
15896<table><thead>
15897 <tr>
15898 <th>Method</th>
15899 <th>Returns</th>
15900 <th>Description</th>
15901 </tr>
15902 </thead><tbody>
15903 <tr id='featuregroup-on'>
15904 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
15905 <td><code>this</code></td>
15906 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
15907</td>
15908 </tr>
15909 <tr id='featuregroup-on'>
15910 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
15911 <td><code>this</code></td>
15912 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
15913</td>
15914 </tr>
15915 <tr id='featuregroup-off'>
15916 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
15917 <td><code>this</code></td>
15918 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
15919</td>
15920 </tr>
15921 <tr id='featuregroup-off'>
15922 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
15923 <td><code>this</code></td>
15924 <td><p>Removes a set of type/listener pairs.</p>
15925</td>
15926 </tr>
15927 <tr id='featuregroup-off'>
15928 <td><code><b>off</b>()</code></td>
15929 <td><code>this</code></td>
15930 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
15931</td>
15932 </tr>
15933 <tr id='featuregroup-fire'>
15934 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
15935 <td><code>this</code></td>
15936 <td><p>Fires an event of the specified type. You can optionally provide an data
15937object — the first argument of the listener function will contain its
15938properties. The event can optionally be propagated to event parents.</p>
15939</td>
15940 </tr>
15941 <tr id='featuregroup-listens'>
15942 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
15943 <td><code>Boolean</code></td>
15944 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
15945</td>
15946 </tr>
15947 <tr id='featuregroup-once'>
15948 <td><code><b>once</b>(<i></i>)</code></td>
15949 <td><code>this</code></td>
15950 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
15951</td>
15952 </tr>
15953 <tr id='featuregroup-addeventparent'>
15954 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
15955 <td><code>this</code></td>
15956 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
15957</td>
15958 </tr>
15959 <tr id='featuregroup-removeeventparent'>
15960 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
15961 <td><code>this</code></td>
15962 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
15963</td>
15964 </tr>
15965 <tr id='featuregroup-addeventlistener'>
15966 <td><code><b>addEventListener</b>(<i></i>)</code></td>
15967 <td><code>this</code></td>
15968 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
15969</td>
15970 </tr>
15971 <tr id='featuregroup-removeeventlistener'>
15972 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
15973 <td><code>this</code></td>
15974 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
15975</td>
15976 </tr>
15977 <tr id='featuregroup-clearalleventlisteners'>
15978 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
15979 <td><code>this</code></td>
15980 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
15981</td>
15982 </tr>
15983 <tr id='featuregroup-addonetimeeventlistener'>
15984 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
15985 <td><code>this</code></td>
15986 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
15987</td>
15988 </tr>
15989 <tr id='featuregroup-fireevent'>
15990 <td><code><b>fireEvent</b>(<i></i>)</code></td>
15991 <td><code>this</code></td>
15992 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
15993</td>
15994 </tr>
15995 <tr id='featuregroup-haseventlisteners'>
15996 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
15997 <td><code>Boolean</code></td>
15998 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
15999</td>
16000 </tr>
16001</tbody></table>
16002
16003</section></div>
16004 </div>
16005</div>
16006
16007</section><h2 id='geojson'>GeoJSON</h2><p>Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
16008GeoJSON data and display it on the map. Extends <a href="#featuregroup"><code>FeatureGroup</code></a>.</p>
16009
16010<section>
16011<h3 id='geojson-example'>Usage example</h3>
16012
16013<section >
16014
16015
16016
16017
16018
16019<pre><code class="lang-js">L.geoJSON(data, {
16020 style: function (feature) {
16021 return {color: feature.properties.color};
16022 }
16023}).bindPopup(function (layer) {
16024 return layer.feature.properties.description;
16025}).addTo(map);
16026</code></pre>
16027
16028
16029
16030</section>
16031
16032
16033</section><section>
16034<h3 id='geojson-factory'>Creation</h3>
16035
16036<section >
16037
16038
16039
16040
16041<table><thead>
16042 <tr>
16043 <th>Factory</th>
16044 <th>Description</th>
16045 </tr>
16046 </thead><tbody>
16047 <tr id='geojson-l-geojson'>
16048 <td><code><b>L.geoJSON</b>(<nobr>&lt;Object&gt;</nobr> <i>geojson?</i>, <nobr>&lt;<a href='#geojson-option'>GeoJSON options</a>&gt;</nobr> <i>options?</i>)</code></td>
16049 <td>Creates a GeoJSON layer. Optionally accepts an object in
16050<a href="https://tools.ietf.org/html/rfc7946">GeoJSON format</a> to display on the map
16051(you can alternatively add it later with <code>addData</code> method) and an <code>options</code> object.</td>
16052 </tr>
16053</tbody></table>
16054
16055</section>
16056
16057
16058</section><section>
16059<h3 id='geojson-option'>Options</h3>
16060
16061<section >
16062
16063
16064
16065
16066<table><thead>
16067 <tr>
16068 <th>Option</th>
16069 <th>Type</th>
16070 <th>Default</th>
16071 <th>Description</th>
16072 </tr>
16073 </thead><tbody>
16074 <tr id='geojson-pointtolayer'>
16075 <td><code><b>pointToLayer</b></code></td>
16076 <td><code>Function</code></td>
16077 <td><code>*</code></td>
16078 <td>A <code>Function</code> defining how GeoJSON points spawn Leaflet layers. It is internally
16079called when data is added, passing the GeoJSON point feature and its <a href="#latlng"><code>LatLng</code></a>.
16080The default is to spawn a default <a href="#marker"><code>Marker</code></a>:
16081<pre><code class="lang-js">function(geoJsonPoint, latlng) {
16082 return L.marker(latlng);
16083}
16084</code></pre></td>
16085 </tr>
16086 <tr id='geojson-style'>
16087 <td><code><b>style</b></code></td>
16088 <td><code>Function</code></td>
16089 <td><code>*</code></td>
16090 <td>A <code>Function</code> defining the <a href="#path-option"><code>Path options</code></a> for styling GeoJSON lines and polygons,
16091called internally when data is added.
16092The default value is to not override any defaults:
16093<pre><code class="lang-js">function (geoJsonFeature) {
16094 return {}
16095}
16096</code></pre></td>
16097 </tr>
16098 <tr id='geojson-oneachfeature'>
16099 <td><code><b>onEachFeature</b></code></td>
16100 <td><code>Function</code></td>
16101 <td><code>*</code></td>
16102 <td>A <code>Function</code> that will be called once for each created <code>Feature</code>, after it has
16103been created and styled. Useful for attaching events and popups to features.
16104The default is to do nothing with the newly created layers:
16105<pre><code class="lang-js">function (feature, layer) {}
16106</code></pre></td>
16107 </tr>
16108 <tr id='geojson-filter'>
16109 <td><code><b>filter</b></code></td>
16110 <td><code>Function</code></td>
16111 <td><code>*</code></td>
16112 <td>A <code>Function</code> that will be used to decide whether to include a feature or not.
16113The default is to include all features:
16114<pre><code class="lang-js">function (geoJsonFeature) {
16115 return true;
16116}
16117</code></pre>
16118<p>Note: dynamically changing the <code>filter</code> option will have effect only on newly
16119added data. It will <em>not</em> re-evaluate already included features.</p></td>
16120 </tr>
16121 <tr id='geojson-coordstolatlng'>
16122 <td><code><b>coordsToLatLng</b></code></td>
16123 <td><code>Function</code></td>
16124 <td><code>*</code></td>
16125 <td>A <code>Function</code> that will be used for converting GeoJSON coordinates to <a href="#latlng"><code>LatLng</code></a>s.
16126The default is the <code>coordsToLatLng</code> static method.</td>
16127 </tr>
16128 <tr id='geojson-markersinheritoptions'>
16129 <td><code><b>markersInheritOptions</b></code></td>
16130 <td><code>Boolean</code></td>
16131 <td><code>false</code></td>
16132 <td>Whether default Markers for &quot;Point&quot; type Features inherit from group options.</td>
16133 </tr>
16134</tbody></table>
16135
16136</section>
16137
16138
16139<div class='accordion'>
16140 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
16141 <div class='accordion-overflow'>
16142 <div class='accordion-content'><section >
16143
16144
16145
16146
16147<table><thead>
16148 <tr>
16149 <th>Option</th>
16150 <th>Type</th>
16151 <th>Default</th>
16152 <th>Description</th>
16153 </tr>
16154 </thead><tbody>
16155 <tr id='geojson-pane'>
16156 <td><code><b>pane</b></code></td>
16157 <td><code>String</code></td>
16158 <td><code>&#x27;overlayPane&#x27;</code></td>
16159 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
16160 </tr>
16161 <tr id='geojson-attribution'>
16162 <td><code><b>attribution</b></code></td>
16163 <td><code>String</code></td>
16164 <td><code>null</code></td>
16165 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
16166 </tr>
16167</tbody></table>
16168
16169</section></div>
16170 </div>
16171</div>
16172
16173</section><section>
16174<h3 id=''>Events</h3>
16175
16176
16177
16178
16179<div class='accordion'>
16180 <label><span class='expander'></span> Events inherited from <a href='#featuregroup'>FeatureGroup</a></label>
16181 <div class='accordion-overflow'>
16182 <div class='accordion-content'><section >
16183
16184
16185
16186
16187<table><thead>
16188 <tr>
16189 <th>Event</th>
16190 <th>Data</th>
16191 <th>Description</th>
16192 </tr>
16193 </thead><tbody>
16194 <tr id='geojson-layeradd'>
16195 <td><code><b>layeradd</b></code></td>
16196 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
16197 <td>Fired when a layer is added to this <a href="#featuregroup"><code>FeatureGroup</code></a></td>
16198 </tr>
16199 <tr id='geojson-layerremove'>
16200 <td><code><b>layerremove</b></code></td>
16201 <td><code><a href='#layerevent'>LayerEvent</a></code></td>
16202 <td>Fired when a layer is removed from this <a href="#featuregroup"><code>FeatureGroup</code></a></td>
16203 </tr>
16204</tbody></table>
16205
16206</section></div>
16207 </div>
16208</div>
16209
16210<div class='accordion'>
16211 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
16212 <div class='accordion-overflow'>
16213 <div class='accordion-content'><section >
16214
16215
16216
16217
16218<table><thead>
16219 <tr>
16220 <th>Event</th>
16221 <th>Data</th>
16222 <th>Description</th>
16223 </tr>
16224 </thead><tbody>
16225 <tr id='geojson-add'>
16226 <td><code><b>add</b></code></td>
16227 <td><code><a href='#event'>Event</a></code></td>
16228 <td>Fired after the layer is added to a map</td>
16229 </tr>
16230 <tr id='geojson-remove'>
16231 <td><code><b>remove</b></code></td>
16232 <td><code><a href='#event'>Event</a></code></td>
16233 <td>Fired after the layer is removed from a map</td>
16234 </tr>
16235</tbody></table>
16236
16237</section></div>
16238 </div>
16239</div>
16240
16241<div class='accordion'>
16242 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
16243 <div class='accordion-overflow'>
16244 <div class='accordion-content'><section >
16245
16246
16247
16248
16249<table><thead>
16250 <tr>
16251 <th>Event</th>
16252 <th>Data</th>
16253 <th>Description</th>
16254 </tr>
16255 </thead><tbody>
16256 <tr id='geojson-popupopen'>
16257 <td><code><b>popupopen</b></code></td>
16258 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
16259 <td>Fired when a popup bound to this layer is opened</td>
16260 </tr>
16261 <tr id='geojson-popupclose'>
16262 <td><code><b>popupclose</b></code></td>
16263 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
16264 <td>Fired when a popup bound to this layer is closed</td>
16265 </tr>
16266</tbody></table>
16267
16268</section></div>
16269 </div>
16270</div>
16271
16272<div class='accordion'>
16273 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
16274 <div class='accordion-overflow'>
16275 <div class='accordion-content'><section >
16276
16277
16278
16279
16280<table><thead>
16281 <tr>
16282 <th>Event</th>
16283 <th>Data</th>
16284 <th>Description</th>
16285 </tr>
16286 </thead><tbody>
16287 <tr id='geojson-tooltipopen'>
16288 <td><code><b>tooltipopen</b></code></td>
16289 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
16290 <td>Fired when a tooltip bound to this layer is opened.</td>
16291 </tr>
16292 <tr id='geojson-tooltipclose'>
16293 <td><code><b>tooltipclose</b></code></td>
16294 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
16295 <td>Fired when a tooltip bound to this layer is closed.</td>
16296 </tr>
16297</tbody></table>
16298
16299</section></div>
16300 </div>
16301</div>
16302
16303</section><section>
16304<h3 id='geojson-method'>Methods</h3>
16305
16306<section >
16307
16308
16309
16310
16311<table><thead>
16312 <tr>
16313 <th>Method</th>
16314 <th>Returns</th>
16315 <th>Description</th>
16316 </tr>
16317 </thead><tbody>
16318 <tr id='geojson-adddata'>
16319 <td><code><b>addData</b>(<i>data</i>)</code></td>
16320 <td><code>this</code></td>
16321 <td><p>Adds a GeoJSON object to the layer.</p>
16322</td>
16323 </tr>
16324 <tr id='geojson-resetstyle'>
16325 <td><code><b>resetStyle</b>(<i>layer?</i>)</code></td>
16326 <td><code>this</code></td>
16327 <td><p>Resets the given vector layer&#39;s style to the original GeoJSON style, useful for resetting style after hover events.
16328If <a href="#layer"><code>layer</code></a> is omitted, the style of all features in the current layer is reset.</p>
16329</td>
16330 </tr>
16331 <tr id='geojson-setstyle'>
16332 <td><code><b>setStyle</b>(<i>style</i>)</code></td>
16333 <td><code>this</code></td>
16334 <td><p>Changes styles of GeoJSON vector layers with the given style function.</p>
16335</td>
16336 </tr>
16337</tbody></table>
16338
16339</section>
16340
16341
16342<div class='accordion'>
16343 <label><span class='expander'></span> Methods inherited from <a href='#featuregroup'>FeatureGroup</a></label>
16344 <div class='accordion-overflow'>
16345 <div class='accordion-content'><section >
16346
16347
16348
16349
16350<table><thead>
16351 <tr>
16352 <th>Method</th>
16353 <th>Returns</th>
16354 <th>Description</th>
16355 </tr>
16356 </thead><tbody>
16357 <tr id='geojson-bringtofront'>
16358 <td><code><b>bringToFront</b>()</code></td>
16359 <td><code>this</code></td>
16360 <td><p>Brings the layer group to the top of all other layers</p>
16361</td>
16362 </tr>
16363 <tr id='geojson-bringtoback'>
16364 <td><code><b>bringToBack</b>()</code></td>
16365 <td><code>this</code></td>
16366 <td><p>Brings the layer group to the back of all other layers</p>
16367</td>
16368 </tr>
16369 <tr id='geojson-getbounds'>
16370 <td><code><b>getBounds</b>()</code></td>
16371 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
16372 <td><p>Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).</p>
16373</td>
16374 </tr>
16375</tbody></table>
16376
16377</section></div>
16378 </div>
16379</div>
16380
16381<div class='accordion'>
16382 <label><span class='expander'></span> Methods inherited from <a href='#layergroup'>LayerGroup</a></label>
16383 <div class='accordion-overflow'>
16384 <div class='accordion-content'><section >
16385
16386
16387
16388
16389<table><thead>
16390 <tr>
16391 <th>Method</th>
16392 <th>Returns</th>
16393 <th>Description</th>
16394 </tr>
16395 </thead><tbody>
16396 <tr id='geojson-togeojson'>
16397 <td><code><b>toGeoJSON</b>(<nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
16398 <td><code>Object</code></td>
16399 <td><p><code>precision</code> is the number of decimal places for coordinates.
16400The default value is 6 places.
16401Returns a <a href="http://en.wikipedia.org/wiki/GeoJSON"><a href="#geojson"><code>GeoJSON</code></a></a> representation of the layer group (as a GeoJSON <code>FeatureCollection</code>, <code>GeometryCollection</code>, or <code>MultiPoint</code>).</p>
16402</td>
16403 </tr>
16404 <tr id='geojson-addlayer'>
16405 <td><code><b>addLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
16406 <td><code>this</code></td>
16407 <td><p>Adds the given layer to the group.</p>
16408</td>
16409 </tr>
16410 <tr id='geojson-removelayer'>
16411 <td><code><b>removeLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
16412 <td><code>this</code></td>
16413 <td><p>Removes the given layer from the group.</p>
16414</td>
16415 </tr>
16416 <tr id='geojson-removelayer'>
16417 <td><code><b>removeLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
16418 <td><code>this</code></td>
16419 <td><p>Removes the layer with the given internal ID from the group.</p>
16420</td>
16421 </tr>
16422 <tr id='geojson-haslayer'>
16423 <td><code><b>hasLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
16424 <td><code>Boolean</code></td>
16425 <td><p>Returns <code>true</code> if the given layer is currently added to the group.</p>
16426</td>
16427 </tr>
16428 <tr id='geojson-haslayer'>
16429 <td><code><b>hasLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
16430 <td><code>Boolean</code></td>
16431 <td><p>Returns <code>true</code> if the given internal ID is currently added to the group.</p>
16432</td>
16433 </tr>
16434 <tr id='geojson-clearlayers'>
16435 <td><code><b>clearLayers</b>()</code></td>
16436 <td><code>this</code></td>
16437 <td><p>Removes all the layers from the group.</p>
16438</td>
16439 </tr>
16440 <tr id='geojson-invoke'>
16441 <td><code><b>invoke</b>(<nobr>&lt;String&gt;</nobr> <i>methodName</i>, <i></i>)</code></td>
16442 <td><code>this</code></td>
16443 <td><p>Calls <code>methodName</code> on every layer contained in this group, passing any
16444additional parameters. Has no effect if the layers contained do not
16445implement <code>methodName</code>.</p>
16446</td>
16447 </tr>
16448 <tr id='geojson-eachlayer'>
16449 <td><code><b>eachLayer</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
16450 <td><code>this</code></td>
16451 <td><p>Iterates over the layers of the group, optionally specifying context of the iterator function.</p>
16452<pre><code class="lang-js">group.eachLayer(function (layer) {
16453 layer.bindPopup(&#39;Hello&#39;);
16454});
16455</code></pre>
16456</td>
16457 </tr>
16458 <tr id='geojson-getlayer'>
16459 <td><code><b>getLayer</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
16460 <td><code><a href='#layer'>Layer</a></code></td>
16461 <td><p>Returns the layer with the given internal ID.</p>
16462</td>
16463 </tr>
16464 <tr id='geojson-getlayers'>
16465 <td><code><b>getLayers</b>()</code></td>
16466 <td><code>Layer[]</code></td>
16467 <td><p>Returns an array of all the layers added to the group.</p>
16468</td>
16469 </tr>
16470 <tr id='geojson-setzindex'>
16471 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
16472 <td><code>this</code></td>
16473 <td><p>Calls <code>setZIndex</code> on every layer contained in this group, passing the z-index.</p>
16474</td>
16475 </tr>
16476 <tr id='geojson-getlayerid'>
16477 <td><code><b>getLayerId</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
16478 <td><code>Number</code></td>
16479 <td><p>Returns the internal ID for a layer</p>
16480</td>
16481 </tr>
16482</tbody></table>
16483
16484</section></div>
16485 </div>
16486</div>
16487
16488<div class='accordion'>
16489 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
16490 <div class='accordion-overflow'>
16491 <div class='accordion-content'><section >
16492
16493
16494
16495
16496<table><thead>
16497 <tr>
16498 <th>Method</th>
16499 <th>Returns</th>
16500 <th>Description</th>
16501 </tr>
16502 </thead><tbody>
16503 <tr id='geojson-addto'>
16504 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
16505 <td><code>this</code></td>
16506 <td><p>Adds the layer to the given map or layer group.</p>
16507</td>
16508 </tr>
16509 <tr id='geojson-remove'>
16510 <td><code><b>remove</b>()</code></td>
16511 <td><code>this</code></td>
16512 <td><p>Removes the layer from the map it is currently active on.</p>
16513</td>
16514 </tr>
16515 <tr id='geojson-removefrom'>
16516 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
16517 <td><code>this</code></td>
16518 <td><p>Removes the layer from the given map</p>
16519</td>
16520 </tr>
16521 <tr id='geojson-removefrom'>
16522 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
16523 <td><code>this</code></td>
16524 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
16525</td>
16526 </tr>
16527 <tr id='geojson-getpane'>
16528 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
16529 <td><code>HTMLElement</code></td>
16530 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
16531</td>
16532 </tr>
16533 <tr id='geojson-getattribution'>
16534 <td><code><b>getAttribution</b>()</code></td>
16535 <td><code>String</code></td>
16536 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
16537</td>
16538 </tr>
16539</tbody></table>
16540
16541</section></div>
16542 </div>
16543</div>
16544
16545<div class='accordion'>
16546 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
16547 <div class='accordion-overflow'>
16548 <div class='accordion-content'><section >
16549
16550
16551
16552
16553<table><thead>
16554 <tr>
16555 <th>Method</th>
16556 <th>Returns</th>
16557 <th>Description</th>
16558 </tr>
16559 </thead><tbody>
16560 <tr id='geojson-bindpopup'>
16561 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
16562 <td><code>this</code></td>
16563 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
16564necessary event listeners. If a <code>Function</code> is passed it will receive
16565the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
16566</td>
16567 </tr>
16568 <tr id='geojson-unbindpopup'>
16569 <td><code><b>unbindPopup</b>()</code></td>
16570 <td><code>this</code></td>
16571 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
16572</td>
16573 </tr>
16574 <tr id='geojson-openpopup'>
16575 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
16576 <td><code>this</code></td>
16577 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
16578</td>
16579 </tr>
16580 <tr id='geojson-closepopup'>
16581 <td><code><b>closePopup</b>()</code></td>
16582 <td><code>this</code></td>
16583 <td><p>Closes the popup bound to this layer if it is open.</p>
16584</td>
16585 </tr>
16586 <tr id='geojson-togglepopup'>
16587 <td><code><b>togglePopup</b>()</code></td>
16588 <td><code>this</code></td>
16589 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
16590</td>
16591 </tr>
16592 <tr id='geojson-ispopupopen'>
16593 <td><code><b>isPopupOpen</b>()</code></td>
16594 <td><code>boolean</code></td>
16595 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
16596</td>
16597 </tr>
16598 <tr id='geojson-setpopupcontent'>
16599 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
16600 <td><code>this</code></td>
16601 <td><p>Sets the content of the popup bound to this layer.</p>
16602</td>
16603 </tr>
16604 <tr id='geojson-getpopup'>
16605 <td><code><b>getPopup</b>()</code></td>
16606 <td><code><a href='#popup'>Popup</a></code></td>
16607 <td><p>Returns the popup bound to this layer.</p>
16608</td>
16609 </tr>
16610</tbody></table>
16611
16612</section></div>
16613 </div>
16614</div>
16615
16616<div class='accordion'>
16617 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
16618 <div class='accordion-overflow'>
16619 <div class='accordion-content'><section >
16620
16621
16622
16623
16624<table><thead>
16625 <tr>
16626 <th>Method</th>
16627 <th>Returns</th>
16628 <th>Description</th>
16629 </tr>
16630 </thead><tbody>
16631 <tr id='geojson-bindtooltip'>
16632 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
16633 <td><code>this</code></td>
16634 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
16635necessary event listeners. If a <code>Function</code> is passed it will receive
16636the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
16637</td>
16638 </tr>
16639 <tr id='geojson-unbindtooltip'>
16640 <td><code><b>unbindTooltip</b>()</code></td>
16641 <td><code>this</code></td>
16642 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
16643</td>
16644 </tr>
16645 <tr id='geojson-opentooltip'>
16646 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
16647 <td><code>this</code></td>
16648 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
16649</td>
16650 </tr>
16651 <tr id='geojson-closetooltip'>
16652 <td><code><b>closeTooltip</b>()</code></td>
16653 <td><code>this</code></td>
16654 <td><p>Closes the tooltip bound to this layer if it is open.</p>
16655</td>
16656 </tr>
16657 <tr id='geojson-toggletooltip'>
16658 <td><code><b>toggleTooltip</b>()</code></td>
16659 <td><code>this</code></td>
16660 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
16661</td>
16662 </tr>
16663 <tr id='geojson-istooltipopen'>
16664 <td><code><b>isTooltipOpen</b>()</code></td>
16665 <td><code>boolean</code></td>
16666 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
16667</td>
16668 </tr>
16669 <tr id='geojson-settooltipcontent'>
16670 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
16671 <td><code>this</code></td>
16672 <td><p>Sets the content of the tooltip bound to this layer.</p>
16673</td>
16674 </tr>
16675 <tr id='geojson-gettooltip'>
16676 <td><code><b>getTooltip</b>()</code></td>
16677 <td><code><a href='#tooltip'>Tooltip</a></code></td>
16678 <td><p>Returns the tooltip bound to this layer.</p>
16679</td>
16680 </tr>
16681</tbody></table>
16682
16683</section></div>
16684 </div>
16685</div>
16686
16687<div class='accordion'>
16688 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
16689 <div class='accordion-overflow'>
16690 <div class='accordion-content'><section >
16691
16692
16693
16694
16695<table><thead>
16696 <tr>
16697 <th>Method</th>
16698 <th>Returns</th>
16699 <th>Description</th>
16700 </tr>
16701 </thead><tbody>
16702 <tr id='geojson-on'>
16703 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
16704 <td><code>this</code></td>
16705 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
16706</td>
16707 </tr>
16708 <tr id='geojson-on'>
16709 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
16710 <td><code>this</code></td>
16711 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
16712</td>
16713 </tr>
16714 <tr id='geojson-off'>
16715 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
16716 <td><code>this</code></td>
16717 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
16718</td>
16719 </tr>
16720 <tr id='geojson-off'>
16721 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
16722 <td><code>this</code></td>
16723 <td><p>Removes a set of type/listener pairs.</p>
16724</td>
16725 </tr>
16726 <tr id='geojson-off'>
16727 <td><code><b>off</b>()</code></td>
16728 <td><code>this</code></td>
16729 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
16730</td>
16731 </tr>
16732 <tr id='geojson-fire'>
16733 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
16734 <td><code>this</code></td>
16735 <td><p>Fires an event of the specified type. You can optionally provide an data
16736object — the first argument of the listener function will contain its
16737properties. The event can optionally be propagated to event parents.</p>
16738</td>
16739 </tr>
16740 <tr id='geojson-listens'>
16741 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
16742 <td><code>Boolean</code></td>
16743 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
16744</td>
16745 </tr>
16746 <tr id='geojson-once'>
16747 <td><code><b>once</b>(<i></i>)</code></td>
16748 <td><code>this</code></td>
16749 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
16750</td>
16751 </tr>
16752 <tr id='geojson-addeventparent'>
16753 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
16754 <td><code>this</code></td>
16755 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
16756</td>
16757 </tr>
16758 <tr id='geojson-removeeventparent'>
16759 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
16760 <td><code>this</code></td>
16761 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
16762</td>
16763 </tr>
16764 <tr id='geojson-addeventlistener'>
16765 <td><code><b>addEventListener</b>(<i></i>)</code></td>
16766 <td><code>this</code></td>
16767 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
16768</td>
16769 </tr>
16770 <tr id='geojson-removeeventlistener'>
16771 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
16772 <td><code>this</code></td>
16773 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
16774</td>
16775 </tr>
16776 <tr id='geojson-clearalleventlisteners'>
16777 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
16778 <td><code>this</code></td>
16779 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
16780</td>
16781 </tr>
16782 <tr id='geojson-addonetimeeventlistener'>
16783 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
16784 <td><code>this</code></td>
16785 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
16786</td>
16787 </tr>
16788 <tr id='geojson-fireevent'>
16789 <td><code><b>fireEvent</b>(<i></i>)</code></td>
16790 <td><code>this</code></td>
16791 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
16792</td>
16793 </tr>
16794 <tr id='geojson-haseventlisteners'>
16795 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
16796 <td><code>Boolean</code></td>
16797 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
16798</td>
16799 </tr>
16800</tbody></table>
16801
16802</section></div>
16803 </div>
16804</div>
16805
16806</section><section>
16807<h3 id='geojson-function'>Functions</h3>
16808
16809<section >
16810
16811
16812
16813<div class='section-comments'>There are several static functions which can be called without instantiating L.GeoJSON:</div>
16814
16815<table><thead>
16816 <tr>
16817 <th>Function</th>
16818 <th>Returns</th>
16819 <th>Description</th>
16820 </tr>
16821 </thead><tbody>
16822 <tr id='geojson-geometrytolayer'>
16823 <td><code><b>geometryToLayer</b>(<nobr>&lt;Object&gt;</nobr> <i>featureData</i>, <nobr>&lt;<a href='#geojson-option'>GeoJSON options</a>&gt;</nobr> <i>options?</i>)</code></td>
16824 <td><code><a href='#layer'>Layer</a></code></td>
16825 <td>Creates a <a href="#layer"><code>Layer</code></a> from a given GeoJSON feature. Can use a custom
16826<a href="#geojson-pointtolayer"><code>pointToLayer</code></a> and/or <a href="#geojson-coordstolatlng"><code>coordsToLatLng</code></a>
16827functions if provided as options.</td>
16828 </tr>
16829 <tr id='geojson-coordstolatlng'>
16830 <td><code><b>coordsToLatLng</b>(<nobr>&lt;Array&gt;</nobr> <i>coords</i>)</code></td>
16831 <td><code><a href='#latlng'>LatLng</a></code></td>
16832 <td>Creates a <a href="#latlng"><code>LatLng</code></a> object from an array of 2 numbers (longitude, latitude)
16833or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.</td>
16834 </tr>
16835 <tr id='geojson-coordstolatlngs'>
16836 <td><code><b>coordsToLatLngs</b>(<nobr>&lt;Array&gt;</nobr> <i>coords</i>, <nobr>&lt;Number&gt;</nobr> <i>levelsDeep?</i>, <nobr>&lt;Function&gt;</nobr> <i>coordsToLatLng?</i>)</code></td>
16837 <td><code>Array</code></td>
16838 <td>Creates a multidimensional array of <a href="#latlng"><code>LatLng</code></a>s from a GeoJSON coordinates array.
16839<code>levelsDeep</code> specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
16840Can use a custom <a href="#geojson-coordstolatlng"><code>coordsToLatLng</code></a> function.</td>
16841 </tr>
16842 <tr id='geojson-latlngtocoords'>
16843 <td><code><b>latLngToCoords</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>precision?</i>)</code></td>
16844 <td><code>Array</code></td>
16845 <td>Reverse of <a href="#geojson-coordstolatlng"><code>coordsToLatLng</code></a></td>
16846 </tr>
16847 <tr id='geojson-latlngstocoords'>
16848 <td><code><b>latLngsToCoords</b>(<nobr>&lt;Array&gt;</nobr> <i>latlngs</i>, <nobr>&lt;Number&gt;</nobr> <i>levelsDeep?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>closed?</i>)</code></td>
16849 <td><code>Array</code></td>
16850 <td>Reverse of <a href="#geojson-coordstolatlngs"><code>coordsToLatLngs</code></a>
16851<code>closed</code> determines whether the first point should be appended to the end of the array to close the feature, only used when <code>levelsDeep</code> is 0. False by default.</td>
16852 </tr>
16853 <tr id='geojson-asfeature'>
16854 <td><code><b>asFeature</b>(<nobr>&lt;Object&gt;</nobr> <i>geojson</i>)</code></td>
16855 <td><code>Object</code></td>
16856 <td>Normalize GeoJSON geometries/features into GeoJSON features.</td>
16857 </tr>
16858</tbody></table>
16859
16860</section>
16861
16862
16863</section><h2 id='gridlayer'>GridLayer</h2><p>Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces <code>TileLayer.Canvas</code>.
16864GridLayer can be extended to create a tiled grid of HTML elements like <code>&lt;canvas&gt;</code>, <code>&lt;img&gt;</code> or <code>&lt;div&gt;</code>. GridLayer will handle creating and animating these DOM elements for you.</p>
16865
16866<section>
16867<h3 id='gridlayer-example'>Usage example</h3>
16868
16869<section >
16870
16871<h4 id='gridlayer-synchronous-usage'>Synchronous usage</h4>
16872
16873
16874
16875<p>To create a custom layer, extend GridLayer and implement the <code>createTile()</code> method, which will be passed a <a href="#point"><code>Point</code></a> object with the <code>x</code>, <code>y</code>, and <code>z</code> (zoom level) coordinates to draw your tile.</p>
16876<pre><code class="lang-js">var CanvasLayer = L.GridLayer.extend({
16877 createTile: function(coords){
16878 // create a &lt;canvas&gt; element for drawing
16879 var tile = L.DomUtil.create(&#39;canvas&#39;, &#39;leaflet-tile&#39;);
16880 // setup tile width and height according to the options
16881 var size = this.getTileSize();
16882 tile.width = size.x;
16883 tile.height = size.y;
16884 // get a canvas context and draw something on it using coords.x, coords.y and coords.z
16885 var ctx = tile.getContext(&#39;2d&#39;);
16886 // return the tile so it can be rendered on screen
16887 return tile;
16888 }
16889});
16890</code></pre>
16891
16892
16893
16894</section><section >
16895
16896<h4 id='gridlayer-asynchronous-usage'>Asynchronous usage</h4>
16897
16898
16899
16900<p>Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the <code>done()</code> callback.</p>
16901<pre><code class="lang-js">var CanvasLayer = L.GridLayer.extend({
16902 createTile: function(coords, done){
16903 var error;
16904 // create a &lt;canvas&gt; element for drawing
16905 var tile = L.DomUtil.create(&#39;canvas&#39;, &#39;leaflet-tile&#39;);
16906 // setup tile width and height according to the options
16907 var size = this.getTileSize();
16908 tile.width = size.x;
16909 tile.height = size.y;
16910 // draw something asynchronously and pass the tile to the done() callback
16911 setTimeout(function() {
16912 done(error, tile);
16913 }, 1000);
16914 return tile;
16915 }
16916});
16917</code></pre>
16918
16919
16920
16921</section>
16922
16923
16924</section><section>
16925<h3 id='gridlayer-factory'>Creation</h3>
16926
16927<section >
16928
16929
16930
16931
16932<table><thead>
16933 <tr>
16934 <th>Factory</th>
16935 <th>Description</th>
16936 </tr>
16937 </thead><tbody>
16938 <tr id='gridlayer-l-gridlayer'>
16939 <td><code><b>L.gridLayer</b>(<nobr>&lt;<a href='#gridlayer-option'>GridLayer options</a>&gt;</nobr> <i>options?</i>)</code></td>
16940 <td>Creates a new instance of GridLayer with the supplied options.</td>
16941 </tr>
16942</tbody></table>
16943
16944</section>
16945
16946
16947</section><section>
16948<h3 id='gridlayer-option'>Options</h3>
16949
16950<section >
16951
16952
16953
16954<div class='section-comments'></div>
16955
16956<table><thead>
16957 <tr>
16958 <th>Option</th>
16959 <th>Type</th>
16960 <th>Default</th>
16961 <th>Description</th>
16962 </tr>
16963 </thead><tbody>
16964 <tr id='gridlayer-tilesize'>
16965 <td><code><b>tileSize</b></code></td>
16966 <td><code>Number|Point</code></td>
16967 <td><code>256</code></td>
16968 <td>Width and height of tiles in the grid. Use a number if width and height are equal, or <code>L.point(width, height)</code> otherwise.</td>
16969 </tr>
16970 <tr id='gridlayer-opacity'>
16971 <td><code><b>opacity</b></code></td>
16972 <td><code>Number</code></td>
16973 <td><code>1.0</code></td>
16974 <td>Opacity of the tiles. Can be used in the <code>createTile()</code> function.</td>
16975 </tr>
16976 <tr id='gridlayer-updatewhenidle'>
16977 <td><code><b>updateWhenIdle</b></code></td>
16978 <td><code>Boolean</code></td>
16979 <td><code>(depends)</code></td>
16980 <td>Load new tiles only when panning ends.
16981<code>true</code> by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
16982<code>false</code> otherwise in order to display new tiles <em>during</em> panning, since it is easy to pan outside the
16983<a href="#gridlayer-keepbuffer"><code>keepBuffer</code></a> option in desktop browsers.</td>
16984 </tr>
16985 <tr id='gridlayer-updatewhenzooming'>
16986 <td><code><b>updateWhenZooming</b></code></td>
16987 <td><code>Boolean</code></td>
16988 <td><code>true</code></td>
16989 <td>By default, a smooth zoom animation (during a <a href="#map-touchzoom">touch zoom</a> or a <a href="#map-flyto"><code>flyTo()</code></a>) will update grid layers every integer zoom level. Setting this option to <code>false</code> will update the grid layer only when the smooth animation ends.</td>
16990 </tr>
16991 <tr id='gridlayer-updateinterval'>
16992 <td><code><b>updateInterval</b></code></td>
16993 <td><code>Number</code></td>
16994 <td><code>200</code></td>
16995 <td>Tiles will not update more than once every <code>updateInterval</code> milliseconds when panning.</td>
16996 </tr>
16997 <tr id='gridlayer-zindex'>
16998 <td><code><b>zIndex</b></code></td>
16999 <td><code>Number</code></td>
17000 <td><code>1</code></td>
17001 <td>The explicit zIndex of the tile layer.</td>
17002 </tr>
17003 <tr id='gridlayer-bounds'>
17004 <td><code><b>bounds</b></code></td>
17005 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
17006 <td><code>undefined</code></td>
17007 <td>If set, tiles will only be loaded inside the set <a href="#latlngbounds"><code>LatLngBounds</code></a>.</td>
17008 </tr>
17009 <tr id='gridlayer-minzoom'>
17010 <td><code><b>minZoom</b></code></td>
17011 <td><code>Number</code></td>
17012 <td><code>0</code></td>
17013 <td>The minimum zoom level down to which this layer will be displayed (inclusive).</td>
17014 </tr>
17015 <tr id='gridlayer-maxzoom'>
17016 <td><code><b>maxZoom</b></code></td>
17017 <td><code>Number</code></td>
17018 <td><code>undefined</code></td>
17019 <td>The maximum zoom level up to which this layer will be displayed (inclusive).</td>
17020 </tr>
17021 <tr id='gridlayer-maxnativezoom'>
17022 <td><code><b>maxNativeZoom</b></code></td>
17023 <td><code>Number</code></td>
17024 <td><code>undefined</code></td>
17025 <td>Maximum zoom number the tile source has available. If it is specified,
17026the tiles on all zoom levels higher than <code>maxNativeZoom</code> will be loaded
17027from <code>maxNativeZoom</code> level and auto-scaled.</td>
17028 </tr>
17029 <tr id='gridlayer-minnativezoom'>
17030 <td><code><b>minNativeZoom</b></code></td>
17031 <td><code>Number</code></td>
17032 <td><code>undefined</code></td>
17033 <td>Minimum zoom number the tile source has available. If it is specified,
17034the tiles on all zoom levels lower than <code>minNativeZoom</code> will be loaded
17035from <code>minNativeZoom</code> level and auto-scaled.</td>
17036 </tr>
17037 <tr id='gridlayer-nowrap'>
17038 <td><code><b>noWrap</b></code></td>
17039 <td><code>Boolean</code></td>
17040 <td><code>false</code></td>
17041 <td>Whether the layer is wrapped around the antimeridian. If <code>true</code>, the
17042GridLayer will only be displayed once at low zoom levels. Has no
17043effect when the <a href="#map-crs">map CRS</a> doesn&#39;t wrap around. Can be used
17044in combination with <a href="#gridlayer-bounds"><a href="#bounds"><code>bounds</code></a></a> to prevent requesting
17045tiles outside the CRS limits.</td>
17046 </tr>
17047 <tr id='gridlayer-pane'>
17048 <td><code><b>pane</b></code></td>
17049 <td><code>String</code></td>
17050 <td><code>&#x27;tilePane&#x27;</code></td>
17051 <td><code>Map pane</code> where the grid layer will be added.</td>
17052 </tr>
17053 <tr id='gridlayer-classname'>
17054 <td><code><b>className</b></code></td>
17055 <td><code>String</code></td>
17056 <td><code>&#x27;&#x27;</code></td>
17057 <td>A custom class name to assign to the tile layer. Empty by default.</td>
17058 </tr>
17059 <tr id='gridlayer-keepbuffer'>
17060 <td><code><b>keepBuffer</b></code></td>
17061 <td><code>Number</code></td>
17062 <td><code>2</code></td>
17063 <td>When panning the map, keep this many rows and columns of tiles before unloading them.</td>
17064 </tr>
17065</tbody></table>
17066
17067</section>
17068
17069
17070<div class='accordion'>
17071 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
17072 <div class='accordion-overflow'>
17073 <div class='accordion-content'><section >
17074
17075
17076
17077
17078<table><thead>
17079 <tr>
17080 <th>Option</th>
17081 <th>Type</th>
17082 <th>Default</th>
17083 <th>Description</th>
17084 </tr>
17085 </thead><tbody>
17086 <tr id='gridlayer-attribution'>
17087 <td><code><b>attribution</b></code></td>
17088 <td><code>String</code></td>
17089 <td><code>null</code></td>
17090 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
17091 </tr>
17092</tbody></table>
17093
17094</section></div>
17095 </div>
17096</div>
17097
17098</section><section>
17099<h3 id='gridlayer-event'>Events</h3>
17100
17101<section >
17102
17103
17104
17105
17106<table><thead>
17107 <tr>
17108 <th>Event</th>
17109 <th>Data</th>
17110 <th>Description</th>
17111 </tr>
17112 </thead><tbody>
17113 <tr id='gridlayer-loading'>
17114 <td><code><b>loading</b></code></td>
17115 <td><code><a href='#event'>Event</a></code></td>
17116 <td>Fired when the grid layer starts loading tiles.</td>
17117 </tr>
17118 <tr id='gridlayer-tileunload'>
17119 <td><code><b>tileunload</b></code></td>
17120 <td><code><a href='#tileevent'>TileEvent</a></code></td>
17121 <td>Fired when a tile is removed (e.g. when a tile goes off the screen).</td>
17122 </tr>
17123 <tr id='gridlayer-tileloadstart'>
17124 <td><code><b>tileloadstart</b></code></td>
17125 <td><code><a href='#tileevent'>TileEvent</a></code></td>
17126 <td>Fired when a tile is requested and starts loading.</td>
17127 </tr>
17128 <tr id='gridlayer-tileerror'>
17129 <td><code><b>tileerror</b></code></td>
17130 <td><code><a href='#tileerrorevent'>TileErrorEvent</a></code></td>
17131 <td>Fired when there is an error loading a tile.</td>
17132 </tr>
17133 <tr id='gridlayer-tileload'>
17134 <td><code><b>tileload</b></code></td>
17135 <td><code><a href='#tileevent'>TileEvent</a></code></td>
17136 <td>Fired when a tile loads.</td>
17137 </tr>
17138 <tr id='gridlayer-load'>
17139 <td><code><b>load</b></code></td>
17140 <td><code><a href='#event'>Event</a></code></td>
17141 <td>Fired when the grid layer loaded all visible tiles.</td>
17142 </tr>
17143</tbody></table>
17144
17145</section>
17146
17147
17148<div class='accordion'>
17149 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
17150 <div class='accordion-overflow'>
17151 <div class='accordion-content'><section >
17152
17153
17154
17155
17156<table><thead>
17157 <tr>
17158 <th>Event</th>
17159 <th>Data</th>
17160 <th>Description</th>
17161 </tr>
17162 </thead><tbody>
17163 <tr id='gridlayer-add'>
17164 <td><code><b>add</b></code></td>
17165 <td><code><a href='#event'>Event</a></code></td>
17166 <td>Fired after the layer is added to a map</td>
17167 </tr>
17168 <tr id='gridlayer-remove'>
17169 <td><code><b>remove</b></code></td>
17170 <td><code><a href='#event'>Event</a></code></td>
17171 <td>Fired after the layer is removed from a map</td>
17172 </tr>
17173</tbody></table>
17174
17175</section></div>
17176 </div>
17177</div>
17178
17179<div class='accordion'>
17180 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
17181 <div class='accordion-overflow'>
17182 <div class='accordion-content'><section >
17183
17184
17185
17186
17187<table><thead>
17188 <tr>
17189 <th>Event</th>
17190 <th>Data</th>
17191 <th>Description</th>
17192 </tr>
17193 </thead><tbody>
17194 <tr id='gridlayer-popupopen'>
17195 <td><code><b>popupopen</b></code></td>
17196 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
17197 <td>Fired when a popup bound to this layer is opened</td>
17198 </tr>
17199 <tr id='gridlayer-popupclose'>
17200 <td><code><b>popupclose</b></code></td>
17201 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
17202 <td>Fired when a popup bound to this layer is closed</td>
17203 </tr>
17204</tbody></table>
17205
17206</section></div>
17207 </div>
17208</div>
17209
17210<div class='accordion'>
17211 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
17212 <div class='accordion-overflow'>
17213 <div class='accordion-content'><section >
17214
17215
17216
17217
17218<table><thead>
17219 <tr>
17220 <th>Event</th>
17221 <th>Data</th>
17222 <th>Description</th>
17223 </tr>
17224 </thead><tbody>
17225 <tr id='gridlayer-tooltipopen'>
17226 <td><code><b>tooltipopen</b></code></td>
17227 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
17228 <td>Fired when a tooltip bound to this layer is opened.</td>
17229 </tr>
17230 <tr id='gridlayer-tooltipclose'>
17231 <td><code><b>tooltipclose</b></code></td>
17232 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
17233 <td>Fired when a tooltip bound to this layer is closed.</td>
17234 </tr>
17235</tbody></table>
17236
17237</section></div>
17238 </div>
17239</div>
17240
17241</section><section>
17242<h3 id='gridlayer-method'>Methods</h3>
17243
17244<section >
17245
17246
17247
17248
17249<table><thead>
17250 <tr>
17251 <th>Method</th>
17252 <th>Returns</th>
17253 <th>Description</th>
17254 </tr>
17255 </thead><tbody>
17256 <tr id='gridlayer-bringtofront'>
17257 <td><code><b>bringToFront</b>()</code></td>
17258 <td><code>this</code></td>
17259 <td><p>Brings the tile layer to the top of all tile layers.</p>
17260</td>
17261 </tr>
17262 <tr id='gridlayer-bringtoback'>
17263 <td><code><b>bringToBack</b>()</code></td>
17264 <td><code>this</code></td>
17265 <td><p>Brings the tile layer to the bottom of all tile layers.</p>
17266</td>
17267 </tr>
17268 <tr id='gridlayer-getcontainer'>
17269 <td><code><b>getContainer</b>()</code></td>
17270 <td><code>HTMLElement</code></td>
17271 <td><p>Returns the HTML element that contains the tiles for this layer.</p>
17272</td>
17273 </tr>
17274 <tr id='gridlayer-setopacity'>
17275 <td><code><b>setOpacity</b>(<nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
17276 <td><code>this</code></td>
17277 <td><p>Changes the <a href="#gridlayer-opacity">opacity</a> of the grid layer.</p>
17278</td>
17279 </tr>
17280 <tr id='gridlayer-setzindex'>
17281 <td><code><b>setZIndex</b>(<nobr>&lt;Number&gt;</nobr> <i>zIndex</i>)</code></td>
17282 <td><code>this</code></td>
17283 <td><p>Changes the <a href="#gridlayer-zindex">zIndex</a> of the grid layer.</p>
17284</td>
17285 </tr>
17286 <tr id='gridlayer-isloading'>
17287 <td><code><b>isLoading</b>()</code></td>
17288 <td><code>Boolean</code></td>
17289 <td><p>Returns <code>true</code> if any tile in the grid layer has not finished loading.</p>
17290</td>
17291 </tr>
17292 <tr id='gridlayer-redraw'>
17293 <td><code><b>redraw</b>()</code></td>
17294 <td><code>this</code></td>
17295 <td><p>Causes the layer to clear all the tiles and request them again.</p>
17296</td>
17297 </tr>
17298 <tr id='gridlayer-gettilesize'>
17299 <td><code><b>getTileSize</b>()</code></td>
17300 <td><code><a href='#point'>Point</a></code></td>
17301 <td><p>Normalizes the <a href="#gridlayer-tilesize">tileSize option</a> into a point. Used by the <code>createTile()</code> method.</p>
17302</td>
17303 </tr>
17304</tbody></table>
17305
17306</section><section class='collapsable'>
17307
17308<h4 id='gridlayer-extension-methods'>Extension methods</h4>
17309
17310<div class='section-comments'>Layers extending <a href="#gridlayer"><code>GridLayer</code></a> shall reimplement the following method.</div>
17311
17312<table><thead>
17313 <tr>
17314 <th>Method</th>
17315 <th>Returns</th>
17316 <th>Description</th>
17317 </tr>
17318 </thead><tbody>
17319 <tr id='gridlayer-createtile'>
17320 <td><code><b>createTile</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>, <nobr>&lt;Function&gt;</nobr> <i>done?</i>)</code></td>
17321 <td><code>HTMLElement</code></td>
17322 <td><p>Called only internally, must be overridden by classes extending <a href="#gridlayer"><code>GridLayer</code></a>.
17323Returns the <code>HTMLElement</code> corresponding to the given <code>coords</code>. If the <code>done</code> callback
17324is specified, it must be called when the tile has finished loading and drawing.</p>
17325</td>
17326 </tr>
17327</tbody></table>
17328
17329</section>
17330
17331
17332<div class='accordion'>
17333 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
17334 <div class='accordion-overflow'>
17335 <div class='accordion-content'><section >
17336
17337
17338
17339
17340<table><thead>
17341 <tr>
17342 <th>Method</th>
17343 <th>Returns</th>
17344 <th>Description</th>
17345 </tr>
17346 </thead><tbody>
17347 <tr id='gridlayer-addto'>
17348 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
17349 <td><code>this</code></td>
17350 <td><p>Adds the layer to the given map or layer group.</p>
17351</td>
17352 </tr>
17353 <tr id='gridlayer-remove'>
17354 <td><code><b>remove</b>()</code></td>
17355 <td><code>this</code></td>
17356 <td><p>Removes the layer from the map it is currently active on.</p>
17357</td>
17358 </tr>
17359 <tr id='gridlayer-removefrom'>
17360 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
17361 <td><code>this</code></td>
17362 <td><p>Removes the layer from the given map</p>
17363</td>
17364 </tr>
17365 <tr id='gridlayer-removefrom'>
17366 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
17367 <td><code>this</code></td>
17368 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
17369</td>
17370 </tr>
17371 <tr id='gridlayer-getpane'>
17372 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
17373 <td><code>HTMLElement</code></td>
17374 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
17375</td>
17376 </tr>
17377 <tr id='gridlayer-getattribution'>
17378 <td><code><b>getAttribution</b>()</code></td>
17379 <td><code>String</code></td>
17380 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
17381</td>
17382 </tr>
17383</tbody></table>
17384
17385</section></div>
17386 </div>
17387</div>
17388
17389<div class='accordion'>
17390 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
17391 <div class='accordion-overflow'>
17392 <div class='accordion-content'><section >
17393
17394
17395
17396
17397<table><thead>
17398 <tr>
17399 <th>Method</th>
17400 <th>Returns</th>
17401 <th>Description</th>
17402 </tr>
17403 </thead><tbody>
17404 <tr id='gridlayer-bindpopup'>
17405 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
17406 <td><code>this</code></td>
17407 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
17408necessary event listeners. If a <code>Function</code> is passed it will receive
17409the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
17410</td>
17411 </tr>
17412 <tr id='gridlayer-unbindpopup'>
17413 <td><code><b>unbindPopup</b>()</code></td>
17414 <td><code>this</code></td>
17415 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
17416</td>
17417 </tr>
17418 <tr id='gridlayer-openpopup'>
17419 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
17420 <td><code>this</code></td>
17421 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
17422</td>
17423 </tr>
17424 <tr id='gridlayer-closepopup'>
17425 <td><code><b>closePopup</b>()</code></td>
17426 <td><code>this</code></td>
17427 <td><p>Closes the popup bound to this layer if it is open.</p>
17428</td>
17429 </tr>
17430 <tr id='gridlayer-togglepopup'>
17431 <td><code><b>togglePopup</b>()</code></td>
17432 <td><code>this</code></td>
17433 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
17434</td>
17435 </tr>
17436 <tr id='gridlayer-ispopupopen'>
17437 <td><code><b>isPopupOpen</b>()</code></td>
17438 <td><code>boolean</code></td>
17439 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
17440</td>
17441 </tr>
17442 <tr id='gridlayer-setpopupcontent'>
17443 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
17444 <td><code>this</code></td>
17445 <td><p>Sets the content of the popup bound to this layer.</p>
17446</td>
17447 </tr>
17448 <tr id='gridlayer-getpopup'>
17449 <td><code><b>getPopup</b>()</code></td>
17450 <td><code><a href='#popup'>Popup</a></code></td>
17451 <td><p>Returns the popup bound to this layer.</p>
17452</td>
17453 </tr>
17454</tbody></table>
17455
17456</section></div>
17457 </div>
17458</div>
17459
17460<div class='accordion'>
17461 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
17462 <div class='accordion-overflow'>
17463 <div class='accordion-content'><section >
17464
17465
17466
17467
17468<table><thead>
17469 <tr>
17470 <th>Method</th>
17471 <th>Returns</th>
17472 <th>Description</th>
17473 </tr>
17474 </thead><tbody>
17475 <tr id='gridlayer-bindtooltip'>
17476 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
17477 <td><code>this</code></td>
17478 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
17479necessary event listeners. If a <code>Function</code> is passed it will receive
17480the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
17481</td>
17482 </tr>
17483 <tr id='gridlayer-unbindtooltip'>
17484 <td><code><b>unbindTooltip</b>()</code></td>
17485 <td><code>this</code></td>
17486 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
17487</td>
17488 </tr>
17489 <tr id='gridlayer-opentooltip'>
17490 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
17491 <td><code>this</code></td>
17492 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
17493</td>
17494 </tr>
17495 <tr id='gridlayer-closetooltip'>
17496 <td><code><b>closeTooltip</b>()</code></td>
17497 <td><code>this</code></td>
17498 <td><p>Closes the tooltip bound to this layer if it is open.</p>
17499</td>
17500 </tr>
17501 <tr id='gridlayer-toggletooltip'>
17502 <td><code><b>toggleTooltip</b>()</code></td>
17503 <td><code>this</code></td>
17504 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
17505</td>
17506 </tr>
17507 <tr id='gridlayer-istooltipopen'>
17508 <td><code><b>isTooltipOpen</b>()</code></td>
17509 <td><code>boolean</code></td>
17510 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
17511</td>
17512 </tr>
17513 <tr id='gridlayer-settooltipcontent'>
17514 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
17515 <td><code>this</code></td>
17516 <td><p>Sets the content of the tooltip bound to this layer.</p>
17517</td>
17518 </tr>
17519 <tr id='gridlayer-gettooltip'>
17520 <td><code><b>getTooltip</b>()</code></td>
17521 <td><code><a href='#tooltip'>Tooltip</a></code></td>
17522 <td><p>Returns the tooltip bound to this layer.</p>
17523</td>
17524 </tr>
17525</tbody></table>
17526
17527</section></div>
17528 </div>
17529</div>
17530
17531<div class='accordion'>
17532 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
17533 <div class='accordion-overflow'>
17534 <div class='accordion-content'><section >
17535
17536
17537
17538
17539<table><thead>
17540 <tr>
17541 <th>Method</th>
17542 <th>Returns</th>
17543 <th>Description</th>
17544 </tr>
17545 </thead><tbody>
17546 <tr id='gridlayer-on'>
17547 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
17548 <td><code>this</code></td>
17549 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
17550</td>
17551 </tr>
17552 <tr id='gridlayer-on'>
17553 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
17554 <td><code>this</code></td>
17555 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
17556</td>
17557 </tr>
17558 <tr id='gridlayer-off'>
17559 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
17560 <td><code>this</code></td>
17561 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
17562</td>
17563 </tr>
17564 <tr id='gridlayer-off'>
17565 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
17566 <td><code>this</code></td>
17567 <td><p>Removes a set of type/listener pairs.</p>
17568</td>
17569 </tr>
17570 <tr id='gridlayer-off'>
17571 <td><code><b>off</b>()</code></td>
17572 <td><code>this</code></td>
17573 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
17574</td>
17575 </tr>
17576 <tr id='gridlayer-fire'>
17577 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
17578 <td><code>this</code></td>
17579 <td><p>Fires an event of the specified type. You can optionally provide an data
17580object — the first argument of the listener function will contain its
17581properties. The event can optionally be propagated to event parents.</p>
17582</td>
17583 </tr>
17584 <tr id='gridlayer-listens'>
17585 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
17586 <td><code>Boolean</code></td>
17587 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
17588</td>
17589 </tr>
17590 <tr id='gridlayer-once'>
17591 <td><code><b>once</b>(<i></i>)</code></td>
17592 <td><code>this</code></td>
17593 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
17594</td>
17595 </tr>
17596 <tr id='gridlayer-addeventparent'>
17597 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
17598 <td><code>this</code></td>
17599 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
17600</td>
17601 </tr>
17602 <tr id='gridlayer-removeeventparent'>
17603 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
17604 <td><code>this</code></td>
17605 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
17606</td>
17607 </tr>
17608 <tr id='gridlayer-addeventlistener'>
17609 <td><code><b>addEventListener</b>(<i></i>)</code></td>
17610 <td><code>this</code></td>
17611 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
17612</td>
17613 </tr>
17614 <tr id='gridlayer-removeeventlistener'>
17615 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
17616 <td><code>this</code></td>
17617 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
17618</td>
17619 </tr>
17620 <tr id='gridlayer-clearalleventlisteners'>
17621 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
17622 <td><code>this</code></td>
17623 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
17624</td>
17625 </tr>
17626 <tr id='gridlayer-addonetimeeventlistener'>
17627 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
17628 <td><code>this</code></td>
17629 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
17630</td>
17631 </tr>
17632 <tr id='gridlayer-fireevent'>
17633 <td><code><b>fireEvent</b>(<i></i>)</code></td>
17634 <td><code>this</code></td>
17635 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
17636</td>
17637 </tr>
17638 <tr id='gridlayer-haseventlisteners'>
17639 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
17640 <td><code>Boolean</code></td>
17641 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
17642</td>
17643 </tr>
17644</tbody></table>
17645
17646</section></div>
17647 </div>
17648</div>
17649
17650</section><h2 id='latlng'>LatLng</h2><p>Represents a geographical point with a certain latitude and longitude.</p>
17651
17652<section>
17653<h3 id='latlng-example'>Usage example</h3>
17654
17655<section >
17656
17657
17658
17659
17660
17661<pre><code>var latlng = L.latLng(50.5, 30.5);
17662</code></pre><p>All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:</p>
17663<pre><code>map.panTo([50, 30]);
17664map.panTo({lon: 30, lat: 50});
17665map.panTo({lat: 50, lng: 30});
17666map.panTo(L.latLng(50, 30));
17667</code></pre><p>Note that <a href="#latlng"><code>LatLng</code></a> does not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
17668which means new classes can&#39;t inherit from it, and new methods
17669can&#39;t be added to it with the <code>include</code> function.</p>
17670
17671
17672
17673</section>
17674
17675
17676</section><section>
17677<h3 id='latlng-factory'>Creation</h3>
17678
17679<section >
17680
17681
17682
17683
17684<table><thead>
17685 <tr>
17686 <th>Factory</th>
17687 <th>Description</th>
17688 </tr>
17689 </thead><tbody>
17690 <tr id='latlng-l-latlng'>
17691 <td><code><b>L.latLng</b>(<nobr>&lt;Number&gt;</nobr> <i>latitude</i>, <nobr>&lt;Number&gt;</nobr> <i>longitude</i>, <nobr>&lt;Number&gt;</nobr> <i>altitude?</i>)</code></td>
17692 <td>Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).</td>
17693 </tr>
17694 <tr id='latlng-l-latlng'>
17695 <td><code><b>L.latLng</b>(<nobr>&lt;Array&gt;</nobr> <i>coords</i>)</code></td>
17696 <td>Expects an array of the form <code>[Number, Number]</code> or <code>[Number, Number, Number]</code> instead.</td>
17697 </tr>
17698 <tr id='latlng-l-latlng'>
17699 <td><code><b>L.latLng</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>)</code></td>
17700 <td>Expects an plain object of the form <code>{lat: Number, lng: Number}</code> or <code>{lat: Number, lng: Number, alt: Number}</code> instead.</td>
17701 </tr>
17702</tbody></table>
17703
17704</section>
17705
17706
17707</section><section>
17708<h3 id='latlng-method'>Methods</h3>
17709
17710<section >
17711
17712
17713
17714
17715<table><thead>
17716 <tr>
17717 <th>Method</th>
17718 <th>Returns</th>
17719 <th>Description</th>
17720 </tr>
17721 </thead><tbody>
17722 <tr id='latlng-equals'>
17723 <td><code><b>equals</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>otherLatLng</i>, <nobr>&lt;Number&gt;</nobr> <i>maxMargin?</i>)</code></td>
17724 <td><code>Boolean</code></td>
17725 <td><p>Returns <code>true</code> if the given <a href="#latlng"><code>LatLng</code></a> point is at the same position (within a small margin of error). The margin of error can be overridden by setting <code>maxMargin</code> to a small number.</p>
17726</td>
17727 </tr>
17728 <tr id='latlng-tostring'>
17729 <td><code><b>toString</b>()</code></td>
17730 <td><code>String</code></td>
17731 <td><p>Returns a string representation of the point (for debugging purposes).</p>
17732</td>
17733 </tr>
17734 <tr id='latlng-distanceto'>
17735 <td><code><b>distanceTo</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>otherLatLng</i>)</code></td>
17736 <td><code>Number</code></td>
17737 <td><p>Returns the distance (in meters) to the given <a href="#latlng"><code>LatLng</code></a> calculated using the <a href="https://en.wikipedia.org/wiki/Spherical_law_of_cosines">Spherical Law of Cosines</a>.</p>
17738</td>
17739 </tr>
17740 <tr id='latlng-wrap'>
17741 <td><code><b>wrap</b>()</code></td>
17742 <td><code><a href='#latlng'>LatLng</a></code></td>
17743 <td><p>Returns a new <a href="#latlng"><code>LatLng</code></a> object with the longitude wrapped so it&#39;s always between -180 and +180 degrees.</p>
17744</td>
17745 </tr>
17746 <tr id='latlng-tobounds'>
17747 <td><code><b>toBounds</b>(<nobr>&lt;Number&gt;</nobr> <i>sizeInMeters</i>)</code></td>
17748 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
17749 <td><p>Returns a new <a href="#latlngbounds"><code>LatLngBounds</code></a> object in which each boundary is <code>sizeInMeters/2</code> meters apart from the <a href="#latlng"><code>LatLng</code></a>.</p>
17750</td>
17751 </tr>
17752</tbody></table>
17753
17754</section>
17755
17756
17757</section><section>
17758<h3 id='latlng-property'>Properties</h3>
17759
17760<section >
17761
17762
17763
17764
17765<table><thead>
17766 <tr>
17767 <th>Property</th>
17768 <th>Type</th>
17769 <th>Description</th>
17770 </tr>
17771 </thead><tbody>
17772 <tr id='latlng-lat'>
17773 <td><code><b>lat</b></code></td>
17774 <td><code>Number</code></td>
17775 <td>Latitude in degrees</td>
17776 </tr>
17777 <tr id='latlng-lng'>
17778 <td><code><b>lng</b></code></td>
17779 <td><code>Number</code></td>
17780 <td>Longitude in degrees</td>
17781 </tr>
17782 <tr id='latlng-alt'>
17783 <td><code><b>alt</b></code></td>
17784 <td><code>Number</code></td>
17785 <td>Altitude in meters (optional)</td>
17786 </tr>
17787</tbody></table>
17788
17789</section>
17790
17791
17792</section><h2 id='latlngbounds'>LatLngBounds</h2><p>Represents a rectangular geographical area on a map.</p>
17793
17794<section>
17795<h3 id='latlngbounds-example'>Usage example</h3>
17796
17797<section >
17798
17799
17800
17801
17802
17803<pre><code class="lang-js">var corner1 = L.latLng(40.712, -74.227),
17804corner2 = L.latLng(40.774, -74.125),
17805bounds = L.latLngBounds(corner1, corner2);
17806</code></pre>
17807<p>All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:</p>
17808<pre><code class="lang-js">map.fitBounds([
17809 [40.712, -74.227],
17810 [40.774, -74.125]
17811]);
17812</code></pre>
17813<p>Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners <em>outside</em> the [-180, 180] degrees longitude range.
17814Note that <a href="#latlngbounds"><code>LatLngBounds</code></a> does not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
17815which means new classes can&#39;t inherit from it, and new methods
17816can&#39;t be added to it with the <code>include</code> function.</p>
17817
17818
17819
17820</section>
17821
17822
17823</section><section>
17824<h3 id='latlngbounds-factory'>Creation</h3>
17825
17826<section >
17827
17828
17829
17830
17831<table><thead>
17832 <tr>
17833 <th>Factory</th>
17834 <th>Description</th>
17835 </tr>
17836 </thead><tbody>
17837 <tr id='latlngbounds-l-latlngbounds'>
17838 <td><code><b>L.latLngBounds</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>corner1</i>, <nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>corner2</i>)</code></td>
17839 <td>Creates a <a href="#latlngbounds"><code>LatLngBounds</code></a> object by defining two diagonally opposite corners of the rectangle.</td>
17840 </tr>
17841 <tr id='latlngbounds-l-latlngbounds'>
17842 <td><code><b>L.latLngBounds</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>)</code></td>
17843 <td>Creates a <a href="#latlngbounds"><code>LatLngBounds</code></a> object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with <a href="#map-fitbounds"><code>fitBounds</code></a>.</td>
17844 </tr>
17845</tbody></table>
17846
17847</section>
17848
17849
17850</section><section>
17851<h3 id='latlngbounds-method'>Methods</h3>
17852
17853<section >
17854
17855
17856
17857
17858<table><thead>
17859 <tr>
17860 <th>Method</th>
17861 <th>Returns</th>
17862 <th>Description</th>
17863 </tr>
17864 </thead><tbody>
17865 <tr id='latlngbounds-extend'>
17866 <td><code><b>extend</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
17867 <td><code>this</code></td>
17868 <td><p>Extend the bounds to contain the given point</p>
17869</td>
17870 </tr>
17871 <tr id='latlngbounds-extend'>
17872 <td><code><b>extend</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
17873 <td><code>this</code></td>
17874 <td><p>Extend the bounds to contain the given bounds</p>
17875</td>
17876 </tr>
17877 <tr id='latlngbounds-pad'>
17878 <td><code><b>pad</b>(<nobr>&lt;Number&gt;</nobr> <i>bufferRatio</i>)</code></td>
17879 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
17880 <td><p>Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
17881For example, a ratio of 0.5 extends the bounds by 50% in each direction.
17882Negative values will retract the bounds.</p>
17883</td>
17884 </tr>
17885 <tr id='latlngbounds-getcenter'>
17886 <td><code><b>getCenter</b>()</code></td>
17887 <td><code><a href='#latlng'>LatLng</a></code></td>
17888 <td><p>Returns the center point of the bounds.</p>
17889</td>
17890 </tr>
17891 <tr id='latlngbounds-getsouthwest'>
17892 <td><code><b>getSouthWest</b>()</code></td>
17893 <td><code><a href='#latlng'>LatLng</a></code></td>
17894 <td><p>Returns the south-west point of the bounds.</p>
17895</td>
17896 </tr>
17897 <tr id='latlngbounds-getnortheast'>
17898 <td><code><b>getNorthEast</b>()</code></td>
17899 <td><code><a href='#latlng'>LatLng</a></code></td>
17900 <td><p>Returns the north-east point of the bounds.</p>
17901</td>
17902 </tr>
17903 <tr id='latlngbounds-getnorthwest'>
17904 <td><code><b>getNorthWest</b>()</code></td>
17905 <td><code><a href='#latlng'>LatLng</a></code></td>
17906 <td><p>Returns the north-west point of the bounds.</p>
17907</td>
17908 </tr>
17909 <tr id='latlngbounds-getsoutheast'>
17910 <td><code><b>getSouthEast</b>()</code></td>
17911 <td><code><a href='#latlng'>LatLng</a></code></td>
17912 <td><p>Returns the south-east point of the bounds.</p>
17913</td>
17914 </tr>
17915 <tr id='latlngbounds-getwest'>
17916 <td><code><b>getWest</b>()</code></td>
17917 <td><code>Number</code></td>
17918 <td><p>Returns the west longitude of the bounds</p>
17919</td>
17920 </tr>
17921 <tr id='latlngbounds-getsouth'>
17922 <td><code><b>getSouth</b>()</code></td>
17923 <td><code>Number</code></td>
17924 <td><p>Returns the south latitude of the bounds</p>
17925</td>
17926 </tr>
17927 <tr id='latlngbounds-geteast'>
17928 <td><code><b>getEast</b>()</code></td>
17929 <td><code>Number</code></td>
17930 <td><p>Returns the east longitude of the bounds</p>
17931</td>
17932 </tr>
17933 <tr id='latlngbounds-getnorth'>
17934 <td><code><b>getNorth</b>()</code></td>
17935 <td><code>Number</code></td>
17936 <td><p>Returns the north latitude of the bounds</p>
17937</td>
17938 </tr>
17939 <tr id='latlngbounds-contains'>
17940 <td><code><b>contains</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
17941 <td><code>Boolean</code></td>
17942 <td><p>Returns <code>true</code> if the rectangle contains the given one.</p>
17943</td>
17944 </tr>
17945 <tr id='latlngbounds-contains'>
17946 <td><code><b>contains</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
17947 <td><code>Boolean</code></td>
17948 <td><p>Returns <code>true</code> if the rectangle contains the given point.</p>
17949</td>
17950 </tr>
17951 <tr id='latlngbounds-intersects'>
17952 <td><code><b>intersects</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
17953 <td><code>Boolean</code></td>
17954 <td><p>Returns <code>true</code> if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.</p>
17955</td>
17956 </tr>
17957 <tr id='latlngbounds-overlaps'>
17958 <td><code><b>overlaps</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
17959 <td><code>Boolean</code></td>
17960 <td><p>Returns <code>true</code> if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.</p>
17961</td>
17962 </tr>
17963 <tr id='latlngbounds-tobboxstring'>
17964 <td><code><b>toBBoxString</b>()</code></td>
17965 <td><code>String</code></td>
17966 <td><p>Returns a string with bounding box coordinates in a &#39;southwest_lng,southwest_lat,northeast_lng,northeast_lat&#39; format. Useful for sending requests to web services that return geo data.</p>
17967</td>
17968 </tr>
17969 <tr id='latlngbounds-equals'>
17970 <td><code><b>equals</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>otherBounds</i>, <nobr>&lt;Number&gt;</nobr> <i>maxMargin?</i>)</code></td>
17971 <td><code>Boolean</code></td>
17972 <td><p>Returns <code>true</code> if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting <code>maxMargin</code> to a small number.</p>
17973</td>
17974 </tr>
17975 <tr id='latlngbounds-isvalid'>
17976 <td><code><b>isValid</b>()</code></td>
17977 <td><code>Boolean</code></td>
17978 <td><p>Returns <code>true</code> if the bounds are properly initialized.</p>
17979</td>
17980 </tr>
17981</tbody></table>
17982
17983</section>
17984
17985
17986</section><h2 id='point'>Point</h2><p>Represents a point with <code>x</code> and <code>y</code> coordinates in pixels.</p>
17987
17988<section>
17989<h3 id='point-example'>Usage example</h3>
17990
17991<section >
17992
17993
17994
17995
17996
17997<pre><code class="lang-js">var point = L.point(200, 300);
17998</code></pre>
17999<p>All Leaflet methods and options that accept <a href="#point"><code>Point</code></a> objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:</p>
18000<pre><code class="lang-js">map.panBy([200, 300]);
18001map.panBy(L.point(200, 300));
18002</code></pre>
18003<p>Note that <code>Point</code> does not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
18004which means new classes can&#39;t inherit from it, and new methods
18005can&#39;t be added to it with the <code>include</code> function.</p>
18006
18007
18008
18009</section>
18010
18011
18012</section><section>
18013<h3 id='point-factory'>Creation</h3>
18014
18015<section >
18016
18017
18018
18019
18020<table><thead>
18021 <tr>
18022 <th>Factory</th>
18023 <th>Description</th>
18024 </tr>
18025 </thead><tbody>
18026 <tr id='point-l-point'>
18027 <td><code><b>L.point</b>(<nobr>&lt;Number&gt;</nobr> <i>x</i>, <nobr>&lt;Number&gt;</nobr> <i>y</i>, <nobr>&lt;Boolean&gt;</nobr> <i>round?</i>)</code></td>
18028 <td>Creates a Point object with the given <code>x</code> and <code>y</code> coordinates. If optional <code>round</code> is set to true, rounds the <code>x</code> and <code>y</code> values.</td>
18029 </tr>
18030 <tr id='point-l-point'>
18031 <td><code><b>L.point</b>(<nobr>&lt;Number[]&gt;</nobr> <i>coords</i>)</code></td>
18032 <td>Expects an array of the form <code>[x, y]</code> instead.</td>
18033 </tr>
18034 <tr id='point-l-point'>
18035 <td><code><b>L.point</b>(<nobr>&lt;Object&gt;</nobr> <i>coords</i>)</code></td>
18036 <td>Expects a plain object of the form <code>{x: Number, y: Number}</code> instead.</td>
18037 </tr>
18038</tbody></table>
18039
18040</section>
18041
18042
18043</section><section>
18044<h3 id='point-method'>Methods</h3>
18045
18046<section >
18047
18048
18049
18050
18051<table><thead>
18052 <tr>
18053 <th>Method</th>
18054 <th>Returns</th>
18055 <th>Description</th>
18056 </tr>
18057 </thead><tbody>
18058 <tr id='point-clone'>
18059 <td><code><b>clone</b>()</code></td>
18060 <td><code><a href='#point'>Point</a></code></td>
18061 <td><p>Returns a copy of the current point.</p>
18062</td>
18063 </tr>
18064 <tr id='point-add'>
18065 <td><code><b>add</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>otherPoint</i>)</code></td>
18066 <td><code><a href='#point'>Point</a></code></td>
18067 <td><p>Returns the result of addition of the current and the given points.</p>
18068</td>
18069 </tr>
18070 <tr id='point-subtract'>
18071 <td><code><b>subtract</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>otherPoint</i>)</code></td>
18072 <td><code><a href='#point'>Point</a></code></td>
18073 <td><p>Returns the result of subtraction of the given point from the current.</p>
18074</td>
18075 </tr>
18076 <tr id='point-divideby'>
18077 <td><code><b>divideBy</b>(<nobr>&lt;Number&gt;</nobr> <i>num</i>)</code></td>
18078 <td><code><a href='#point'>Point</a></code></td>
18079 <td><p>Returns the result of division of the current point by the given number.</p>
18080</td>
18081 </tr>
18082 <tr id='point-multiplyby'>
18083 <td><code><b>multiplyBy</b>(<nobr>&lt;Number&gt;</nobr> <i>num</i>)</code></td>
18084 <td><code><a href='#point'>Point</a></code></td>
18085 <td><p>Returns the result of multiplication of the current point by the given number.</p>
18086</td>
18087 </tr>
18088 <tr id='point-scaleby'>
18089 <td><code><b>scaleBy</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>scale</i>)</code></td>
18090 <td><code><a href='#point'>Point</a></code></td>
18091 <td><p>Multiply each coordinate of the current point by each coordinate of
18092<code>scale</code>. In linear algebra terms, multiply the point by the
18093<a href="https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation">scaling matrix</a>
18094defined by <code>scale</code>.</p>
18095</td>
18096 </tr>
18097 <tr id='point-unscaleby'>
18098 <td><code><b>unscaleBy</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>scale</i>)</code></td>
18099 <td><code><a href='#point'>Point</a></code></td>
18100 <td><p>Inverse of <code>scaleBy</code>. Divide each coordinate of the current point by
18101each coordinate of <code>scale</code>.</p>
18102</td>
18103 </tr>
18104 <tr id='point-round'>
18105 <td><code><b>round</b>()</code></td>
18106 <td><code><a href='#point'>Point</a></code></td>
18107 <td><p>Returns a copy of the current point with rounded coordinates.</p>
18108</td>
18109 </tr>
18110 <tr id='point-floor'>
18111 <td><code><b>floor</b>()</code></td>
18112 <td><code><a href='#point'>Point</a></code></td>
18113 <td><p>Returns a copy of the current point with floored coordinates (rounded down).</p>
18114</td>
18115 </tr>
18116 <tr id='point-ceil'>
18117 <td><code><b>ceil</b>()</code></td>
18118 <td><code><a href='#point'>Point</a></code></td>
18119 <td><p>Returns a copy of the current point with ceiled coordinates (rounded up).</p>
18120</td>
18121 </tr>
18122 <tr id='point-trunc'>
18123 <td><code><b>trunc</b>()</code></td>
18124 <td><code><a href='#point'>Point</a></code></td>
18125 <td><p>Returns a copy of the current point with truncated coordinates (rounded towards zero).</p>
18126</td>
18127 </tr>
18128 <tr id='point-distanceto'>
18129 <td><code><b>distanceTo</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>otherPoint</i>)</code></td>
18130 <td><code>Number</code></td>
18131 <td><p>Returns the cartesian distance between the current and the given points.</p>
18132</td>
18133 </tr>
18134 <tr id='point-equals'>
18135 <td><code><b>equals</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>otherPoint</i>)</code></td>
18136 <td><code>Boolean</code></td>
18137 <td><p>Returns <code>true</code> if the given point has the same coordinates.</p>
18138</td>
18139 </tr>
18140 <tr id='point-contains'>
18141 <td><code><b>contains</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>otherPoint</i>)</code></td>
18142 <td><code>Boolean</code></td>
18143 <td><p>Returns <code>true</code> if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).</p>
18144</td>
18145 </tr>
18146 <tr id='point-tostring'>
18147 <td><code><b>toString</b>()</code></td>
18148 <td><code>String</code></td>
18149 <td><p>Returns a string representation of the point for debugging purposes.</p>
18150</td>
18151 </tr>
18152</tbody></table>
18153
18154</section>
18155
18156
18157</section><section>
18158<h3 id='point-property'>Properties</h3>
18159
18160<section >
18161
18162
18163
18164
18165<table><thead>
18166 <tr>
18167 <th>Property</th>
18168 <th>Type</th>
18169 <th>Description</th>
18170 </tr>
18171 </thead><tbody>
18172 <tr id='point-x'>
18173 <td><code><b>x</b></code></td>
18174 <td><code>Number</code></td>
18175 <td>The <code>x</code> coordinate of the point</td>
18176 </tr>
18177 <tr id='point-y'>
18178 <td><code><b>y</b></code></td>
18179 <td><code>Number</code></td>
18180 <td>The <code>y</code> coordinate of the point</td>
18181 </tr>
18182</tbody></table>
18183
18184</section>
18185
18186
18187</section><h2 id='bounds'>Bounds</h2><p>Represents a rectangular area in pixel coordinates.</p>
18188
18189<section>
18190<h3 id='bounds-example'>Usage example</h3>
18191
18192<section >
18193
18194
18195
18196
18197
18198<pre><code class="lang-js">var p1 = L.point(10, 10),
18199p2 = L.point(40, 60),
18200bounds = L.bounds(p1, p2);
18201</code></pre>
18202<p>All Leaflet methods that accept <a href="#bounds"><code>Bounds</code></a> objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:</p>
18203<pre><code class="lang-js">otherBounds.intersects([[10, 10], [40, 60]]);
18204</code></pre>
18205<p>Note that <code>Bounds</code> does not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
18206which means new classes can&#39;t inherit from it, and new methods
18207can&#39;t be added to it with the <code>include</code> function.</p>
18208
18209
18210
18211</section>
18212
18213
18214</section><section>
18215<h3 id='bounds-factory'>Creation</h3>
18216
18217<section >
18218
18219
18220
18221
18222<table><thead>
18223 <tr>
18224 <th>Factory</th>
18225 <th>Description</th>
18226 </tr>
18227 </thead><tbody>
18228 <tr id='bounds-l-bounds'>
18229 <td><code><b>L.bounds</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>corner1</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>corner2</i>)</code></td>
18230 <td>Creates a Bounds object from two corners coordinate pairs.</td>
18231 </tr>
18232 <tr id='bounds-l-bounds'>
18233 <td><code><b>L.bounds</b>(<nobr>&lt;Point[]&gt;</nobr> <i>points</i>)</code></td>
18234 <td>Creates a Bounds object from the given array of points.</td>
18235 </tr>
18236</tbody></table>
18237
18238</section>
18239
18240
18241</section><section>
18242<h3 id='bounds-method'>Methods</h3>
18243
18244<section >
18245
18246
18247
18248
18249<table><thead>
18250 <tr>
18251 <th>Method</th>
18252 <th>Returns</th>
18253 <th>Description</th>
18254 </tr>
18255 </thead><tbody>
18256 <tr id='bounds-extend'>
18257 <td><code><b>extend</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
18258 <td><code>this</code></td>
18259 <td><p>Extends the bounds to contain the given point.</p>
18260</td>
18261 </tr>
18262 <tr id='bounds-getcenter'>
18263 <td><code><b>getCenter</b>(<nobr>&lt;Boolean&gt;</nobr> <i>round?</i>)</code></td>
18264 <td><code><a href='#point'>Point</a></code></td>
18265 <td><p>Returns the center point of the bounds.</p>
18266</td>
18267 </tr>
18268 <tr id='bounds-getbottomleft'>
18269 <td><code><b>getBottomLeft</b>()</code></td>
18270 <td><code><a href='#point'>Point</a></code></td>
18271 <td><p>Returns the bottom-left point of the bounds.</p>
18272</td>
18273 </tr>
18274 <tr id='bounds-gettopright'>
18275 <td><code><b>getTopRight</b>()</code></td>
18276 <td><code><a href='#point'>Point</a></code></td>
18277 <td><p>Returns the top-right point of the bounds.</p>
18278</td>
18279 </tr>
18280 <tr id='bounds-gettopleft'>
18281 <td><code><b>getTopLeft</b>()</code></td>
18282 <td><code><a href='#point'>Point</a></code></td>
18283 <td><p>Returns the top-left point of the bounds (i.e. <a href="#bounds-min"><code>this.min</code></a>).</p>
18284</td>
18285 </tr>
18286 <tr id='bounds-getbottomright'>
18287 <td><code><b>getBottomRight</b>()</code></td>
18288 <td><code><a href='#point'>Point</a></code></td>
18289 <td><p>Returns the bottom-right point of the bounds (i.e. <a href="#bounds-max"><code>this.max</code></a>).</p>
18290</td>
18291 </tr>
18292 <tr id='bounds-getsize'>
18293 <td><code><b>getSize</b>()</code></td>
18294 <td><code><a href='#point'>Point</a></code></td>
18295 <td><p>Returns the size of the given bounds</p>
18296</td>
18297 </tr>
18298 <tr id='bounds-contains'>
18299 <td><code><b>contains</b>(<nobr>&lt;<a href='#bounds'>Bounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
18300 <td><code>Boolean</code></td>
18301 <td><p>Returns <code>true</code> if the rectangle contains the given one.</p>
18302</td>
18303 </tr>
18304 <tr id='bounds-contains'>
18305 <td><code><b>contains</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
18306 <td><code>Boolean</code></td>
18307 <td><p>Returns <code>true</code> if the rectangle contains the given point.</p>
18308</td>
18309 </tr>
18310 <tr id='bounds-intersects'>
18311 <td><code><b>intersects</b>(<nobr>&lt;<a href='#bounds'>Bounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
18312 <td><code>Boolean</code></td>
18313 <td><p>Returns <code>true</code> if the rectangle intersects the given bounds. Two bounds
18314intersect if they have at least one point in common.</p>
18315</td>
18316 </tr>
18317 <tr id='bounds-overlaps'>
18318 <td><code><b>overlaps</b>(<nobr>&lt;<a href='#bounds'>Bounds</a>&gt;</nobr> <i>otherBounds</i>)</code></td>
18319 <td><code>Boolean</code></td>
18320 <td><p>Returns <code>true</code> if the rectangle overlaps the given bounds. Two bounds
18321overlap if their intersection is an area.</p>
18322</td>
18323 </tr>
18324</tbody></table>
18325
18326</section>
18327
18328
18329</section><section>
18330<h3 id='bounds-property'>Properties</h3>
18331
18332<section >
18333
18334
18335
18336
18337<table><thead>
18338 <tr>
18339 <th>Property</th>
18340 <th>Type</th>
18341 <th>Description</th>
18342 </tr>
18343 </thead><tbody>
18344 <tr id='bounds-min'>
18345 <td><code><b>min</b></code></td>
18346 <td><code><a href='#point'>Point</a></code></td>
18347 <td>The top left corner of the rectangle.</td>
18348 </tr>
18349 <tr id='bounds-max'>
18350 <td><code><b>max</b></code></td>
18351 <td><code><a href='#point'>Point</a></code></td>
18352 <td>The bottom right corner of the rectangle.</td>
18353 </tr>
18354</tbody></table>
18355
18356</section>
18357
18358
18359</section><h2 id='icon'>Icon</h2><p>Represents an icon to provide when creating a marker.</p>
18360
18361<section>
18362<h3 id='icon-example'>Usage example</h3>
18363
18364<section >
18365
18366
18367
18368
18369
18370<pre><code class="lang-js">var myIcon = L.icon({
18371 iconUrl: &#39;my-icon.png&#39;,
18372 iconSize: [38, 95],
18373 iconAnchor: [22, 94],
18374 popupAnchor: [-3, -76],
18375 shadowUrl: &#39;my-icon-shadow.png&#39;,
18376 shadowSize: [68, 95],
18377 shadowAnchor: [22, 94]
18378});
18379L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
18380</code></pre>
18381<p><a href="#icon-default"><code>L.Icon.Default</code></a> extends <a href="#icon"><code>L.Icon</code></a> and is the blue icon Leaflet uses for markers by default.</p>
18382
18383
18384
18385</section>
18386
18387
18388</section><section>
18389<h3 id='icon-factory'>Creation</h3>
18390
18391<section >
18392
18393
18394
18395
18396<table><thead>
18397 <tr>
18398 <th>Factory</th>
18399 <th>Description</th>
18400 </tr>
18401 </thead><tbody>
18402 <tr id='icon-l-icon'>
18403 <td><code><b>L.icon</b>(<nobr>&lt;<a href='#icon-option'>Icon options</a>&gt;</nobr> <i>options</i>)</code></td>
18404 <td>Creates an icon instance with the given options.</td>
18405 </tr>
18406</tbody></table>
18407
18408</section>
18409
18410
18411</section><section>
18412<h3 id='icon-option'>Options</h3>
18413
18414<section >
18415
18416
18417
18418
18419<table><thead>
18420 <tr>
18421 <th>Option</th>
18422 <th>Type</th>
18423 <th>Default</th>
18424 <th>Description</th>
18425 </tr>
18426 </thead><tbody>
18427 <tr id='icon-iconurl'>
18428 <td><code><b>iconUrl</b></code></td>
18429 <td><code>String</code></td>
18430 <td><code>null</code></td>
18431 <td><strong>(required)</strong> The URL to the icon image (absolute or relative to your script path).</td>
18432 </tr>
18433 <tr id='icon-iconretinaurl'>
18434 <td><code><b>iconRetinaUrl</b></code></td>
18435 <td><code>String</code></td>
18436 <td><code>null</code></td>
18437 <td>The URL to a retina sized version of the icon image (absolute or relative to your
18438script path). Used for Retina screen devices.</td>
18439 </tr>
18440 <tr id='icon-iconsize'>
18441 <td><code><b>iconSize</b></code></td>
18442 <td><code><a href='#point'>Point</a></code></td>
18443 <td><code>null</code></td>
18444 <td>Size of the icon image in pixels.</td>
18445 </tr>
18446 <tr id='icon-iconanchor'>
18447 <td><code><b>iconAnchor</b></code></td>
18448 <td><code><a href='#point'>Point</a></code></td>
18449 <td><code>null</code></td>
18450 <td>The coordinates of the &quot;tip&quot; of the icon (relative to its top left corner). The icon
18451will be aligned so that this point is at the marker&#39;s geographical location. Centered
18452by default if size is specified, also can be set in CSS with negative margins.</td>
18453 </tr>
18454 <tr id='icon-popupanchor'>
18455 <td><code><b>popupAnchor</b></code></td>
18456 <td><code><a href='#point'>Point</a></code></td>
18457 <td><code>[0, 0]</code></td>
18458 <td>The coordinates of the point from which popups will &quot;open&quot;, relative to the icon anchor.</td>
18459 </tr>
18460 <tr id='icon-tooltipanchor'>
18461 <td><code><b>tooltipAnchor</b></code></td>
18462 <td><code><a href='#point'>Point</a></code></td>
18463 <td><code>[0, 0]</code></td>
18464 <td>The coordinates of the point from which tooltips will &quot;open&quot;, relative to the icon anchor.</td>
18465 </tr>
18466 <tr id='icon-shadowurl'>
18467 <td><code><b>shadowUrl</b></code></td>
18468 <td><code>String</code></td>
18469 <td><code>null</code></td>
18470 <td>The URL to the icon shadow image. If not specified, no shadow image will be created.</td>
18471 </tr>
18472 <tr id='icon-shadowretinaurl'>
18473 <td><code><b>shadowRetinaUrl</b></code></td>
18474 <td><code>String</code></td>
18475 <td><code>null</code></td>
18476 <td></td>
18477 </tr>
18478 <tr id='icon-shadowsize'>
18479 <td><code><b>shadowSize</b></code></td>
18480 <td><code><a href='#point'>Point</a></code></td>
18481 <td><code>null</code></td>
18482 <td>Size of the shadow image in pixels.</td>
18483 </tr>
18484 <tr id='icon-shadowanchor'>
18485 <td><code><b>shadowAnchor</b></code></td>
18486 <td><code><a href='#point'>Point</a></code></td>
18487 <td><code>null</code></td>
18488 <td>The coordinates of the &quot;tip&quot; of the shadow (relative to its top left corner) (the same
18489as iconAnchor if not specified).</td>
18490 </tr>
18491 <tr id='icon-classname'>
18492 <td><code><b>className</b></code></td>
18493 <td><code>String</code></td>
18494 <td><code>&#x27;&#x27;</code></td>
18495 <td>A custom class name to assign to both icon and shadow images. Empty by default.</td>
18496 </tr>
18497</tbody></table>
18498
18499</section>
18500
18501
18502</section><section>
18503<h3 id='icon-method'>Methods</h3>
18504
18505<section >
18506
18507
18508
18509
18510<table><thead>
18511 <tr>
18512 <th>Method</th>
18513 <th>Returns</th>
18514 <th>Description</th>
18515 </tr>
18516 </thead><tbody>
18517 <tr id='icon-createicon'>
18518 <td><code><b>createIcon</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>oldIcon?</i>)</code></td>
18519 <td><code>HTMLElement</code></td>
18520 <td><p>Called internally when the icon has to be shown, returns a <code>&lt;img&gt;</code> HTML element
18521styled according to the options.</p>
18522</td>
18523 </tr>
18524 <tr id='icon-createshadow'>
18525 <td><code><b>createShadow</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>oldIcon?</i>)</code></td>
18526 <td><code>HTMLElement</code></td>
18527 <td><p>As <code>createIcon</code>, but for the shadow beneath it.</p>
18528</td>
18529 </tr>
18530</tbody></table>
18531
18532</section>
18533
18534
18535</section><span id='icon-default'></span>
18536
18537<section>
18538<h3 id='icon-default-option'>Icon.Default</h3>
18539
18540<section >
18541
18542
18543
18544<div class='section-comments'>A trivial subclass of <a href="#icon"><code>Icon</code></a>, represents the icon to use in <a href="#marker"><code>Marker</code></a>s when
18545no icon is specified. Points to the blue marker image distributed with Leaflet
18546releases.
18547In order to customize the default icon, just change the properties of <code>L.Icon.Default.prototype.options</code>
18548(which is a set of <a href="#icon-option"><code>Icon options</code></a>).
18549If you want to <em>completely</em> replace the default icon, override the
18550<code>L.Marker.prototype.options.icon</code> with your own icon instead.</div>
18551
18552<table><thead>
18553 <tr>
18554 <th>Option</th>
18555 <th>Type</th>
18556 <th>Default</th>
18557 <th>Description</th>
18558 </tr>
18559 </thead><tbody>
18560 <tr id='icon-default-imagepath'>
18561 <td><code><b>imagePath</b></code></td>
18562 <td><code>String</code></td>
18563 <td><code></code></td>
18564 <td><a href="#icon-default"><code>Icon.Default</code></a> will try to auto-detect the location of the
18565blue icon images. If you are placing these images in a non-standard
18566way, set this option to point to the right path.</td>
18567 </tr>
18568</tbody></table>
18569
18570</section>
18571
18572
18573</section><h2 id='divicon'>DivIcon</h2><p>Represents a lightweight icon for markers that uses a simple <code>&lt;div&gt;</code>
18574element instead of an image. Inherits from <a href="#icon"><code>Icon</code></a> but ignores the <code>iconUrl</code> and shadow options.</p>
18575
18576<section>
18577<h3 id='divicon-example'>Usage example</h3>
18578
18579<section >
18580
18581
18582
18583
18584
18585<pre><code class="lang-js">var myIcon = L.divIcon({className: &#39;my-div-icon&#39;});
18586// you can set .my-div-icon styles in CSS
18587L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
18588</code></pre>
18589<p>By default, it has a &#39;leaflet-div-icon&#39; CSS class and is styled as a little white square with a shadow.</p>
18590
18591
18592
18593</section>
18594
18595
18596</section><section>
18597<h3 id='divicon-factory'>Creation</h3>
18598
18599<section >
18600
18601
18602
18603
18604<table><thead>
18605 <tr>
18606 <th>Factory</th>
18607 <th>Description</th>
18608 </tr>
18609 </thead><tbody>
18610 <tr id='divicon-l-divicon'>
18611 <td><code><b>L.divIcon</b>(<nobr>&lt;<a href='#divicon-option'>DivIcon options</a>&gt;</nobr> <i>options</i>)</code></td>
18612 <td>Creates a <a href="#divicon"><code>DivIcon</code></a> instance with the given options.</td>
18613 </tr>
18614</tbody></table>
18615
18616</section>
18617
18618
18619</section><section>
18620<h3 id='divicon-option'>Options</h3>
18621
18622<section >
18623
18624
18625
18626
18627<table><thead>
18628 <tr>
18629 <th>Option</th>
18630 <th>Type</th>
18631 <th>Default</th>
18632 <th>Description</th>
18633 </tr>
18634 </thead><tbody>
18635 <tr id='divicon-html'>
18636 <td><code><b>html</b></code></td>
18637 <td><code>String|HTMLElement</code></td>
18638 <td><code>&#x27;&#x27;</code></td>
18639 <td>Custom HTML code to put inside the div element, empty by default. Alternatively,
18640an instance of <code>HTMLElement</code>.</td>
18641 </tr>
18642 <tr id='divicon-bgpos'>
18643 <td><code><b>bgPos</b></code></td>
18644 <td><code><a href='#point'>Point</a></code></td>
18645 <td><code>[0, 0]</code></td>
18646 <td>Optional relative position of the background, in pixels</td>
18647 </tr>
18648</tbody></table>
18649
18650</section>
18651
18652
18653<div class='accordion'>
18654 <label><span class='expander'></span> Options inherited from <a href='#icon'>Icon</a></label>
18655 <div class='accordion-overflow'>
18656 <div class='accordion-content'><section >
18657
18658
18659
18660
18661<table><thead>
18662 <tr>
18663 <th>Option</th>
18664 <th>Type</th>
18665 <th>Default</th>
18666 <th>Description</th>
18667 </tr>
18668 </thead><tbody>
18669 <tr id='divicon-iconurl'>
18670 <td><code><b>iconUrl</b></code></td>
18671 <td><code>String</code></td>
18672 <td><code>null</code></td>
18673 <td><strong>(required)</strong> The URL to the icon image (absolute or relative to your script path).</td>
18674 </tr>
18675 <tr id='divicon-iconretinaurl'>
18676 <td><code><b>iconRetinaUrl</b></code></td>
18677 <td><code>String</code></td>
18678 <td><code>null</code></td>
18679 <td>The URL to a retina sized version of the icon image (absolute or relative to your
18680script path). Used for Retina screen devices.</td>
18681 </tr>
18682 <tr id='divicon-iconsize'>
18683 <td><code><b>iconSize</b></code></td>
18684 <td><code><a href='#point'>Point</a></code></td>
18685 <td><code>null</code></td>
18686 <td>Size of the icon image in pixels.</td>
18687 </tr>
18688 <tr id='divicon-iconanchor'>
18689 <td><code><b>iconAnchor</b></code></td>
18690 <td><code><a href='#point'>Point</a></code></td>
18691 <td><code>null</code></td>
18692 <td>The coordinates of the &quot;tip&quot; of the icon (relative to its top left corner). The icon
18693will be aligned so that this point is at the marker&#39;s geographical location. Centered
18694by default if size is specified, also can be set in CSS with negative margins.</td>
18695 </tr>
18696 <tr id='divicon-popupanchor'>
18697 <td><code><b>popupAnchor</b></code></td>
18698 <td><code><a href='#point'>Point</a></code></td>
18699 <td><code>[0, 0]</code></td>
18700 <td>The coordinates of the point from which popups will &quot;open&quot;, relative to the icon anchor.</td>
18701 </tr>
18702 <tr id='divicon-tooltipanchor'>
18703 <td><code><b>tooltipAnchor</b></code></td>
18704 <td><code><a href='#point'>Point</a></code></td>
18705 <td><code>[0, 0]</code></td>
18706 <td>The coordinates of the point from which tooltips will &quot;open&quot;, relative to the icon anchor.</td>
18707 </tr>
18708 <tr id='divicon-shadowurl'>
18709 <td><code><b>shadowUrl</b></code></td>
18710 <td><code>String</code></td>
18711 <td><code>null</code></td>
18712 <td>The URL to the icon shadow image. If not specified, no shadow image will be created.</td>
18713 </tr>
18714 <tr id='divicon-shadowretinaurl'>
18715 <td><code><b>shadowRetinaUrl</b></code></td>
18716 <td><code>String</code></td>
18717 <td><code>null</code></td>
18718 <td></td>
18719 </tr>
18720 <tr id='divicon-shadowsize'>
18721 <td><code><b>shadowSize</b></code></td>
18722 <td><code><a href='#point'>Point</a></code></td>
18723 <td><code>null</code></td>
18724 <td>Size of the shadow image in pixels.</td>
18725 </tr>
18726 <tr id='divicon-shadowanchor'>
18727 <td><code><b>shadowAnchor</b></code></td>
18728 <td><code><a href='#point'>Point</a></code></td>
18729 <td><code>null</code></td>
18730 <td>The coordinates of the &quot;tip&quot; of the shadow (relative to its top left corner) (the same
18731as iconAnchor if not specified).</td>
18732 </tr>
18733 <tr id='divicon-classname'>
18734 <td><code><b>className</b></code></td>
18735 <td><code>String</code></td>
18736 <td><code>&#x27;&#x27;</code></td>
18737 <td>A custom class name to assign to both icon and shadow images. Empty by default.</td>
18738 </tr>
18739</tbody></table>
18740
18741</section></div>
18742 </div>
18743</div>
18744
18745</section><section>
18746<h3 id=''>Methods</h3>
18747
18748
18749
18750
18751<div class='accordion'>
18752 <label><span class='expander'></span> Methods inherited from <a href='#icon'>Icon</a></label>
18753 <div class='accordion-overflow'>
18754 <div class='accordion-content'><section >
18755
18756
18757
18758
18759<table><thead>
18760 <tr>
18761 <th>Method</th>
18762 <th>Returns</th>
18763 <th>Description</th>
18764 </tr>
18765 </thead><tbody>
18766 <tr id='divicon-createicon'>
18767 <td><code><b>createIcon</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>oldIcon?</i>)</code></td>
18768 <td><code>HTMLElement</code></td>
18769 <td><p>Called internally when the icon has to be shown, returns a <code>&lt;img&gt;</code> HTML element
18770styled according to the options.</p>
18771</td>
18772 </tr>
18773 <tr id='divicon-createshadow'>
18774 <td><code><b>createShadow</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>oldIcon?</i>)</code></td>
18775 <td><code>HTMLElement</code></td>
18776 <td><p>As <code>createIcon</code>, but for the shadow beneath it.</p>
18777</td>
18778 </tr>
18779</tbody></table>
18780
18781</section></div>
18782 </div>
18783</div>
18784
18785</section><h2 id='control-zoom'>Control.Zoom</h2><p>A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its <a href="#map-zoomcontrol"><code>zoomControl</code> option</a> to <code>false</code>. Extends <a href="#control"><code>Control</code></a>.</p>
18786
18787<section>
18788<h3 id='control-zoom-factory'>Creation</h3>
18789
18790<section >
18791
18792
18793
18794
18795<table><thead>
18796 <tr>
18797 <th>Factory</th>
18798 <th>Description</th>
18799 </tr>
18800 </thead><tbody>
18801 <tr id='control-zoom-l-control-zoom'>
18802 <td><code><b>L.control.zoom</b>(<nobr>&lt;<a href='#control-zoom-option'>Control.Zoom options</a>&gt;</nobr> <i>options</i>)</code></td>
18803 <td>Creates a zoom control</td>
18804 </tr>
18805</tbody></table>
18806
18807</section>
18808
18809
18810</section><section>
18811<h3 id='control-zoom-option'>Options</h3>
18812
18813<section >
18814
18815
18816
18817
18818<table><thead>
18819 <tr>
18820 <th>Option</th>
18821 <th>Type</th>
18822 <th>Default</th>
18823 <th>Description</th>
18824 </tr>
18825 </thead><tbody>
18826 <tr id='control-zoom-zoomintext'>
18827 <td><code><b>zoomInText</b></code></td>
18828 <td><code>String</code></td>
18829 <td><code>&#x27;+&#x27;</code></td>
18830 <td>The text set on the &#39;zoom in&#39; button.</td>
18831 </tr>
18832 <tr id='control-zoom-zoomintitle'>
18833 <td><code><b>zoomInTitle</b></code></td>
18834 <td><code>String</code></td>
18835 <td><code>&#x27;Zoom in&#x27;</code></td>
18836 <td>The title set on the &#39;zoom in&#39; button.</td>
18837 </tr>
18838 <tr id='control-zoom-zoomouttext'>
18839 <td><code><b>zoomOutText</b></code></td>
18840 <td><code>String</code></td>
18841 <td><code>&#x27;&amp;#x2212</code></td>
18842 <td>&#39;
18843The text set on the &#39;zoom out&#39; button.</td>
18844 </tr>
18845 <tr id='control-zoom-zoomouttitle'>
18846 <td><code><b>zoomOutTitle</b></code></td>
18847 <td><code>String</code></td>
18848 <td><code>&#x27;Zoom out&#x27;</code></td>
18849 <td>The title set on the &#39;zoom out&#39; button.</td>
18850 </tr>
18851</tbody></table>
18852
18853</section>
18854
18855
18856<div class='accordion'>
18857 <label><span class='expander'></span> Options inherited from <a href='#control'>Control</a></label>
18858 <div class='accordion-overflow'>
18859 <div class='accordion-content'><section >
18860
18861
18862
18863
18864<table><thead>
18865 <tr>
18866 <th>Option</th>
18867 <th>Type</th>
18868 <th>Default</th>
18869 <th>Description</th>
18870 </tr>
18871 </thead><tbody>
18872 <tr id='control-zoom-position'>
18873 <td><code><b>position</b></code></td>
18874 <td><code>String</code></td>
18875 <td><code>&#x27;topright&#x27;</code></td>
18876 <td>The position of the control (one of the map corners). Possible values are <code>&#39;topleft&#39;</code>,
18877<code>&#39;topright&#39;</code>, <code>&#39;bottomleft&#39;</code> or <code>&#39;bottomright&#39;</code></td>
18878 </tr>
18879</tbody></table>
18880
18881</section></div>
18882 </div>
18883</div>
18884
18885</section><section>
18886<h3 id=''>Methods</h3>
18887
18888
18889
18890
18891<div class='accordion'>
18892 <label><span class='expander'></span> Methods inherited from <a href='#control'>Control</a></label>
18893 <div class='accordion-overflow'>
18894 <div class='accordion-content'><section >
18895
18896
18897
18898
18899<table><thead>
18900 <tr>
18901 <th>Method</th>
18902 <th>Returns</th>
18903 <th>Description</th>
18904 </tr>
18905 </thead><tbody>
18906 <tr id='control-zoom-getposition'>
18907 <td><code><b>getPosition</b>()</code></td>
18908 <td><code>string</code></td>
18909 <td><p>Returns the position of the control.</p>
18910</td>
18911 </tr>
18912 <tr id='control-zoom-setposition'>
18913 <td><code><b>setPosition</b>(<nobr>&lt;string&gt;</nobr> <i>position</i>)</code></td>
18914 <td><code>this</code></td>
18915 <td><p>Sets the position of the control.</p>
18916</td>
18917 </tr>
18918 <tr id='control-zoom-getcontainer'>
18919 <td><code><b>getContainer</b>()</code></td>
18920 <td><code>HTMLElement</code></td>
18921 <td><p>Returns the HTMLElement that contains the control.</p>
18922</td>
18923 </tr>
18924 <tr id='control-zoom-addto'>
18925 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
18926 <td><code>this</code></td>
18927 <td><p>Adds the control to the given map.</p>
18928</td>
18929 </tr>
18930 <tr id='control-zoom-remove'>
18931 <td><code><b>remove</b>()</code></td>
18932 <td><code>this</code></td>
18933 <td><p>Removes the control from the map it is currently active on.</p>
18934</td>
18935 </tr>
18936</tbody></table>
18937
18938</section></div>
18939 </div>
18940</div>
18941
18942</section><h2 id='control-attribution'>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 <a href="#map-attributioncontrol"><code>attributionControl</code> option</a> to <code>false</code>, and it fetches attribution texts from layers with the <a href="#layer-getattribution"><code>getAttribution</code> method</a> automatically. Extends Control.</p>
18943
18944<section>
18945<h3 id='control-attribution-factory'>Creation</h3>
18946
18947<section >
18948
18949
18950
18951
18952<table><thead>
18953 <tr>
18954 <th>Factory</th>
18955 <th>Description</th>
18956 </tr>
18957 </thead><tbody>
18958 <tr id='control-attribution-l-control-attribution'>
18959 <td><code><b>L.control.attribution</b>(<nobr>&lt;<a href='#control-attribution-option'>Control.Attribution options</a>&gt;</nobr> <i>options</i>)</code></td>
18960 <td>Creates an attribution control.</td>
18961 </tr>
18962</tbody></table>
18963
18964</section>
18965
18966
18967</section><section>
18968<h3 id='control-attribution-option'>Options</h3>
18969
18970<section >
18971
18972
18973
18974
18975<table><thead>
18976 <tr>
18977 <th>Option</th>
18978 <th>Type</th>
18979 <th>Default</th>
18980 <th>Description</th>
18981 </tr>
18982 </thead><tbody>
18983 <tr id='control-attribution-prefix'>
18984 <td><code><b>prefix</b></code></td>
18985 <td><code>String</code></td>
18986 <td><code>&#x27;Leaflet&#x27;</code></td>
18987 <td>The HTML text shown before the attributions. Pass <code>false</code> to disable.</td>
18988 </tr>
18989</tbody></table>
18990
18991</section>
18992
18993
18994<div class='accordion'>
18995 <label><span class='expander'></span> Options inherited from <a href='#control'>Control</a></label>
18996 <div class='accordion-overflow'>
18997 <div class='accordion-content'><section >
18998
18999
19000
19001
19002<table><thead>
19003 <tr>
19004 <th>Option</th>
19005 <th>Type</th>
19006 <th>Default</th>
19007 <th>Description</th>
19008 </tr>
19009 </thead><tbody>
19010 <tr id='control-attribution-position'>
19011 <td><code><b>position</b></code></td>
19012 <td><code>String</code></td>
19013 <td><code>&#x27;topright&#x27;</code></td>
19014 <td>The position of the control (one of the map corners). Possible values are <code>&#39;topleft&#39;</code>,
19015<code>&#39;topright&#39;</code>, <code>&#39;bottomleft&#39;</code> or <code>&#39;bottomright&#39;</code></td>
19016 </tr>
19017</tbody></table>
19018
19019</section></div>
19020 </div>
19021</div>
19022
19023</section><section>
19024<h3 id='control-attribution-method'>Methods</h3>
19025
19026<section >
19027
19028
19029
19030
19031<table><thead>
19032 <tr>
19033 <th>Method</th>
19034 <th>Returns</th>
19035 <th>Description</th>
19036 </tr>
19037 </thead><tbody>
19038 <tr id='control-attribution-setprefix'>
19039 <td><code><b>setPrefix</b>(<nobr>&lt;String&gt;</nobr> <i>prefix</i>)</code></td>
19040 <td><code>this</code></td>
19041 <td><p>Sets the text before the attributions.</p>
19042</td>
19043 </tr>
19044 <tr id='control-attribution-addattribution'>
19045 <td><code><b>addAttribution</b>(<nobr>&lt;String&gt;</nobr> <i>text</i>)</code></td>
19046 <td><code>this</code></td>
19047 <td><p>Adds an attribution text (e.g. <code>&#39;Vector data &amp;copy; Mapbox&#39;</code>).</p>
19048</td>
19049 </tr>
19050 <tr id='control-attribution-removeattribution'>
19051 <td><code><b>removeAttribution</b>(<nobr>&lt;String&gt;</nobr> <i>text</i>)</code></td>
19052 <td><code>this</code></td>
19053 <td><p>Removes an attribution text.</p>
19054</td>
19055 </tr>
19056</tbody></table>
19057
19058</section>
19059
19060
19061<div class='accordion'>
19062 <label><span class='expander'></span> Methods inherited from <a href='#control'>Control</a></label>
19063 <div class='accordion-overflow'>
19064 <div class='accordion-content'><section >
19065
19066
19067
19068
19069<table><thead>
19070 <tr>
19071 <th>Method</th>
19072 <th>Returns</th>
19073 <th>Description</th>
19074 </tr>
19075 </thead><tbody>
19076 <tr id='control-attribution-getposition'>
19077 <td><code><b>getPosition</b>()</code></td>
19078 <td><code>string</code></td>
19079 <td><p>Returns the position of the control.</p>
19080</td>
19081 </tr>
19082 <tr id='control-attribution-setposition'>
19083 <td><code><b>setPosition</b>(<nobr>&lt;string&gt;</nobr> <i>position</i>)</code></td>
19084 <td><code>this</code></td>
19085 <td><p>Sets the position of the control.</p>
19086</td>
19087 </tr>
19088 <tr id='control-attribution-getcontainer'>
19089 <td><code><b>getContainer</b>()</code></td>
19090 <td><code>HTMLElement</code></td>
19091 <td><p>Returns the HTMLElement that contains the control.</p>
19092</td>
19093 </tr>
19094 <tr id='control-attribution-addto'>
19095 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
19096 <td><code>this</code></td>
19097 <td><p>Adds the control to the given map.</p>
19098</td>
19099 </tr>
19100 <tr id='control-attribution-remove'>
19101 <td><code><b>remove</b>()</code></td>
19102 <td><code>this</code></td>
19103 <td><p>Removes the control from the map it is currently active on.</p>
19104</td>
19105 </tr>
19106</tbody></table>
19107
19108</section></div>
19109 </div>
19110</div>
19111
19112</section><h2 id='control-layers'>Control.Layers</h2><p>The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the <a href="http://leafletjs.com/examples/layers-control/">detailed example</a>). Extends <a href="#control"><code>Control</code></a>.</p>
19113
19114<section>
19115<h3 id='control-layers-example'>Usage example</h3>
19116
19117<section >
19118
19119
19120
19121
19122
19123<pre><code class="lang-js">var baseLayers = {
19124 &quot;Mapbox&quot;: mapbox,
19125 &quot;OpenStreetMap&quot;: osm
19126};
19127var overlays = {
19128 &quot;Marker&quot;: marker,
19129 &quot;Roads&quot;: roadsLayer
19130};
19131L.control.layers(baseLayers, overlays).addTo(map);
19132</code></pre>
19133<p>The <code>baseLayers</code> and <code>overlays</code> parameters are object literals with layer names as keys and <a href="#layer"><code>Layer</code></a> objects as values:</p>
19134<pre><code class="lang-js">{
19135 &quot;&lt;someName1&gt;&quot;: layer1,
19136 &quot;&lt;someName2&gt;&quot;: layer2
19137}
19138</code></pre>
19139<p>The layer names can contain HTML, which allows you to add additional styling to the items:</p>
19140<pre><code class="lang-js">{&quot;&lt;img src=&#39;my-layer-icon&#39; /&gt; &lt;span class=&#39;my-layer-item&#39;&gt;My Layer&lt;/span&gt;&quot;: myLayer}
19141</code></pre>
19142
19143
19144
19145</section>
19146
19147
19148</section><section>
19149<h3 id='control-layers-factory'>Creation</h3>
19150
19151<section >
19152
19153
19154
19155
19156<table><thead>
19157 <tr>
19158 <th>Factory</th>
19159 <th>Description</th>
19160 </tr>
19161 </thead><tbody>
19162 <tr id='control-layers-l-control-layers'>
19163 <td><code><b>L.control.layers</b>(<nobr>&lt;Object&gt;</nobr> <i>baselayers?</i>, <nobr>&lt;Object&gt;</nobr> <i>overlays?</i>, <nobr>&lt;<a href='#control-layers-option'>Control.Layers options</a>&gt;</nobr> <i>options?</i>)</code></td>
19164 <td>Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.</td>
19165 </tr>
19166</tbody></table>
19167
19168</section>
19169
19170
19171</section><section>
19172<h3 id='control-layers-option'>Options</h3>
19173
19174<section >
19175
19176
19177
19178
19179<table><thead>
19180 <tr>
19181 <th>Option</th>
19182 <th>Type</th>
19183 <th>Default</th>
19184 <th>Description</th>
19185 </tr>
19186 </thead><tbody>
19187 <tr id='control-layers-collapsed'>
19188 <td><code><b>collapsed</b></code></td>
19189 <td><code>Boolean</code></td>
19190 <td><code>true</code></td>
19191 <td>If <code>true</code>, the control will be collapsed into an icon and expanded on mouse hover or touch.</td>
19192 </tr>
19193 <tr id='control-layers-autozindex'>
19194 <td><code><b>autoZIndex</b></code></td>
19195 <td><code>Boolean</code></td>
19196 <td><code>true</code></td>
19197 <td>If <code>true</code>, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.</td>
19198 </tr>
19199 <tr id='control-layers-hidesinglebase'>
19200 <td><code><b>hideSingleBase</b></code></td>
19201 <td><code>Boolean</code></td>
19202 <td><code>false</code></td>
19203 <td>If <code>true</code>, the base layers in the control will be hidden when there is only one.</td>
19204 </tr>
19205 <tr id='control-layers-sortlayers'>
19206 <td><code><b>sortLayers</b></code></td>
19207 <td><code>Boolean</code></td>
19208 <td><code>false</code></td>
19209 <td>Whether to sort the layers. When <code>false</code>, layers will keep the order
19210in which they were added to the control.</td>
19211 </tr>
19212 <tr id='control-layers-sortfunction'>
19213 <td><code><b>sortFunction</b></code></td>
19214 <td><code>Function</code></td>
19215 <td><code>*</code></td>
19216 <td>A <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort">compare function</a>
19217that will be used for sorting the layers, when <code>sortLayers</code> is <code>true</code>.
19218The function receives both the <a href="#layer"><code>L.Layer</code></a> instances and their names, as in
19219<code>sortFunction(layerA, layerB, nameA, nameB)</code>.
19220By default, it sorts layers alphabetically by their name.</td>
19221 </tr>
19222</tbody></table>
19223
19224</section>
19225
19226
19227<div class='accordion'>
19228 <label><span class='expander'></span> Options inherited from <a href='#control'>Control</a></label>
19229 <div class='accordion-overflow'>
19230 <div class='accordion-content'><section >
19231
19232
19233
19234
19235<table><thead>
19236 <tr>
19237 <th>Option</th>
19238 <th>Type</th>
19239 <th>Default</th>
19240 <th>Description</th>
19241 </tr>
19242 </thead><tbody>
19243 <tr id='control-layers-position'>
19244 <td><code><b>position</b></code></td>
19245 <td><code>String</code></td>
19246 <td><code>&#x27;topright&#x27;</code></td>
19247 <td>The position of the control (one of the map corners). Possible values are <code>&#39;topleft&#39;</code>,
19248<code>&#39;topright&#39;</code>, <code>&#39;bottomleft&#39;</code> or <code>&#39;bottomright&#39;</code></td>
19249 </tr>
19250</tbody></table>
19251
19252</section></div>
19253 </div>
19254</div>
19255
19256</section><section>
19257<h3 id='control-layers-method'>Methods</h3>
19258
19259<section >
19260
19261
19262
19263
19264<table><thead>
19265 <tr>
19266 <th>Method</th>
19267 <th>Returns</th>
19268 <th>Description</th>
19269 </tr>
19270 </thead><tbody>
19271 <tr id='control-layers-addbaselayer'>
19272 <td><code><b>addBaseLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
19273 <td><code>this</code></td>
19274 <td><p>Adds a base layer (radio button entry) with the given name to the control.</p>
19275</td>
19276 </tr>
19277 <tr id='control-layers-addoverlay'>
19278 <td><code><b>addOverlay</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
19279 <td><code>this</code></td>
19280 <td><p>Adds an overlay (checkbox entry) with the given name to the control.</p>
19281</td>
19282 </tr>
19283 <tr id='control-layers-removelayer'>
19284 <td><code><b>removeLayer</b>(<nobr>&lt;<a href='#layer'>Layer</a>&gt;</nobr> <i>layer</i>)</code></td>
19285 <td><code>this</code></td>
19286 <td><p>Remove the given layer from the control.</p>
19287</td>
19288 </tr>
19289 <tr id='control-layers-expand'>
19290 <td><code><b>expand</b>()</code></td>
19291 <td><code>this</code></td>
19292 <td><p>Expand the control container if collapsed.</p>
19293</td>
19294 </tr>
19295 <tr id='control-layers-collapse'>
19296 <td><code><b>collapse</b>()</code></td>
19297 <td><code>this</code></td>
19298 <td><p>Collapse the control container if expanded.</p>
19299</td>
19300 </tr>
19301</tbody></table>
19302
19303</section>
19304
19305
19306<div class='accordion'>
19307 <label><span class='expander'></span> Methods inherited from <a href='#control'>Control</a></label>
19308 <div class='accordion-overflow'>
19309 <div class='accordion-content'><section >
19310
19311
19312
19313
19314<table><thead>
19315 <tr>
19316 <th>Method</th>
19317 <th>Returns</th>
19318 <th>Description</th>
19319 </tr>
19320 </thead><tbody>
19321 <tr id='control-layers-getposition'>
19322 <td><code><b>getPosition</b>()</code></td>
19323 <td><code>string</code></td>
19324 <td><p>Returns the position of the control.</p>
19325</td>
19326 </tr>
19327 <tr id='control-layers-setposition'>
19328 <td><code><b>setPosition</b>(<nobr>&lt;string&gt;</nobr> <i>position</i>)</code></td>
19329 <td><code>this</code></td>
19330 <td><p>Sets the position of the control.</p>
19331</td>
19332 </tr>
19333 <tr id='control-layers-getcontainer'>
19334 <td><code><b>getContainer</b>()</code></td>
19335 <td><code>HTMLElement</code></td>
19336 <td><p>Returns the HTMLElement that contains the control.</p>
19337</td>
19338 </tr>
19339 <tr id='control-layers-addto'>
19340 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
19341 <td><code>this</code></td>
19342 <td><p>Adds the control to the given map.</p>
19343</td>
19344 </tr>
19345 <tr id='control-layers-remove'>
19346 <td><code><b>remove</b>()</code></td>
19347 <td><code>this</code></td>
19348 <td><p>Removes the control from the map it is currently active on.</p>
19349</td>
19350 </tr>
19351</tbody></table>
19352
19353</section></div>
19354 </div>
19355</div>
19356
19357</section><h2 id='control-scale'>Control.Scale</h2><p>A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends <a href="#control"><code>Control</code></a>.</p>
19358
19359<section>
19360<h3 id='control-scale-example'>Usage example</h3>
19361
19362<section >
19363
19364
19365
19366
19367
19368<pre><code class="lang-js">L.control.scale().addTo(map);
19369</code></pre>
19370
19371
19372
19373</section>
19374
19375
19376</section><section>
19377<h3 id='control-scale-factory'>Creation</h3>
19378
19379<section >
19380
19381
19382
19383
19384<table><thead>
19385 <tr>
19386 <th>Factory</th>
19387 <th>Description</th>
19388 </tr>
19389 </thead><tbody>
19390 <tr id='control-scale-l-control-scale'>
19391 <td><code><b>L.control.scale</b>(<nobr>&lt;<a href='#control-scale-option'>Control.Scale options</a>&gt;</nobr> <i>options?</i>)</code></td>
19392 <td>Creates an scale control with the given options.</td>
19393 </tr>
19394</tbody></table>
19395
19396</section>
19397
19398
19399</section><section>
19400<h3 id='control-scale-option'>Options</h3>
19401
19402<section >
19403
19404
19405
19406
19407<table><thead>
19408 <tr>
19409 <th>Option</th>
19410 <th>Type</th>
19411 <th>Default</th>
19412 <th>Description</th>
19413 </tr>
19414 </thead><tbody>
19415 <tr id='control-scale-maxwidth'>
19416 <td><code><b>maxWidth</b></code></td>
19417 <td><code>Number</code></td>
19418 <td><code>100</code></td>
19419 <td>Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).</td>
19420 </tr>
19421 <tr id='control-scale-metric'>
19422 <td><code><b>metric</b></code></td>
19423 <td><code>Boolean</code></td>
19424 <td><code>True</code></td>
19425 <td>Whether to show the metric scale line (m/km).</td>
19426 </tr>
19427 <tr id='control-scale-imperial'>
19428 <td><code><b>imperial</b></code></td>
19429 <td><code>Boolean</code></td>
19430 <td><code>True</code></td>
19431 <td>Whether to show the imperial scale line (mi/ft).</td>
19432 </tr>
19433 <tr id='control-scale-updatewhenidle'>
19434 <td><code><b>updateWhenIdle</b></code></td>
19435 <td><code>Boolean</code></td>
19436 <td><code>false</code></td>
19437 <td>If <code>true</code>, the control is updated on <a href="#map-moveend"><code>moveend</code></a>, otherwise it&#39;s always up-to-date (updated on <a href="#map-move"><code>move</code></a>).</td>
19438 </tr>
19439</tbody></table>
19440
19441</section>
19442
19443
19444<div class='accordion'>
19445 <label><span class='expander'></span> Options inherited from <a href='#control'>Control</a></label>
19446 <div class='accordion-overflow'>
19447 <div class='accordion-content'><section >
19448
19449
19450
19451
19452<table><thead>
19453 <tr>
19454 <th>Option</th>
19455 <th>Type</th>
19456 <th>Default</th>
19457 <th>Description</th>
19458 </tr>
19459 </thead><tbody>
19460 <tr id='control-scale-position'>
19461 <td><code><b>position</b></code></td>
19462 <td><code>String</code></td>
19463 <td><code>&#x27;topright&#x27;</code></td>
19464 <td>The position of the control (one of the map corners). Possible values are <code>&#39;topleft&#39;</code>,
19465<code>&#39;topright&#39;</code>, <code>&#39;bottomleft&#39;</code> or <code>&#39;bottomright&#39;</code></td>
19466 </tr>
19467</tbody></table>
19468
19469</section></div>
19470 </div>
19471</div>
19472
19473</section><section>
19474<h3 id=''>Methods</h3>
19475
19476
19477
19478
19479<div class='accordion'>
19480 <label><span class='expander'></span> Methods inherited from <a href='#control'>Control</a></label>
19481 <div class='accordion-overflow'>
19482 <div class='accordion-content'><section >
19483
19484
19485
19486
19487<table><thead>
19488 <tr>
19489 <th>Method</th>
19490 <th>Returns</th>
19491 <th>Description</th>
19492 </tr>
19493 </thead><tbody>
19494 <tr id='control-scale-getposition'>
19495 <td><code><b>getPosition</b>()</code></td>
19496 <td><code>string</code></td>
19497 <td><p>Returns the position of the control.</p>
19498</td>
19499 </tr>
19500 <tr id='control-scale-setposition'>
19501 <td><code><b>setPosition</b>(<nobr>&lt;string&gt;</nobr> <i>position</i>)</code></td>
19502 <td><code>this</code></td>
19503 <td><p>Sets the position of the control.</p>
19504</td>
19505 </tr>
19506 <tr id='control-scale-getcontainer'>
19507 <td><code><b>getContainer</b>()</code></td>
19508 <td><code>HTMLElement</code></td>
19509 <td><p>Returns the HTMLElement that contains the control.</p>
19510</td>
19511 </tr>
19512 <tr id='control-scale-addto'>
19513 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
19514 <td><code>this</code></td>
19515 <td><p>Adds the control to the given map.</p>
19516</td>
19517 </tr>
19518 <tr id='control-scale-remove'>
19519 <td><code><b>remove</b>()</code></td>
19520 <td><code>this</code></td>
19521 <td><p>Removes the control from the map it is currently active on.</p>
19522</td>
19523 </tr>
19524</tbody></table>
19525
19526</section></div>
19527 </div>
19528</div>
19529
19530</section><h2 id='browser'>Browser</h2><p>A namespace with static properties for browser/feature detection used by Leaflet internally.</p>
19531
19532<section>
19533<h3 id='browser-example'>Usage example</h3>
19534
19535<section >
19536
19537
19538
19539
19540
19541<pre><code class="lang-js">if (L.Browser.ielt9) {
19542 alert(&#39;Upgrade your browser, dude!&#39;);
19543}
19544</code></pre>
19545
19546
19547
19548</section>
19549
19550
19551</section><section>
19552<h3 id='browser-property'>Properties</h3>
19553
19554<section >
19555
19556
19557
19558
19559<table><thead>
19560 <tr>
19561 <th>Property</th>
19562 <th>Type</th>
19563 <th>Description</th>
19564 </tr>
19565 </thead><tbody>
19566 <tr id='browser-ie'>
19567 <td><code><b>ie</b></code></td>
19568 <td><code>Boolean</code></td>
19569 <td><code>true</code> for all Internet Explorer versions (not Edge).</td>
19570 </tr>
19571 <tr id='browser-ielt9'>
19572 <td><code><b>ielt9</b></code></td>
19573 <td><code>Boolean</code></td>
19574 <td><code>true</code> for Internet Explorer versions less than 9.</td>
19575 </tr>
19576 <tr id='browser-edge'>
19577 <td><code><b>edge</b></code></td>
19578 <td><code>Boolean</code></td>
19579 <td><code>true</code> for the Edge web browser.</td>
19580 </tr>
19581 <tr id='browser-webkit'>
19582 <td><code><b>webkit</b></code></td>
19583 <td><code>Boolean</code></td>
19584 <td><code>true</code> for webkit-based browsers like Chrome and Safari (including mobile versions).</td>
19585 </tr>
19586 <tr id='browser-android'>
19587 <td><code><b>android</b></code></td>
19588 <td><code>Boolean</code></td>
19589 <td><code>true</code> for any browser running on an Android platform.</td>
19590 </tr>
19591 <tr id='browser-android23'>
19592 <td><code><b>android23</b></code></td>
19593 <td><code>Boolean</code></td>
19594 <td><code>true</code> for browsers running on Android 2 or Android 3.</td>
19595 </tr>
19596 <tr id='browser-androidstock'>
19597 <td><code><b>androidStock</b></code></td>
19598 <td><code>Boolean</code></td>
19599 <td><code>true</code> for the Android stock browser (i.e. not Chrome)</td>
19600 </tr>
19601 <tr id='browser-opera'>
19602 <td><code><b>opera</b></code></td>
19603 <td><code>Boolean</code></td>
19604 <td><code>true</code> for the Opera browser</td>
19605 </tr>
19606 <tr id='browser-chrome'>
19607 <td><code><b>chrome</b></code></td>
19608 <td><code>Boolean</code></td>
19609 <td><code>true</code> for the Chrome browser.</td>
19610 </tr>
19611 <tr id='browser-gecko'>
19612 <td><code><b>gecko</b></code></td>
19613 <td><code>Boolean</code></td>
19614 <td><code>true</code> for gecko-based browsers like Firefox.</td>
19615 </tr>
19616 <tr id='browser-safari'>
19617 <td><code><b>safari</b></code></td>
19618 <td><code>Boolean</code></td>
19619 <td><code>true</code> for the Safari browser.</td>
19620 </tr>
19621 <tr id='browser-opera12'>
19622 <td><code><b>opera12</b></code></td>
19623 <td><code>Boolean</code></td>
19624 <td><code>true</code> for the Opera browser supporting CSS transforms (version 12 or later).</td>
19625 </tr>
19626 <tr id='browser-win'>
19627 <td><code><b>win</b></code></td>
19628 <td><code>Boolean</code></td>
19629 <td><code>true</code> when the browser is running in a Windows platform</td>
19630 </tr>
19631 <tr id='browser-ie3d'>
19632 <td><code><b>ie3d</b></code></td>
19633 <td><code>Boolean</code></td>
19634 <td><code>true</code> for all Internet Explorer versions supporting CSS transforms.</td>
19635 </tr>
19636 <tr id='browser-webkit3d'>
19637 <td><code><b>webkit3d</b></code></td>
19638 <td><code>Boolean</code></td>
19639 <td><code>true</code> for webkit-based browsers supporting CSS transforms.</td>
19640 </tr>
19641 <tr id='browser-gecko3d'>
19642 <td><code><b>gecko3d</b></code></td>
19643 <td><code>Boolean</code></td>
19644 <td><code>true</code> for gecko-based browsers supporting CSS transforms.</td>
19645 </tr>
19646 <tr id='browser-any3d'>
19647 <td><code><b>any3d</b></code></td>
19648 <td><code>Boolean</code></td>
19649 <td><code>true</code> for all browsers supporting CSS transforms.</td>
19650 </tr>
19651 <tr id='browser-mobile'>
19652 <td><code><b>mobile</b></code></td>
19653 <td><code>Boolean</code></td>
19654 <td><code>true</code> for all browsers running in a mobile device.</td>
19655 </tr>
19656 <tr id='browser-mobilewebkit'>
19657 <td><code><b>mobileWebkit</b></code></td>
19658 <td><code>Boolean</code></td>
19659 <td><code>true</code> for all webkit-based browsers in a mobile device.</td>
19660 </tr>
19661 <tr id='browser-mobilewebkit3d'>
19662 <td><code><b>mobileWebkit3d</b></code></td>
19663 <td><code>Boolean</code></td>
19664 <td><code>true</code> for all webkit-based browsers in a mobile device supporting CSS transforms.</td>
19665 </tr>
19666 <tr id='browser-mspointer'>
19667 <td><code><b>msPointer</b></code></td>
19668 <td><code>Boolean</code></td>
19669 <td><code>true</code> for browsers implementing the Microsoft touch events model (notably IE10).</td>
19670 </tr>
19671 <tr id='browser-pointer'>
19672 <td><code><b>pointer</b></code></td>
19673 <td><code>Boolean</code></td>
19674 <td><code>true</code> for all browsers supporting <a href="https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx">pointer events</a>.</td>
19675 </tr>
19676 <tr id='browser-touch'>
19677 <td><code><b>touch</b></code></td>
19678 <td><code>Boolean</code></td>
19679 <td><code>true</code> for all browsers supporting <a href="https://developer.mozilla.org/docs/Web/API/Touch_events">touch events</a>.
19680This does not necessarily mean that the browser is running in a computer with
19681a touchscreen, it only means that the browser is capable of understanding
19682touch events.</td>
19683 </tr>
19684 <tr id='browser-mobileopera'>
19685 <td><code><b>mobileOpera</b></code></td>
19686 <td><code>Boolean</code></td>
19687 <td><code>true</code> for the Opera browser in a mobile device.</td>
19688 </tr>
19689 <tr id='browser-mobilegecko'>
19690 <td><code><b>mobileGecko</b></code></td>
19691 <td><code>Boolean</code></td>
19692 <td><code>true</code> for gecko-based browsers running in a mobile device.</td>
19693 </tr>
19694 <tr id='browser-retina'>
19695 <td><code><b>retina</b></code></td>
19696 <td><code>Boolean</code></td>
19697 <td><code>true</code> for browsers on a high-resolution &quot;retina&quot; screen or on any screen when browser&#39;s display zoom is more than 100%.</td>
19698 </tr>
19699 <tr id='browser-passiveevents'>
19700 <td><code><b>passiveEvents</b></code></td>
19701 <td><code>Boolean</code></td>
19702 <td><code>true</code> for browsers that support passive events.</td>
19703 </tr>
19704 <tr id='browser-canvas'>
19705 <td><code><b>canvas</b></code></td>
19706 <td><code>Boolean</code></td>
19707 <td><code>true</code> when the browser supports <a href="https://developer.mozilla.org/docs/Web/API/Canvas_API"><code>&lt;canvas&gt;</code></a>.</td>
19708 </tr>
19709 <tr id='browser-svg'>
19710 <td><code><b>svg</b></code></td>
19711 <td><code>Boolean</code></td>
19712 <td><code>true</code> when the browser supports <a href="https://developer.mozilla.org/docs/Web/SVG">SVG</a>.</td>
19713 </tr>
19714 <tr id='browser-vml'>
19715 <td><code><b>vml</b></code></td>
19716 <td><code>Boolean</code></td>
19717 <td><code>true</code> if the browser supports <a href="https://en.wikipedia.org/wiki/Vector_Markup_Language">VML</a>.</td>
19718 </tr>
19719</tbody></table>
19720
19721</section>
19722
19723
19724</section><h2 id='util'>Util</h2><p>Various utility functions, used by Leaflet internally.</p>
19725
19726<section>
19727<h3 id='util-function'>Functions</h3>
19728
19729<section >
19730
19731
19732
19733
19734<table><thead>
19735 <tr>
19736 <th>Function</th>
19737 <th>Returns</th>
19738 <th>Description</th>
19739 </tr>
19740 </thead><tbody>
19741 <tr id='util-extend'>
19742 <td><code><b>extend</b>(<nobr>&lt;Object&gt;</nobr> <i>dest</i>, <nobr>&lt;Object&gt;</nobr> <i>src?</i>)</code></td>
19743 <td><code>Object</code></td>
19744 <td>Merges the properties of the <code>src</code> object (or multiple objects) into <code>dest</code> object and returns the latter. Has an <code>L.extend</code> shortcut.</td>
19745 </tr>
19746 <tr id='util-create'>
19747 <td><code><b>create</b>(<nobr>&lt;Object&gt;</nobr> <i>proto</i>, <nobr>&lt;Object&gt;</nobr> <i>properties?</i>)</code></td>
19748 <td><code>Object</code></td>
19749 <td>Compatibility polyfill for <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create">Object.create</a></td>
19750 </tr>
19751 <tr id='util-bind'>
19752 <td><code><b>bind</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <i></i>)</code></td>
19753 <td><code>Function</code></td>
19754 <td>Returns a new function bound to the arguments passed, like <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind">Function.prototype.bind</a>.
19755Has a <code>L.bind()</code> shortcut.</td>
19756 </tr>
19757 <tr id='util-stamp'>
19758 <td><code><b>stamp</b>(<nobr>&lt;Object&gt;</nobr> <i>obj</i>)</code></td>
19759 <td><code>Number</code></td>
19760 <td>Returns the unique ID of an object, assigning it one if it doesn&#39;t have it.</td>
19761 </tr>
19762 <tr id='util-throttle'>
19763 <td><code><b>throttle</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Number&gt;</nobr> <i>time</i>, <nobr>&lt;Object&gt;</nobr> <i>context</i>)</code></td>
19764 <td><code>Function</code></td>
19765 <td>Returns a function which executes function <code>fn</code> with the given scope <code>context</code>
19766(so that the <code>this</code> keyword refers to <code>context</code> inside <code>fn</code>&#39;s code). The function
19767<code>fn</code> will be called no more than one time per given amount of <code>time</code>. The arguments
19768received by the bound function will be any arguments passed when binding the
19769function, followed by any arguments passed when invoking the bound function.
19770Has an <code>L.throttle</code> shortcut.</td>
19771 </tr>
19772 <tr id='util-wrapnum'>
19773 <td><code><b>wrapNum</b>(<nobr>&lt;Number&gt;</nobr> <i>num</i>, <nobr>&lt;Number[]&gt;</nobr> <i>range</i>, <nobr>&lt;Boolean&gt;</nobr> <i>includeMax?</i>)</code></td>
19774 <td><code>Number</code></td>
19775 <td>Returns the number <code>num</code> modulo <code>range</code> in such a way so it lies within
19776<code>range[0]</code> and <code>range[1]</code>. The returned value will be always smaller than
19777<code>range[1]</code> unless <code>includeMax</code> is set to <code>true</code>.</td>
19778 </tr>
19779 <tr id='util-falsefn'>
19780 <td><code><b>falseFn</b>()</code></td>
19781 <td><code>Function</code></td>
19782 <td>Returns a function which always returns <code>false</code>.</td>
19783 </tr>
19784 <tr id='util-formatnum'>
19785 <td><code><b>formatNum</b>(<nobr>&lt;Number&gt;</nobr> <i>num</i>, <nobr>&lt;Number&gt;</nobr> <i>digits?</i>)</code></td>
19786 <td><code>Number</code></td>
19787 <td>Returns the number <code>num</code> rounded to <code>digits</code> decimals, or to 6 decimals by default.</td>
19788 </tr>
19789 <tr id='util-trim'>
19790 <td><code><b>trim</b>(<nobr>&lt;String&gt;</nobr> <i>str</i>)</code></td>
19791 <td><code>String</code></td>
19792 <td>Compatibility polyfill for <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim">String.prototype.trim</a></td>
19793 </tr>
19794 <tr id='util-splitwords'>
19795 <td><code><b>splitWords</b>(<nobr>&lt;String&gt;</nobr> <i>str</i>)</code></td>
19796 <td><code>String[]</code></td>
19797 <td>Trims and splits the string on whitespace and returns the array of parts.</td>
19798 </tr>
19799 <tr id='util-setoptions'>
19800 <td><code><b>setOptions</b>(<nobr>&lt;Object&gt;</nobr> <i>obj</i>, <nobr>&lt;Object&gt;</nobr> <i>options</i>)</code></td>
19801 <td><code>Object</code></td>
19802 <td>Merges the given properties to the <code>options</code> of the <code>obj</code> object, returning the resulting options. See <code>Class options</code>. Has an <code>L.setOptions</code> shortcut.</td>
19803 </tr>
19804 <tr id='util-getparamstring'>
19805 <td><code><b>getParamString</b>(<nobr>&lt;Object&gt;</nobr> <i>obj</i>, <nobr>&lt;String&gt;</nobr> <i>existingUrl?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>uppercase?</i>)</code></td>
19806 <td><code>String</code></td>
19807 <td>Converts an object into a parameter URL string, e.g. <code>{a: &quot;foo&quot;, b: &quot;bar&quot;}</code>
19808translates to <code>&#39;?a=foo&amp;b=bar&#39;</code>. If <code>existingUrl</code> is set, the parameters will
19809be appended at the end. If <code>uppercase</code> is <code>true</code>, the parameter names will
19810be uppercased (e.g. <code>&#39;?A=foo&amp;B=bar&#39;</code>)</td>
19811 </tr>
19812 <tr id='util-template'>
19813 <td><code><b>template</b>(<nobr>&lt;String&gt;</nobr> <i>str</i>, <nobr>&lt;Object&gt;</nobr> <i>data</i>)</code></td>
19814 <td><code>String</code></td>
19815 <td>Simple templating facility, accepts a template string of the form <code>&#39;Hello {a}, {b}&#39;</code>
19816and a data object like <code>{a: &#39;foo&#39;, b: &#39;bar&#39;}</code>, returns evaluated string
19817<code>(&#39;Hello foo, bar&#39;)</code>. You can also specify functions instead of strings for
19818data values — they will be evaluated passing <code>data</code> as an argument.</td>
19819 </tr>
19820 <tr id='util-isarray'>
19821 <td><code><b>isArray</b>(<i>obj</i>)</code></td>
19822 <td><code>Boolean</code></td>
19823 <td>Compatibility polyfill for <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray">Array.isArray</a></td>
19824 </tr>
19825 <tr id='util-indexof'>
19826 <td><code><b>indexOf</b>(<nobr>&lt;Array&gt;</nobr> <i>array</i>, <nobr>&lt;Object&gt;</nobr> <i>el</i>)</code></td>
19827 <td><code>Number</code></td>
19828 <td>Compatibility polyfill for <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf">Array.prototype.indexOf</a></td>
19829 </tr>
19830 <tr id='util-requestanimframe'>
19831 <td><code><b>requestAnimFrame</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>immediate?</i>)</code></td>
19832 <td><code>Number</code></td>
19833 <td>Schedules <code>fn</code> to be executed when the browser repaints. <code>fn</code> is bound to
19834<code>context</code> if given. When <code>immediate</code> is set, <code>fn</code> is called immediately if
19835the browser doesn&#39;t have native support for
19836<a href="https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame"><code>window.requestAnimationFrame</code></a>,
19837otherwise it&#39;s delayed. Returns a request ID that can be used to cancel the request.</td>
19838 </tr>
19839 <tr id='util-cancelanimframe'>
19840 <td><code><b>cancelAnimFrame</b>(<nobr>&lt;Number&gt;</nobr> <i>id</i>)</code></td>
19841 <td><code>undefined</code></td>
19842 <td>Cancels a previous <code>requestAnimFrame</code>. See also <a href="https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame">window.cancelAnimationFrame</a>.</td>
19843 </tr>
19844</tbody></table>
19845
19846</section>
19847
19848
19849</section><section>
19850<h3 id='util-property'>Properties</h3>
19851
19852<section >
19853
19854
19855
19856
19857<table><thead>
19858 <tr>
19859 <th>Property</th>
19860 <th>Type</th>
19861 <th>Description</th>
19862 </tr>
19863 </thead><tbody>
19864 <tr id='util-lastid'>
19865 <td><code><b>lastId</b></code></td>
19866 <td><code>Number</code></td>
19867 <td>Last unique ID used by <a href="#util-stamp"><code>stamp()</code></a></td>
19868 </tr>
19869 <tr id='util-emptyimageurl'>
19870 <td><code><b>emptyImageUrl</b></code></td>
19871 <td><code>String</code></td>
19872 <td>Data URI string containing a base64-encoded empty GIF image.
19873Used as a hack to free memory from unused images on WebKit-powered
19874mobile devices (by setting image <code>src</code> to this string).</td>
19875 </tr>
19876</tbody></table>
19877
19878</section>
19879
19880
19881</section><h2 id='transformation'>Transformation</h2><p>Represents an affine transformation: a set of coefficients <code>a</code>, <code>b</code>, <code>c</code>, <code>d</code>
19882for transforming a point of a form <code>(x, y)</code> into <code>(a*x + b, c*y + d)</code> and doing
19883the reverse. Used by Leaflet in its projections code.</p>
19884
19885<section>
19886<h3 id='transformation-example'>Usage example</h3>
19887
19888<section >
19889
19890
19891
19892
19893
19894<pre><code class="lang-js">var transformation = L.transformation(2, 5, -1, 10),
19895 p = L.point(1, 2),
19896 p2 = transformation.transform(p), // L.point(7, 8)
19897 p3 = transformation.untransform(p2); // L.point(1, 2)
19898</code></pre>
19899
19900
19901
19902</section>
19903
19904
19905</section><section>
19906<h3 id='transformation-factory'>Creation</h3>
19907
19908<section >
19909
19910
19911
19912
19913<table><thead>
19914 <tr>
19915 <th>Factory</th>
19916 <th>Description</th>
19917 </tr>
19918 </thead><tbody>
19919 <tr id='transformation-l-transformation'>
19920 <td><code><b>L.transformation</b>(<nobr>&lt;Number&gt;</nobr> <i>a</i>, <nobr>&lt;Number&gt;</nobr> <i>b</i>, <nobr>&lt;Number&gt;</nobr> <i>c</i>, <nobr>&lt;Number&gt;</nobr> <i>d</i>)</code></td>
19921 <td>Instantiates a Transformation object with the given coefficients.</td>
19922 </tr>
19923 <tr id='transformation-l-transformation'>
19924 <td><code><b>L.transformation</b>(<nobr>&lt;Array&gt;</nobr> <i>coefficients</i>)</code></td>
19925 <td>Expects an coefficients array of the form
19926<code>[a: Number, b: Number, c: Number, d: Number]</code>.</td>
19927 </tr>
19928</tbody></table>
19929
19930</section>
19931
19932
19933</section><section>
19934<h3 id='transformation-method'>Methods</h3>
19935
19936<section >
19937
19938
19939
19940
19941<table><thead>
19942 <tr>
19943 <th>Method</th>
19944 <th>Returns</th>
19945 <th>Description</th>
19946 </tr>
19947 </thead><tbody>
19948 <tr id='transformation-transform'>
19949 <td><code><b>transform</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>, <nobr>&lt;Number&gt;</nobr> <i>scale?</i>)</code></td>
19950 <td><code><a href='#point'>Point</a></code></td>
19951 <td><p>Returns a transformed point, optionally multiplied by the given scale.
19952Only accepts actual <a href="#point"><code>L.Point</code></a> instances, not arrays.</p>
19953</td>
19954 </tr>
19955 <tr id='transformation-untransform'>
19956 <td><code><b>untransform</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>, <nobr>&lt;Number&gt;</nobr> <i>scale?</i>)</code></td>
19957 <td><code><a href='#point'>Point</a></code></td>
19958 <td><p>Returns the reverse transformation of the given point, optionally divided
19959by the given scale. Only accepts actual <a href="#point"><code>L.Point</code></a> instances, not arrays.</p>
19960</td>
19961 </tr>
19962</tbody></table>
19963
19964</section>
19965
19966
19967</section><h2 id='lineutil'>LineUtil</h2><p>Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.</p>
19968
19969<section>
19970<h3 id='lineutil-function'>Functions</h3>
19971
19972<section >
19973
19974
19975
19976
19977<table><thead>
19978 <tr>
19979 <th>Function</th>
19980 <th>Returns</th>
19981 <th>Description</th>
19982 </tr>
19983 </thead><tbody>
19984 <tr id='lineutil-simplify'>
19985 <td><code><b>simplify</b>(<nobr>&lt;Point[]&gt;</nobr> <i>points</i>, <nobr>&lt;Number&gt;</nobr> <i>tolerance</i>)</code></td>
19986 <td><code>Point[]</code></td>
19987 <td>Dramatically reduces the number of points in a polyline while retaining
19988its shape and returns a new array of simplified points, using the
19989<a href="http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm">Douglas-Peucker algorithm</a>.
19990Used for a huge performance boost when processing/displaying Leaflet polylines for
19991each zoom level and also reducing visual noise. tolerance affects the amount of
19992simplification (lesser value means higher quality but slower and with more points).
19993Also released as a separated micro-library <a href="http://mourner.github.com/simplify-js/">Simplify.js</a>.</td>
19994 </tr>
19995 <tr id='lineutil-pointtosegmentdistance'>
19996 <td><code><b>pointToSegmentDistance</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p1</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p2</i>)</code></td>
19997 <td><code>Number</code></td>
19998 <td>Returns the distance between point <code>p</code> and segment <code>p1</code> to <code>p2</code>.</td>
19999 </tr>
20000 <tr id='lineutil-closestpointonsegment'>
20001 <td><code><b>closestPointOnSegment</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p1</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>p2</i>)</code></td>
20002 <td><code>Number</code></td>
20003 <td>Returns the closest point from a point <code>p</code> on a segment <code>p1</code> to <code>p2</code>.</td>
20004 </tr>
20005 <tr id='lineutil-clipsegment'>
20006 <td><code><b>clipSegment</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>a</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>b</i>, <nobr>&lt;<a href='#bounds'>Bounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;Boolean&gt;</nobr> <i>useLastCode?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>round?</i>)</code></td>
20007 <td><code>Point[]|Boolean</code></td>
20008 <td>Clips the segment a to b by rectangular bounds with the
20009<a href="https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm">Cohen-Sutherland algorithm</a>
20010(modifying the segment points directly!). Used by Leaflet to only show polyline
20011points that are on the screen or near, increasing performance.</td>
20012 </tr>
20013 <tr id='lineutil-isflat'>
20014 <td><code><b>isFlat</b>(<nobr>&lt;LatLng[]&gt;</nobr> <i>latlngs</i>)</code></td>
20015 <td><code>Boolean</code></td>
20016 <td>Returns true if <code>latlngs</code> is a flat array, false is nested.</td>
20017 </tr>
20018</tbody></table>
20019
20020</section>
20021
20022
20023</section><h2 id='polyutil'>PolyUtil</h2><p>Various utility functions for polygon geometries.</p>
20024
20025<section>
20026<h3 id='polyutil-function'>Functions</h3>
20027
20028<section >
20029
20030
20031
20032
20033<table><thead>
20034 <tr>
20035 <th>Function</th>
20036 <th>Returns</th>
20037 <th>Description</th>
20038 </tr>
20039 </thead><tbody>
20040 <tr id='polyutil-clippolygon'>
20041 <td><code><b>clipPolygon</b>(<nobr>&lt;Point[]&gt;</nobr> <i>points</i>, <nobr>&lt;<a href='#bounds'>Bounds</a>&gt;</nobr> <i>bounds</i>, <nobr>&lt;Boolean&gt;</nobr> <i>round?</i>)</code></td>
20042 <td><code>Point[]</code></td>
20043 <td>Clips the polygon geometry defined by the given <code>points</code> by the given bounds (using the <a href="https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm">Sutherland-Hodgman algorithm</a>).
20044Used by Leaflet to only show polygon points that are on the screen or near, increasing
20045performance. Note that polygon points needs different algorithm for clipping
20046than polyline, so there&#39;s a separate method for it.</td>
20047 </tr>
20048</tbody></table>
20049
20050</section>
20051
20052
20053</section><h2 id='domevent'>DomEvent</h2><p>Utility functions to work with the <a href="https://developer.mozilla.org/docs/Web/API/Event">DOM events</a>, used by Leaflet internally.</p>
20054
20055<section>
20056<h3 id='domevent-function'>Functions</h3>
20057
20058<section >
20059
20060
20061
20062
20063<table><thead>
20064 <tr>
20065 <th>Function</th>
20066 <th>Returns</th>
20067 <th>Description</th>
20068 </tr>
20069 </thead><tbody>
20070 <tr id='domevent-on'>
20071 <td><code><b>on</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>types</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20072 <td><code>this</code></td>
20073 <td>Adds a listener function (<code>fn</code>) to a particular DOM event type of the
20074element <code>el</code>. You can optionally specify the context of the listener
20075(object the <code>this</code> keyword will point to). You can also pass several
20076space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</td>
20077 </tr>
20078 <tr id='domevent-on'>
20079 <td><code><b>on</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;Object&gt;</nobr> <i>eventMap</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20080 <td><code>this</code></td>
20081 <td>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></td>
20082 </tr>
20083 <tr id='domevent-off'>
20084 <td><code><b>off</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>types</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20085 <td><code>this</code></td>
20086 <td>Removes a previously added listener function.
20087Note that if you passed a custom context to on, you must pass the same
20088context to <code>off</code> in order to remove the listener.</td>
20089 </tr>
20090 <tr id='domevent-off'>
20091 <td><code><b>off</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;Object&gt;</nobr> <i>eventMap</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20092 <td><code>this</code></td>
20093 <td>Removes a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></td>
20094 </tr>
20095 <tr id='domevent-stoppropagation'>
20096 <td><code><b>stopPropagation</b>(<nobr>&lt;DOMEvent&gt;</nobr> <i>ev</i>)</code></td>
20097 <td><code>this</code></td>
20098 <td>Stop the given event from propagation to parent elements. Used inside the listener functions:
20099<pre><code class="lang-js">L.DomEvent.on(div, &#39;click&#39;, function (ev) {
20100 L.DomEvent.stopPropagation(ev);
20101});
20102</code></pre></td>
20103 </tr>
20104 <tr id='domevent-disablescrollpropagation'>
20105 <td><code><b>disableScrollPropagation</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20106 <td><code>this</code></td>
20107 <td>Adds <code>stopPropagation</code> to the element&#39;s <code>&#39;wheel&#39;</code> events (plus browser variants).</td>
20108 </tr>
20109 <tr id='domevent-disableclickpropagation'>
20110 <td><code><b>disableClickPropagation</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20111 <td><code>this</code></td>
20112 <td>Adds <code>stopPropagation</code> to the element&#39;s <code>&#39;click&#39;</code>, <code>&#39;doubleclick&#39;</code>,
20113<code>&#39;mousedown&#39;</code> and <code>&#39;touchstart&#39;</code> events (plus browser variants).</td>
20114 </tr>
20115 <tr id='domevent-preventdefault'>
20116 <td><code><b>preventDefault</b>(<nobr>&lt;DOMEvent&gt;</nobr> <i>ev</i>)</code></td>
20117 <td><code>this</code></td>
20118 <td>Prevents the default action of the DOM Event <code>ev</code> from happening (such as
20119following a link in the href of the a element, or doing a POST request
20120with page reload when a <code>&lt;form&gt;</code> is submitted).
20121Use it inside listener functions.</td>
20122 </tr>
20123 <tr id='domevent-stop'>
20124 <td><code><b>stop</b>(<nobr>&lt;DOMEvent&gt;</nobr> <i>ev</i>)</code></td>
20125 <td><code>this</code></td>
20126 <td>Does <code>stopPropagation</code> and <code>preventDefault</code> at the same time.</td>
20127 </tr>
20128 <tr id='domevent-getmouseposition'>
20129 <td><code><b>getMousePosition</b>(<nobr>&lt;DOMEvent&gt;</nobr> <i>ev</i>, <nobr>&lt;HTMLElement&gt;</nobr> <i>container?</i>)</code></td>
20130 <td><code><a href='#point'>Point</a></code></td>
20131 <td>Gets normalized mouse position from a DOM event relative to the
20132<code>container</code> (border excluded) or to the whole page if not specified.</td>
20133 </tr>
20134 <tr id='domevent-getwheeldelta'>
20135 <td><code><b>getWheelDelta</b>(<nobr>&lt;DOMEvent&gt;</nobr> <i>ev</i>)</code></td>
20136 <td><code>Number</code></td>
20137 <td>Gets normalized wheel delta from a wheel DOM event, in vertical
20138pixels scrolled (negative if scrolling down).
20139Events from pointing devices without precise scrolling are mapped to
20140a best guess of 60 pixels.</td>
20141 </tr>
20142 <tr id='domevent-addlistener'>
20143 <td><code><b>addListener</b>(<i></i>)</code></td>
20144 <td><code>this</code></td>
20145 <td>Alias to <a href="#domevent-on"><code>L.DomEvent.on</code></a></td>
20146 </tr>
20147 <tr id='domevent-removelistener'>
20148 <td><code><b>removeListener</b>(<i></i>)</code></td>
20149 <td><code>this</code></td>
20150 <td>Alias to <a href="#domevent-off"><code>L.DomEvent.off</code></a></td>
20151 </tr>
20152</tbody></table>
20153
20154</section>
20155
20156
20157</section><h2 id='domutil'>DomUtil</h2><p>Utility functions to work with the <a href="https://developer.mozilla.org/docs/Web/API/Document_Object_Model">DOM</a>
20158tree, used by Leaflet internally.
20159Most functions expecting or returning a <code>HTMLElement</code> also work for
20160SVG elements. The only difference is that classes refer to CSS classes
20161in HTML and SVG classes in SVG.</p>
20162
20163<section>
20164<h3 id='domutil-function'>Functions</h3>
20165
20166<section >
20167
20168
20169
20170
20171<table><thead>
20172 <tr>
20173 <th>Function</th>
20174 <th>Returns</th>
20175 <th>Description</th>
20176 </tr>
20177 </thead><tbody>
20178 <tr id='domutil-get'>
20179 <td><code><b>get</b>(<nobr>&lt;String|HTMLElement&gt;</nobr> <i>id</i>)</code></td>
20180 <td><code>HTMLElement</code></td>
20181 <td>Returns an element given its DOM id, or returns the element itself
20182if it was passed directly.</td>
20183 </tr>
20184 <tr id='domutil-getstyle'>
20185 <td><code><b>getStyle</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>styleAttrib</i>)</code></td>
20186 <td><code>String</code></td>
20187 <td>Returns the value for a certain style attribute on an element,
20188including computed values or values set through CSS.</td>
20189 </tr>
20190 <tr id='domutil-create'>
20191 <td><code><b>create</b>(<nobr>&lt;String&gt;</nobr> <i>tagName</i>, <nobr>&lt;String&gt;</nobr> <i>className?</i>, <nobr>&lt;HTMLElement&gt;</nobr> <i>container?</i>)</code></td>
20192 <td><code>HTMLElement</code></td>
20193 <td>Creates an HTML element with <code>tagName</code>, sets its class to <code>className</code>, and optionally appends it to <code>container</code> element.</td>
20194 </tr>
20195 <tr id='domutil-remove'>
20196 <td><code><b>remove</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20197 <td><code></code></td>
20198 <td>Removes <code>el</code> from its parent element</td>
20199 </tr>
20200 <tr id='domutil-empty'>
20201 <td><code><b>empty</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20202 <td><code></code></td>
20203 <td>Removes all of <code>el</code>&#39;s children elements from <code>el</code></td>
20204 </tr>
20205 <tr id='domutil-tofront'>
20206 <td><code><b>toFront</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20207 <td><code></code></td>
20208 <td>Makes <code>el</code> the last child of its parent, so it renders in front of the other children.</td>
20209 </tr>
20210 <tr id='domutil-toback'>
20211 <td><code><b>toBack</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20212 <td><code></code></td>
20213 <td>Makes <code>el</code> the first child of its parent, so it renders behind the other children.</td>
20214 </tr>
20215 <tr id='domutil-hasclass'>
20216 <td><code><b>hasClass</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
20217 <td><code>Boolean</code></td>
20218 <td>Returns <code>true</code> if the element&#39;s class attribute contains <code>name</code>.</td>
20219 </tr>
20220 <tr id='domutil-addclass'>
20221 <td><code><b>addClass</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
20222 <td><code></code></td>
20223 <td>Adds <code>name</code> to the element&#39;s class attribute.</td>
20224 </tr>
20225 <tr id='domutil-removeclass'>
20226 <td><code><b>removeClass</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
20227 <td><code></code></td>
20228 <td>Removes <code>name</code> from the element&#39;s class attribute.</td>
20229 </tr>
20230 <tr id='domutil-setclass'>
20231 <td><code><b>setClass</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
20232 <td><code></code></td>
20233 <td>Sets the element&#39;s class.</td>
20234 </tr>
20235 <tr id='domutil-getclass'>
20236 <td><code><b>getClass</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20237 <td><code>String</code></td>
20238 <td>Returns the element&#39;s class.</td>
20239 </tr>
20240 <tr id='domutil-setopacity'>
20241 <td><code><b>setOpacity</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;Number&gt;</nobr> <i>opacity</i>)</code></td>
20242 <td><code></code></td>
20243 <td>Set the opacity of an element (including old IE support).
20244<code>opacity</code> must be a number from <code>0</code> to <code>1</code>.</td>
20245 </tr>
20246 <tr id='domutil-testprop'>
20247 <td><code><b>testProp</b>(<nobr>&lt;String[]&gt;</nobr> <i>props</i>)</code></td>
20248 <td><code>String|false</code></td>
20249 <td>Goes through the array of style names and returns the first name
20250that is a valid style name for an element. If no such name is found,
20251it returns false. Useful for vendor-prefixed styles like <code>transform</code>.</td>
20252 </tr>
20253 <tr id='domutil-settransform'>
20254 <td><code><b>setTransform</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>offset</i>, <nobr>&lt;Number&gt;</nobr> <i>scale?</i>)</code></td>
20255 <td><code></code></td>
20256 <td>Resets the 3D CSS transform of <code>el</code> so it is translated by <code>offset</code> pixels
20257and optionally scaled by <code>scale</code>. Does not have an effect if the
20258browser doesn&#39;t support 3D CSS transforms.</td>
20259 </tr>
20260 <tr id='domutil-setposition'>
20261 <td><code><b>setPosition</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>position</i>)</code></td>
20262 <td><code></code></td>
20263 <td>Sets the position of <code>el</code> to coordinates specified by <code>position</code>,
20264using CSS translate or top/left positioning depending on the browser
20265(used by Leaflet internally to position its layers).</td>
20266 </tr>
20267 <tr id='domutil-getposition'>
20268 <td><code><b>getPosition</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20269 <td><code><a href='#point'>Point</a></code></td>
20270 <td>Returns the coordinates of an element previously positioned with setPosition.</td>
20271 </tr>
20272 <tr id='domutil-disabletextselection'>
20273 <td><code><b>disableTextSelection</b>()</code></td>
20274 <td><code></code></td>
20275 <td>Prevents the user from generating <code>selectstart</code> DOM events, usually generated
20276when the user drags the mouse through a page with text. Used internally
20277by Leaflet to override the behaviour of any click-and-drag interaction on
20278the map. Affects drag interactions on the whole document.</td>
20279 </tr>
20280 <tr id='domutil-enabletextselection'>
20281 <td><code><b>enableTextSelection</b>()</code></td>
20282 <td><code></code></td>
20283 <td>Cancels the effects of a previous <a href="#domutil-disabletextselection"><code>L.DomUtil.disableTextSelection</code></a>.</td>
20284 </tr>
20285 <tr id='domutil-disableimagedrag'>
20286 <td><code><b>disableImageDrag</b>()</code></td>
20287 <td><code></code></td>
20288 <td>As <a href="#domutil-disabletextselection"><code>L.DomUtil.disableTextSelection</code></a>, but
20289for <code>dragstart</code> DOM events, usually generated when the user drags an image.</td>
20290 </tr>
20291 <tr id='domutil-enableimagedrag'>
20292 <td><code><b>enableImageDrag</b>()</code></td>
20293 <td><code></code></td>
20294 <td>Cancels the effects of a previous <a href="#domutil-disabletextselection"><code>L.DomUtil.disableImageDrag</code></a>.</td>
20295 </tr>
20296 <tr id='domutil-preventoutline'>
20297 <td><code><b>preventOutline</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20298 <td><code></code></td>
20299 <td>Makes the <a href="https://developer.mozilla.org/docs/Web/CSS/outline">outline</a>
20300of the element <code>el</code> invisible. Used internally by Leaflet to prevent
20301focusable elements from displaying an outline when the user performs a
20302drag interaction on them.</td>
20303 </tr>
20304 <tr id='domutil-restoreoutline'>
20305 <td><code><b>restoreOutline</b>()</code></td>
20306 <td><code></code></td>
20307 <td>Cancels the effects of a previous <a href=""><code>L.DomUtil.preventOutline</code></a>.</td>
20308 </tr>
20309 <tr id='domutil-getsizedparentnode'>
20310 <td><code><b>getSizedParentNode</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20311 <td><code>HTMLElement</code></td>
20312 <td>Finds the closest parent node which size (width and height) is not null.</td>
20313 </tr>
20314 <tr id='domutil-getscale'>
20315 <td><code><b>getScale</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>)</code></td>
20316 <td><code>Object</code></td>
20317 <td>Computes the CSS scale currently applied on the element.
20318Returns an object with <code>x</code> and <code>y</code> members as horizontal and vertical scales respectively,
20319and <code>boundingClientRect</code> as the result of <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect"><code>getBoundingClientRect()</code></a>.</td>
20320 </tr>
20321</tbody></table>
20322
20323</section>
20324
20325
20326</section><section>
20327<h3 id='domutil-property'>Properties</h3>
20328
20329<section >
20330
20331
20332
20333
20334<table><thead>
20335 <tr>
20336 <th>Property</th>
20337 <th>Type</th>
20338 <th>Description</th>
20339 </tr>
20340 </thead><tbody>
20341 <tr id='domutil-transform'>
20342 <td><code><b>TRANSFORM</b></code></td>
20343 <td><code>String</code></td>
20344 <td>Vendor-prefixed transform style name (e.g. <code>&#39;webkitTransform&#39;</code> for WebKit).</td>
20345 </tr>
20346 <tr id='domutil-transition'>
20347 <td><code><b>TRANSITION</b></code></td>
20348 <td><code>String</code></td>
20349 <td>Vendor-prefixed transition style name.</td>
20350 </tr>
20351 <tr id='domutil-transition_end'>
20352 <td><code><b>TRANSITION_END</b></code></td>
20353 <td><code>String</code></td>
20354 <td>Vendor-prefixed transitionend event name.</td>
20355 </tr>
20356</tbody></table>
20357
20358</section>
20359
20360
20361</section><h2 id='posanimation'>PosAnimation</h2><p>Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.</p>
20362
20363<section>
20364<h3 id='posanimation-example'>Usage example</h3>
20365
20366<section >
20367
20368
20369
20370
20371
20372<pre><code class="lang-js">var fx = new L.PosAnimation();
20373fx.run(el, [300, 500], 0.5);
20374</code></pre>
20375
20376
20377
20378</section>
20379
20380
20381</section><section>
20382<h3 id='posanimation-constructor'>Constructor</h3>
20383
20384<section >
20385
20386
20387
20388
20389<table><thead>
20390 <tr>
20391 <th>Constructor</th>
20392 <th>Description</th>
20393 </tr>
20394 </thead><tbody>
20395 <tr id='posanimation-l-posanimation'>
20396 <td><code><b>L.PosAnimation</b>()</code></td>
20397 <td>Creates a <a href="#posanimation"><code>PosAnimation</code></a> object.</td>
20398 </tr>
20399</tbody></table>
20400
20401
20402</section>
20403
20404
20405</section><section>
20406<h3 id='posanimation-event'>Events</h3>
20407
20408<section >
20409
20410
20411
20412
20413<table><thead>
20414 <tr>
20415 <th>Event</th>
20416 <th>Data</th>
20417 <th>Description</th>
20418 </tr>
20419 </thead><tbody>
20420 <tr id='posanimation-start'>
20421 <td><code><b>start</b></code></td>
20422 <td><code><a href='#event'>Event</a></code></td>
20423 <td>Fired when the animation starts</td>
20424 </tr>
20425 <tr id='posanimation-step'>
20426 <td><code><b>step</b></code></td>
20427 <td><code><a href='#event'>Event</a></code></td>
20428 <td>Fired continuously during the animation.</td>
20429 </tr>
20430 <tr id='posanimation-end'>
20431 <td><code><b>end</b></code></td>
20432 <td><code><a href='#event'>Event</a></code></td>
20433 <td>Fired when the animation ends.</td>
20434 </tr>
20435</tbody></table>
20436
20437</section>
20438
20439
20440</section><section>
20441<h3 id='posanimation-method'>Methods</h3>
20442
20443<section >
20444
20445
20446
20447
20448<table><thead>
20449 <tr>
20450 <th>Method</th>
20451 <th>Returns</th>
20452 <th>Description</th>
20453 </tr>
20454 </thead><tbody>
20455 <tr id='posanimation-run'>
20456 <td><code><b>run</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>newPos</i>, <nobr>&lt;Number&gt;</nobr> <i>duration?</i>, <nobr>&lt;Number&gt;</nobr> <i>easeLinearity?</i>)</code></td>
20457 <td><code></code></td>
20458 <td><p>Run an animation of a given element to a new position, optionally setting
20459duration in seconds (<code>0.25</code> by default) and easing linearity factor (3rd
20460argument of the <a href="http://cubic-bezier.com/#0,0,.5,1">cubic bezier curve</a>,
20461<code>0.5</code> by default).</p>
20462</td>
20463 </tr>
20464 <tr id='posanimation-stop'>
20465 <td><code><b>stop</b>()</code></td>
20466 <td><code></code></td>
20467 <td><p>Stops the animation (if currently running).</p>
20468</td>
20469 </tr>
20470</tbody></table>
20471
20472</section>
20473
20474
20475<div class='accordion'>
20476 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
20477 <div class='accordion-overflow'>
20478 <div class='accordion-content'><section >
20479
20480
20481
20482
20483<table><thead>
20484 <tr>
20485 <th>Method</th>
20486 <th>Returns</th>
20487 <th>Description</th>
20488 </tr>
20489 </thead><tbody>
20490 <tr id='posanimation-on'>
20491 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20492 <td><code>this</code></td>
20493 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
20494</td>
20495 </tr>
20496 <tr id='posanimation-on'>
20497 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
20498 <td><code>this</code></td>
20499 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
20500</td>
20501 </tr>
20502 <tr id='posanimation-off'>
20503 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20504 <td><code>this</code></td>
20505 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
20506</td>
20507 </tr>
20508 <tr id='posanimation-off'>
20509 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
20510 <td><code>this</code></td>
20511 <td><p>Removes a set of type/listener pairs.</p>
20512</td>
20513 </tr>
20514 <tr id='posanimation-off'>
20515 <td><code><b>off</b>()</code></td>
20516 <td><code>this</code></td>
20517 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
20518</td>
20519 </tr>
20520 <tr id='posanimation-fire'>
20521 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
20522 <td><code>this</code></td>
20523 <td><p>Fires an event of the specified type. You can optionally provide an data
20524object — the first argument of the listener function will contain its
20525properties. The event can optionally be propagated to event parents.</p>
20526</td>
20527 </tr>
20528 <tr id='posanimation-listens'>
20529 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
20530 <td><code>Boolean</code></td>
20531 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
20532</td>
20533 </tr>
20534 <tr id='posanimation-once'>
20535 <td><code><b>once</b>(<i></i>)</code></td>
20536 <td><code>this</code></td>
20537 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
20538</td>
20539 </tr>
20540 <tr id='posanimation-addeventparent'>
20541 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
20542 <td><code>this</code></td>
20543 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
20544</td>
20545 </tr>
20546 <tr id='posanimation-removeeventparent'>
20547 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
20548 <td><code>this</code></td>
20549 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
20550</td>
20551 </tr>
20552 <tr id='posanimation-addeventlistener'>
20553 <td><code><b>addEventListener</b>(<i></i>)</code></td>
20554 <td><code>this</code></td>
20555 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
20556</td>
20557 </tr>
20558 <tr id='posanimation-removeeventlistener'>
20559 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
20560 <td><code>this</code></td>
20561 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
20562</td>
20563 </tr>
20564 <tr id='posanimation-clearalleventlisteners'>
20565 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
20566 <td><code>this</code></td>
20567 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
20568</td>
20569 </tr>
20570 <tr id='posanimation-addonetimeeventlistener'>
20571 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
20572 <td><code>this</code></td>
20573 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
20574</td>
20575 </tr>
20576 <tr id='posanimation-fireevent'>
20577 <td><code><b>fireEvent</b>(<i></i>)</code></td>
20578 <td><code>this</code></td>
20579 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
20580</td>
20581 </tr>
20582 <tr id='posanimation-haseventlisteners'>
20583 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
20584 <td><code>Boolean</code></td>
20585 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
20586</td>
20587 </tr>
20588</tbody></table>
20589
20590</section></div>
20591 </div>
20592</div>
20593
20594</section><h2 id='draggable'>Draggable</h2><p>A class for making DOM elements draggable (including touch support).
20595Used internally for map and marker dragging. Only works for elements
20596that were positioned with <a href="#domutil-setposition"><code>L.DomUtil.setPosition</code></a>.</p>
20597
20598<section>
20599<h3 id='draggable-example'>Usage example</h3>
20600
20601<section >
20602
20603
20604
20605
20606
20607<pre><code class="lang-js">var draggable = new L.Draggable(elementToDrag);
20608draggable.enable();
20609</code></pre>
20610
20611
20612
20613</section>
20614
20615
20616</section><section>
20617<h3 id='draggable-constructor'>Constructor</h3>
20618
20619<section >
20620
20621
20622
20623
20624<table><thead>
20625 <tr>
20626 <th>Constructor</th>
20627 <th>Description</th>
20628 </tr>
20629 </thead><tbody>
20630 <tr id='draggable-l-draggable'>
20631 <td><code><b>L.Draggable</b>(<nobr>&lt;HTMLElement&gt;</nobr> <i>el</i>, <nobr>&lt;HTMLElement&gt;</nobr> <i>dragHandle?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>preventOutline?</i>, <nobr>&lt;<a href='#draggable-option'>Draggable options</a>&gt;</nobr> <i>options?</i>)</code></td>
20632 <td>Creates a <a href="#draggable"><code>Draggable</code></a> object for moving <code>el</code> when you start dragging the <code>dragHandle</code> element (equals <code>el</code> itself by default).</td>
20633 </tr>
20634</tbody></table>
20635
20636
20637</section>
20638
20639
20640</section><section>
20641<h3 id='draggable-option'>Options</h3>
20642
20643<section >
20644
20645
20646
20647
20648<table><thead>
20649 <tr>
20650 <th>Option</th>
20651 <th>Type</th>
20652 <th>Default</th>
20653 <th>Description</th>
20654 </tr>
20655 </thead><tbody>
20656 <tr id='draggable-clicktolerance'>
20657 <td><code><b>clickTolerance</b></code></td>
20658 <td><code>Number</code></td>
20659 <td><code>3</code></td>
20660 <td>The max number of pixels a user can shift the mouse pointer during a click
20661for it to be considered a valid click (as opposed to a mouse drag).</td>
20662 </tr>
20663</tbody></table>
20664
20665</section>
20666
20667
20668</section><section>
20669<h3 id='draggable-event'>Events</h3>
20670
20671<section >
20672
20673
20674
20675
20676<table><thead>
20677 <tr>
20678 <th>Event</th>
20679 <th>Data</th>
20680 <th>Description</th>
20681 </tr>
20682 </thead><tbody>
20683 <tr id='draggable-down'>
20684 <td><code><b>down</b></code></td>
20685 <td><code><a href='#event'>Event</a></code></td>
20686 <td>Fired when a drag is about to start.</td>
20687 </tr>
20688 <tr id='draggable-dragstart'>
20689 <td><code><b>dragstart</b></code></td>
20690 <td><code><a href='#event'>Event</a></code></td>
20691 <td>Fired when a drag starts</td>
20692 </tr>
20693 <tr id='draggable-predrag'>
20694 <td><code><b>predrag</b></code></td>
20695 <td><code><a href='#event'>Event</a></code></td>
20696 <td>Fired continuously during dragging <em>before</em> each corresponding
20697update of the element&#39;s position.</td>
20698 </tr>
20699 <tr id='draggable-drag'>
20700 <td><code><b>drag</b></code></td>
20701 <td><code><a href='#event'>Event</a></code></td>
20702 <td>Fired continuously during dragging.</td>
20703 </tr>
20704 <tr id='draggable-dragend'>
20705 <td><code><b>dragend</b></code></td>
20706 <td><code><a href='#dragendevent'>DragEndEvent</a></code></td>
20707 <td>Fired when the drag ends.</td>
20708 </tr>
20709</tbody></table>
20710
20711</section>
20712
20713
20714</section><section>
20715<h3 id='draggable-method'>Methods</h3>
20716
20717<section >
20718
20719
20720
20721
20722<table><thead>
20723 <tr>
20724 <th>Method</th>
20725 <th>Returns</th>
20726 <th>Description</th>
20727 </tr>
20728 </thead><tbody>
20729 <tr id='draggable-enable'>
20730 <td><code><b>enable</b>()</code></td>
20731 <td><code></code></td>
20732 <td><p>Enables the dragging ability</p>
20733</td>
20734 </tr>
20735 <tr id='draggable-disable'>
20736 <td><code><b>disable</b>()</code></td>
20737 <td><code></code></td>
20738 <td><p>Disables the dragging ability</p>
20739</td>
20740 </tr>
20741</tbody></table>
20742
20743</section>
20744
20745
20746<div class='accordion'>
20747 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
20748 <div class='accordion-overflow'>
20749 <div class='accordion-content'><section >
20750
20751
20752
20753
20754<table><thead>
20755 <tr>
20756 <th>Method</th>
20757 <th>Returns</th>
20758 <th>Description</th>
20759 </tr>
20760 </thead><tbody>
20761 <tr id='draggable-on'>
20762 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20763 <td><code>this</code></td>
20764 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
20765</td>
20766 </tr>
20767 <tr id='draggable-on'>
20768 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
20769 <td><code>this</code></td>
20770 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
20771</td>
20772 </tr>
20773 <tr id='draggable-off'>
20774 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
20775 <td><code>this</code></td>
20776 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
20777</td>
20778 </tr>
20779 <tr id='draggable-off'>
20780 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
20781 <td><code>this</code></td>
20782 <td><p>Removes a set of type/listener pairs.</p>
20783</td>
20784 </tr>
20785 <tr id='draggable-off'>
20786 <td><code><b>off</b>()</code></td>
20787 <td><code>this</code></td>
20788 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
20789</td>
20790 </tr>
20791 <tr id='draggable-fire'>
20792 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
20793 <td><code>this</code></td>
20794 <td><p>Fires an event of the specified type. You can optionally provide an data
20795object — the first argument of the listener function will contain its
20796properties. The event can optionally be propagated to event parents.</p>
20797</td>
20798 </tr>
20799 <tr id='draggable-listens'>
20800 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
20801 <td><code>Boolean</code></td>
20802 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
20803</td>
20804 </tr>
20805 <tr id='draggable-once'>
20806 <td><code><b>once</b>(<i></i>)</code></td>
20807 <td><code>this</code></td>
20808 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
20809</td>
20810 </tr>
20811 <tr id='draggable-addeventparent'>
20812 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
20813 <td><code>this</code></td>
20814 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
20815</td>
20816 </tr>
20817 <tr id='draggable-removeeventparent'>
20818 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
20819 <td><code>this</code></td>
20820 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
20821</td>
20822 </tr>
20823 <tr id='draggable-addeventlistener'>
20824 <td><code><b>addEventListener</b>(<i></i>)</code></td>
20825 <td><code>this</code></td>
20826 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
20827</td>
20828 </tr>
20829 <tr id='draggable-removeeventlistener'>
20830 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
20831 <td><code>this</code></td>
20832 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
20833</td>
20834 </tr>
20835 <tr id='draggable-clearalleventlisteners'>
20836 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
20837 <td><code>this</code></td>
20838 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
20839</td>
20840 </tr>
20841 <tr id='draggable-addonetimeeventlistener'>
20842 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
20843 <td><code>this</code></td>
20844 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
20845</td>
20846 </tr>
20847 <tr id='draggable-fireevent'>
20848 <td><code><b>fireEvent</b>(<i></i>)</code></td>
20849 <td><code>this</code></td>
20850 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
20851</td>
20852 </tr>
20853 <tr id='draggable-haseventlisteners'>
20854 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
20855 <td><code>Boolean</code></td>
20856 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
20857</td>
20858 </tr>
20859</tbody></table>
20860
20861</section></div>
20862 </div>
20863</div>
20864
20865</section><h2 id='class'>Class</h2><p>L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
20866In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.</p>
20867
20868<section>
20869<h3 id='class-example'>Usage example</h3>
20870
20871<section >
20872
20873
20874
20875
20876
20877<pre><code class="lang-js">var MyClass = L.Class.extend({
20878initialize: function (greeter) {
20879 this.greeter = greeter;
20880 // class constructor
20881},
20882greet: function (name) {
20883 alert(this.greeter + &#39;, &#39; + name)
20884 }
20885});
20886// create instance of MyClass, passing &quot;Hello&quot; to the constructor
20887var a = new MyClass(&quot;Hello&quot;);
20888// call greet method, alerting &quot;Hello, World&quot;
20889a.greet(&quot;World&quot;);
20890</code></pre>
20891
20892
20893
20894</section><section >
20895
20896<h4 id='class-class-factories'>Class Factories</h4>
20897
20898
20899
20900<p>You may have noticed that Leaflet objects are created without using
20901the <code>new</code> keyword. This is achieved by complementing each class with a
20902lowercase factory method:</p>
20903<pre><code class="lang-js">new L.Map(&#39;map&#39;); // becomes:
20904L.map(&#39;map&#39;);
20905</code></pre>
20906<p>The factories are implemented very easily, and you can do this for your own classes:</p>
20907<pre><code class="lang-js">L.map = function (id, options) {
20908 return new L.Map(id, options);
20909};
20910</code></pre>
20911
20912
20913
20914</section><section >
20915
20916<h4 id='class-inheritance'>Inheritance</h4>
20917
20918
20919
20920<p>You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:</p>
20921<pre><code class="lang-js">var MyChildClass = MyClass.extend({
20922 // ... new properties and methods
20923});
20924</code></pre>
20925<p>This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:</p>
20926<pre><code class="lang-js">var a = new MyChildClass();
20927a instanceof MyChildClass; // true
20928a instanceof MyClass; // true
20929</code></pre>
20930<p>You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript&#39;s call or apply:</p>
20931<pre><code>var MyChildClass = MyClass.extend({
20932 initialize: function () {
20933 MyClass.prototype.initialize.call(this, &quot;Yo&quot;);
20934 },
20935 greet: function (name) {
20936 MyClass.prototype.greet.call(this, &#39;bro &#39; + name + &#39;!&#39;);
20937 }
20938});
20939var a = new MyChildClass();
20940a.greet(&#39;Jason&#39;); // alerts &quot;Yo, bro Jason!&quot;
20941</code></pre>
20942
20943
20944</section><section >
20945
20946<h4 id='class-options'>Options</h4>
20947
20948
20949
20950<p><code>options</code> is a special property that unlike other objects that you pass
20951to <code>extend</code> will be merged with the parent one instead of overriding it
20952completely, which makes managing configuration of objects and default
20953values convenient:</p>
20954<pre><code class="lang-js">var MyClass = L.Class.extend({
20955 options: {
20956 myOption1: &#39;foo&#39;,
20957 myOption2: &#39;bar&#39;
20958 }
20959});
20960var MyChildClass = MyClass.extend({
20961 options: {
20962 myOption1: &#39;baz&#39;,
20963 myOption3: 5
20964 }
20965});
20966var a = new MyChildClass();
20967a.options.myOption1; // &#39;baz&#39;
20968a.options.myOption2; // &#39;bar&#39;
20969a.options.myOption3; // 5
20970</code></pre>
20971<p>There&#39;s also <a href="#util-setoptions"><code>L.Util.setOptions</code></a>, a method for
20972conveniently merging options passed to constructor with the defaults
20973defines in the class:</p>
20974<pre><code class="lang-js">var MyClass = L.Class.extend({
20975 options: {
20976 foo: &#39;bar&#39;,
20977 bla: 5
20978 },
20979 initialize: function (options) {
20980 L.Util.setOptions(this, options);
20981 ...
20982 }
20983});
20984var a = new MyClass({bla: 10});
20985a.options; // {foo: &#39;bar&#39;, bla: 10}
20986</code></pre>
20987<p>Note that the options object allows any keys, not just
20988the options defined by the class and its base classes.
20989This means you can use the options object to store
20990application specific information, as long as you avoid
20991keys that are already used by the class in question.</p>
20992
20993
20994
20995</section><section >
20996
20997<h4 id='class-includes'>Includes</h4>
20998
20999
21000
21001<p><code>includes</code> is a special class property that merges all specified objects into the class (such objects are called mixins).</p>
21002<pre><code class="lang-js"> var MyMixin = {
21003 foo: function () { ... },
21004 bar: 5
21005};
21006var MyClass = L.Class.extend({
21007 includes: MyMixin
21008});
21009var a = new MyClass();
21010a.foo();
21011</code></pre>
21012<p>You can also do such includes in runtime with the <code>include</code> method:</p>
21013<pre><code class="lang-js">MyClass.include(MyMixin);
21014</code></pre>
21015<p><code>statics</code> is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:</p>
21016<pre><code class="lang-js">var MyClass = L.Class.extend({
21017 statics: {
21018 FOO: &#39;bar&#39;,
21019 BLA: 5
21020 }
21021});
21022MyClass.FOO; // &#39;bar&#39;
21023</code></pre>
21024
21025
21026
21027</section><section >
21028
21029<h4 id='class-constructor-hooks'>Constructor hooks</h4>
21030
21031
21032
21033<p>If you&#39;re a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for <a href="#polyline"><code>L.Polyline</code></a>). Leaflet comes with a way to do it easily using the <code>addInitHook</code> method:</p>
21034<pre><code class="lang-js">MyClass.addInitHook(function () {
21035 // ... do something in constructor additionally
21036 // e.g. add event listeners, set custom properties etc.
21037});
21038</code></pre>
21039<p>You can also use the following shortcut when you just need to make one additional method call:</p>
21040<pre><code class="lang-js">MyClass.addInitHook(&#39;methodName&#39;, arg1, arg2, …);
21041</code></pre>
21042
21043
21044
21045</section>
21046
21047
21048</section><section>
21049<h3 id='class-function'>Functions</h3>
21050
21051<section >
21052
21053
21054
21055
21056<table><thead>
21057 <tr>
21058 <th>Function</th>
21059 <th>Returns</th>
21060 <th>Description</th>
21061 </tr>
21062 </thead><tbody>
21063 <tr id='class-extend'>
21064 <td><code><b>extend</b>(<nobr>&lt;Object&gt;</nobr> <i>props</i>)</code></td>
21065 <td><code>Function</code></td>
21066 <td><a href="#class-inheritance">Extends the current class</a> given the properties to be included.
21067Returns a Javascript function that is a class constructor (to be called with <code>new</code>).</td>
21068 </tr>
21069 <tr id='class-include'>
21070 <td><code><b>include</b>(<nobr>&lt;Object&gt;</nobr> <i>properties</i>)</code></td>
21071 <td><code>this</code></td>
21072 <td><a href="#class-includes">Includes a mixin</a> into the current class.</td>
21073 </tr>
21074 <tr id='class-mergeoptions'>
21075 <td><code><b>mergeOptions</b>(<nobr>&lt;Object&gt;</nobr> <i>options</i>)</code></td>
21076 <td><code>this</code></td>
21077 <td><a href="#class-options">Merges <code>options</code></a> into the defaults of the class.</td>
21078 </tr>
21079 <tr id='class-addinithook'>
21080 <td><code><b>addInitHook</b>(<nobr>&lt;Function&gt;</nobr> <i>fn</i>)</code></td>
21081 <td><code>this</code></td>
21082 <td>Adds a <a href="#class-constructor-hooks">constructor hook</a> to the class.</td>
21083 </tr>
21084</tbody></table>
21085
21086</section>
21087
21088
21089</section><h2 id='evented'>Evented</h2><p>A set of methods shared between event-powered classes (like <a href="#map"><code>Map</code></a> and <a href="#marker"><code>Marker</code></a>). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire <code>&#39;click&#39;</code> event).</p>
21090
21091<section>
21092<h3 id='evented-example'>Usage example</h3>
21093
21094<section >
21095
21096
21097
21098
21099
21100<pre><code class="lang-js">map.on(&#39;click&#39;, function(e) {
21101 alert(e.latlng);
21102} );
21103</code></pre>
21104<p>Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:</p>
21105<pre><code class="lang-js">function onClick(e) { ... }
21106map.on(&#39;click&#39;, onClick);
21107map.off(&#39;click&#39;, onClick);
21108</code></pre>
21109
21110
21111
21112</section>
21113
21114
21115</section><section>
21116<h3 id='evented-method'>Methods</h3>
21117
21118<section >
21119
21120
21121
21122
21123<table><thead>
21124 <tr>
21125 <th>Method</th>
21126 <th>Returns</th>
21127 <th>Description</th>
21128 </tr>
21129 </thead><tbody>
21130 <tr id='evented-on'>
21131 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
21132 <td><code>this</code></td>
21133 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
21134</td>
21135 </tr>
21136 <tr id='evented-on'>
21137 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
21138 <td><code>this</code></td>
21139 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
21140</td>
21141 </tr>
21142 <tr id='evented-off'>
21143 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
21144 <td><code>this</code></td>
21145 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
21146</td>
21147 </tr>
21148 <tr id='evented-off'>
21149 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
21150 <td><code>this</code></td>
21151 <td><p>Removes a set of type/listener pairs.</p>
21152</td>
21153 </tr>
21154 <tr id='evented-off'>
21155 <td><code><b>off</b>()</code></td>
21156 <td><code>this</code></td>
21157 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
21158</td>
21159 </tr>
21160 <tr id='evented-fire'>
21161 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
21162 <td><code>this</code></td>
21163 <td><p>Fires an event of the specified type. You can optionally provide an data
21164object — the first argument of the listener function will contain its
21165properties. The event can optionally be propagated to event parents.</p>
21166</td>
21167 </tr>
21168 <tr id='evented-listens'>
21169 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
21170 <td><code>Boolean</code></td>
21171 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
21172</td>
21173 </tr>
21174 <tr id='evented-once'>
21175 <td><code><b>once</b>(<i></i>)</code></td>
21176 <td><code>this</code></td>
21177 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
21178</td>
21179 </tr>
21180 <tr id='evented-addeventparent'>
21181 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
21182 <td><code>this</code></td>
21183 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
21184</td>
21185 </tr>
21186 <tr id='evented-removeeventparent'>
21187 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
21188 <td><code>this</code></td>
21189 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
21190</td>
21191 </tr>
21192 <tr id='evented-addeventlistener'>
21193 <td><code><b>addEventListener</b>(<i></i>)</code></td>
21194 <td><code>this</code></td>
21195 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
21196</td>
21197 </tr>
21198 <tr id='evented-removeeventlistener'>
21199 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
21200 <td><code>this</code></td>
21201 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
21202</td>
21203 </tr>
21204 <tr id='evented-clearalleventlisteners'>
21205 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
21206 <td><code>this</code></td>
21207 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
21208</td>
21209 </tr>
21210 <tr id='evented-addonetimeeventlistener'>
21211 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
21212 <td><code>this</code></td>
21213 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
21214</td>
21215 </tr>
21216 <tr id='evented-fireevent'>
21217 <td><code><b>fireEvent</b>(<i></i>)</code></td>
21218 <td><code>this</code></td>
21219 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
21220</td>
21221 </tr>
21222 <tr id='evented-haseventlisteners'>
21223 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
21224 <td><code>Boolean</code></td>
21225 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
21226</td>
21227 </tr>
21228</tbody></table>
21229
21230</section>
21231
21232
21233</section><h2 id='layer'>Layer</h2><p>A set of methods from the Layer base class that all Leaflet layers use.
21234Inherits all methods, options and events from <a href="#evented"><code>L.Evented</code></a>.</p>
21235
21236<section>
21237<h3 id='layer-example'>Usage example</h3>
21238
21239<section >
21240
21241
21242
21243
21244
21245<pre><code class="lang-js">var layer = L.marker(latlng).addTo(map);
21246layer.addTo(map);
21247layer.remove();
21248</code></pre>
21249
21250
21251
21252</section>
21253
21254
21255</section><section>
21256<h3 id='layer-option'>Options</h3>
21257
21258<section >
21259
21260
21261
21262
21263<table><thead>
21264 <tr>
21265 <th>Option</th>
21266 <th>Type</th>
21267 <th>Default</th>
21268 <th>Description</th>
21269 </tr>
21270 </thead><tbody>
21271 <tr id='layer-pane'>
21272 <td><code><b>pane</b></code></td>
21273 <td><code>String</code></td>
21274 <td><code>&#x27;overlayPane&#x27;</code></td>
21275 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
21276 </tr>
21277 <tr id='layer-attribution'>
21278 <td><code><b>attribution</b></code></td>
21279 <td><code>String</code></td>
21280 <td><code>null</code></td>
21281 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
21282 </tr>
21283</tbody></table>
21284
21285</section>
21286
21287
21288</section><section>
21289<h3 id='layer-event'>Events</h3>
21290
21291<section >
21292
21293
21294
21295
21296<table><thead>
21297 <tr>
21298 <th>Event</th>
21299 <th>Data</th>
21300 <th>Description</th>
21301 </tr>
21302 </thead><tbody>
21303 <tr id='layer-add'>
21304 <td><code><b>add</b></code></td>
21305 <td><code><a href='#event'>Event</a></code></td>
21306 <td>Fired after the layer is added to a map</td>
21307 </tr>
21308 <tr id='layer-remove'>
21309 <td><code><b>remove</b></code></td>
21310 <td><code><a href='#event'>Event</a></code></td>
21311 <td>Fired after the layer is removed from a map</td>
21312 </tr>
21313</tbody></table>
21314
21315</section><section class='collapsable'>
21316
21317<h4 id='layer-popup-events'>Popup events</h4>
21318
21319
21320<table><thead>
21321 <tr>
21322 <th>Event</th>
21323 <th>Data</th>
21324 <th>Description</th>
21325 </tr>
21326 </thead><tbody>
21327 <tr id='layer-popupopen'>
21328 <td><code><b>popupopen</b></code></td>
21329 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
21330 <td>Fired when a popup bound to this layer is opened</td>
21331 </tr>
21332 <tr id='layer-popupclose'>
21333 <td><code><b>popupclose</b></code></td>
21334 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
21335 <td>Fired when a popup bound to this layer is closed</td>
21336 </tr>
21337</tbody></table>
21338
21339</section><section class='collapsable'>
21340
21341<h4 id='layer-tooltip-events'>Tooltip events</h4>
21342
21343
21344<table><thead>
21345 <tr>
21346 <th>Event</th>
21347 <th>Data</th>
21348 <th>Description</th>
21349 </tr>
21350 </thead><tbody>
21351 <tr id='layer-tooltipopen'>
21352 <td><code><b>tooltipopen</b></code></td>
21353 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
21354 <td>Fired when a tooltip bound to this layer is opened.</td>
21355 </tr>
21356 <tr id='layer-tooltipclose'>
21357 <td><code><b>tooltipclose</b></code></td>
21358 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
21359 <td>Fired when a tooltip bound to this layer is closed.</td>
21360 </tr>
21361</tbody></table>
21362
21363</section>
21364
21365
21366</section><section>
21367<h3 id='layer-method'>Methods</h3>
21368
21369<section >
21370
21371
21372
21373<div class='section-comments'>Classes extending <a href="#layer"><code>L.Layer</code></a> will inherit the following methods:</div>
21374
21375<table><thead>
21376 <tr>
21377 <th>Method</th>
21378 <th>Returns</th>
21379 <th>Description</th>
21380 </tr>
21381 </thead><tbody>
21382 <tr id='layer-addto'>
21383 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
21384 <td><code>this</code></td>
21385 <td><p>Adds the layer to the given map or layer group.</p>
21386</td>
21387 </tr>
21388 <tr id='layer-remove'>
21389 <td><code><b>remove</b>()</code></td>
21390 <td><code>this</code></td>
21391 <td><p>Removes the layer from the map it is currently active on.</p>
21392</td>
21393 </tr>
21394 <tr id='layer-removefrom'>
21395 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
21396 <td><code>this</code></td>
21397 <td><p>Removes the layer from the given map</p>
21398</td>
21399 </tr>
21400 <tr id='layer-removefrom'>
21401 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
21402 <td><code>this</code></td>
21403 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
21404</td>
21405 </tr>
21406 <tr id='layer-getpane'>
21407 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
21408 <td><code>HTMLElement</code></td>
21409 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
21410</td>
21411 </tr>
21412 <tr id='layer-getattribution'>
21413 <td><code><b>getAttribution</b>()</code></td>
21414 <td><code>String</code></td>
21415 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
21416</td>
21417 </tr>
21418</tbody></table>
21419
21420</section><section class='collapsable'>
21421
21422<h4 id='layer-extension-methods'>Extension methods</h4>
21423
21424<div class='section-comments'>Every layer should extend from <a href="#layer"><code>L.Layer</code></a> and (re-)implement the following methods.</div>
21425
21426<table><thead>
21427 <tr>
21428 <th>Method</th>
21429 <th>Returns</th>
21430 <th>Description</th>
21431 </tr>
21432 </thead><tbody>
21433 <tr id='layer-onadd'>
21434 <td><code><b>onAdd</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
21435 <td><code>this</code></td>
21436 <td><p>Should contain code that creates DOM elements for the layer, adds them to <code>map panes</code> where they should belong and puts listeners on relevant map events. Called on <a href="#map-addlayer"><code>map.addLayer(layer)</code></a>.</p>
21437</td>
21438 </tr>
21439 <tr id='layer-onremove'>
21440 <td><code><b>onRemove</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
21441 <td><code>this</code></td>
21442 <td><p>Should contain all clean up code that removes the layer&#39;s elements from the DOM and removes listeners previously added in <a href="#layer-onadd"><code>onAdd</code></a>. Called on <a href="#map-removelayer"><code>map.removeLayer(layer)</code></a>.</p>
21443</td>
21444 </tr>
21445 <tr id='layer-getevents'>
21446 <td><code><b>getEvents</b>()</code></td>
21447 <td><code>Object</code></td>
21448 <td><p>This optional method should return an object like <code>{ viewreset: this._reset }</code> for <a href="#evented-addeventlistener"><code>addEventListener</code></a>. The event handlers in this object will be automatically added and removed from the map with your layer.</p>
21449</td>
21450 </tr>
21451 <tr id='layer-getattribution'>
21452 <td><code><b>getAttribution</b>()</code></td>
21453 <td><code>String</code></td>
21454 <td><p>This optional method should return a string containing HTML to be shown on the <code>Attribution control</code> whenever the layer is visible.</p>
21455</td>
21456 </tr>
21457 <tr id='layer-beforeadd'>
21458 <td><code><b>beforeAdd</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
21459 <td><code>this</code></td>
21460 <td><p>Optional method. Called on <a href="#map-addlayer"><code>map.addLayer(layer)</code></a>, before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.</p>
21461</td>
21462 </tr>
21463</tbody></table>
21464
21465</section><section class='collapsable'>
21466
21467<h4 id='layer-popup-methods'>Popup methods</h4>
21468
21469<div class='section-comments'>All layers share a set of methods convenient for binding popups to it.
21470<pre><code class="lang-js">var layer = L.Polygon(latlngs).bindPopup(&#39;Hi There!&#39;).addTo(map);
21471layer.openPopup();
21472layer.closePopup();
21473</code></pre>
21474<p>Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.</p></div>
21475
21476<table><thead>
21477 <tr>
21478 <th>Method</th>
21479 <th>Returns</th>
21480 <th>Description</th>
21481 </tr>
21482 </thead><tbody>
21483 <tr id='layer-bindpopup'>
21484 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
21485 <td><code>this</code></td>
21486 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
21487necessary event listeners. If a <code>Function</code> is passed it will receive
21488the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
21489</td>
21490 </tr>
21491 <tr id='layer-unbindpopup'>
21492 <td><code><b>unbindPopup</b>()</code></td>
21493 <td><code>this</code></td>
21494 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
21495</td>
21496 </tr>
21497 <tr id='layer-openpopup'>
21498 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
21499 <td><code>this</code></td>
21500 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
21501</td>
21502 </tr>
21503 <tr id='layer-closepopup'>
21504 <td><code><b>closePopup</b>()</code></td>
21505 <td><code>this</code></td>
21506 <td><p>Closes the popup bound to this layer if it is open.</p>
21507</td>
21508 </tr>
21509 <tr id='layer-togglepopup'>
21510 <td><code><b>togglePopup</b>()</code></td>
21511 <td><code>this</code></td>
21512 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
21513</td>
21514 </tr>
21515 <tr id='layer-ispopupopen'>
21516 <td><code><b>isPopupOpen</b>()</code></td>
21517 <td><code>boolean</code></td>
21518 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
21519</td>
21520 </tr>
21521 <tr id='layer-setpopupcontent'>
21522 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
21523 <td><code>this</code></td>
21524 <td><p>Sets the content of the popup bound to this layer.</p>
21525</td>
21526 </tr>
21527 <tr id='layer-getpopup'>
21528 <td><code><b>getPopup</b>()</code></td>
21529 <td><code><a href='#popup'>Popup</a></code></td>
21530 <td><p>Returns the popup bound to this layer.</p>
21531</td>
21532 </tr>
21533</tbody></table>
21534
21535</section><section class='collapsable'>
21536
21537<h4 id='layer-tooltip-methods'>Tooltip methods</h4>
21538
21539<div class='section-comments'>All layers share a set of methods convenient for binding tooltips to it.
21540<pre><code class="lang-js">var layer = L.Polygon(latlngs).bindTooltip(&#39;Hi There!&#39;).addTo(map);
21541layer.openTooltip();
21542layer.closeTooltip();
21543</code></pre></div>
21544
21545<table><thead>
21546 <tr>
21547 <th>Method</th>
21548 <th>Returns</th>
21549 <th>Description</th>
21550 </tr>
21551 </thead><tbody>
21552 <tr id='layer-bindtooltip'>
21553 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
21554 <td><code>this</code></td>
21555 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
21556necessary event listeners. If a <code>Function</code> is passed it will receive
21557the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
21558</td>
21559 </tr>
21560 <tr id='layer-unbindtooltip'>
21561 <td><code><b>unbindTooltip</b>()</code></td>
21562 <td><code>this</code></td>
21563 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
21564</td>
21565 </tr>
21566 <tr id='layer-opentooltip'>
21567 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
21568 <td><code>this</code></td>
21569 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
21570</td>
21571 </tr>
21572 <tr id='layer-closetooltip'>
21573 <td><code><b>closeTooltip</b>()</code></td>
21574 <td><code>this</code></td>
21575 <td><p>Closes the tooltip bound to this layer if it is open.</p>
21576</td>
21577 </tr>
21578 <tr id='layer-toggletooltip'>
21579 <td><code><b>toggleTooltip</b>()</code></td>
21580 <td><code>this</code></td>
21581 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
21582</td>
21583 </tr>
21584 <tr id='layer-istooltipopen'>
21585 <td><code><b>isTooltipOpen</b>()</code></td>
21586 <td><code>boolean</code></td>
21587 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
21588</td>
21589 </tr>
21590 <tr id='layer-settooltipcontent'>
21591 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
21592 <td><code>this</code></td>
21593 <td><p>Sets the content of the tooltip bound to this layer.</p>
21594</td>
21595 </tr>
21596 <tr id='layer-gettooltip'>
21597 <td><code><b>getTooltip</b>()</code></td>
21598 <td><code><a href='#tooltip'>Tooltip</a></code></td>
21599 <td><p>Returns the tooltip bound to this layer.</p>
21600</td>
21601 </tr>
21602</tbody></table>
21603
21604</section>
21605
21606
21607<div class='accordion'>
21608 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
21609 <div class='accordion-overflow'>
21610 <div class='accordion-content'><section >
21611
21612
21613
21614
21615<table><thead>
21616 <tr>
21617 <th>Method</th>
21618 <th>Returns</th>
21619 <th>Description</th>
21620 </tr>
21621 </thead><tbody>
21622 <tr id='layer-on'>
21623 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
21624 <td><code>this</code></td>
21625 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
21626</td>
21627 </tr>
21628 <tr id='layer-on'>
21629 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
21630 <td><code>this</code></td>
21631 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
21632</td>
21633 </tr>
21634 <tr id='layer-off'>
21635 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
21636 <td><code>this</code></td>
21637 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
21638</td>
21639 </tr>
21640 <tr id='layer-off'>
21641 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
21642 <td><code>this</code></td>
21643 <td><p>Removes a set of type/listener pairs.</p>
21644</td>
21645 </tr>
21646 <tr id='layer-off'>
21647 <td><code><b>off</b>()</code></td>
21648 <td><code>this</code></td>
21649 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
21650</td>
21651 </tr>
21652 <tr id='layer-fire'>
21653 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
21654 <td><code>this</code></td>
21655 <td><p>Fires an event of the specified type. You can optionally provide an data
21656object — the first argument of the listener function will contain its
21657properties. The event can optionally be propagated to event parents.</p>
21658</td>
21659 </tr>
21660 <tr id='layer-listens'>
21661 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
21662 <td><code>Boolean</code></td>
21663 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
21664</td>
21665 </tr>
21666 <tr id='layer-once'>
21667 <td><code><b>once</b>(<i></i>)</code></td>
21668 <td><code>this</code></td>
21669 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
21670</td>
21671 </tr>
21672 <tr id='layer-addeventparent'>
21673 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
21674 <td><code>this</code></td>
21675 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
21676</td>
21677 </tr>
21678 <tr id='layer-removeeventparent'>
21679 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
21680 <td><code>this</code></td>
21681 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
21682</td>
21683 </tr>
21684 <tr id='layer-addeventlistener'>
21685 <td><code><b>addEventListener</b>(<i></i>)</code></td>
21686 <td><code>this</code></td>
21687 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
21688</td>
21689 </tr>
21690 <tr id='layer-removeeventlistener'>
21691 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
21692 <td><code>this</code></td>
21693 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
21694</td>
21695 </tr>
21696 <tr id='layer-clearalleventlisteners'>
21697 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
21698 <td><code>this</code></td>
21699 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
21700</td>
21701 </tr>
21702 <tr id='layer-addonetimeeventlistener'>
21703 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
21704 <td><code>this</code></td>
21705 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
21706</td>
21707 </tr>
21708 <tr id='layer-fireevent'>
21709 <td><code><b>fireEvent</b>(<i></i>)</code></td>
21710 <td><code>this</code></td>
21711 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
21712</td>
21713 </tr>
21714 <tr id='layer-haseventlisteners'>
21715 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
21716 <td><code>Boolean</code></td>
21717 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
21718</td>
21719 </tr>
21720</tbody></table>
21721
21722</section></div>
21723 </div>
21724</div>
21725
21726</section><h2 id='interactive-layer'>Interactive layer</h2><p>Some <a href="#layer"><code>Layer</code></a>s can be made interactive - when the user interacts
21727with such a layer, mouse events like <code>click</code> and <code>mouseover</code> can be handled.
21728Use the <a href="#evented-method">event handling methods</a> to handle these events.</p>
21729
21730<section>
21731<h3 id='interactive-layer-option'>Options</h3>
21732
21733<section >
21734
21735
21736
21737
21738<table><thead>
21739 <tr>
21740 <th>Option</th>
21741 <th>Type</th>
21742 <th>Default</th>
21743 <th>Description</th>
21744 </tr>
21745 </thead><tbody>
21746 <tr id='interactive-layer-interactive'>
21747 <td><code><b>interactive</b></code></td>
21748 <td><code>Boolean</code></td>
21749 <td><code>true</code></td>
21750 <td>If <code>false</code>, the layer will not emit mouse events and will act as a part of the underlying map.</td>
21751 </tr>
21752 <tr id='interactive-layer-bubblingmouseevents'>
21753 <td><code><b>bubblingMouseEvents</b></code></td>
21754 <td><code>Boolean</code></td>
21755 <td><code>true</code></td>
21756 <td>When <code>true</code>, a mouse event on this layer will trigger the same event on the map
21757(unless <a href="#domevent-stoppropagation"><code>L.DomEvent.stopPropagation</code></a> is used).</td>
21758 </tr>
21759</tbody></table>
21760
21761</section>
21762
21763
21764<div class='accordion'>
21765 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
21766 <div class='accordion-overflow'>
21767 <div class='accordion-content'><section >
21768
21769
21770
21771
21772<table><thead>
21773 <tr>
21774 <th>Option</th>
21775 <th>Type</th>
21776 <th>Default</th>
21777 <th>Description</th>
21778 </tr>
21779 </thead><tbody>
21780 <tr id='interactive-layer-pane'>
21781 <td><code><b>pane</b></code></td>
21782 <td><code>String</code></td>
21783 <td><code>&#x27;overlayPane&#x27;</code></td>
21784 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
21785 </tr>
21786 <tr id='interactive-layer-attribution'>
21787 <td><code><b>attribution</b></code></td>
21788 <td><code>String</code></td>
21789 <td><code>null</code></td>
21790 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
21791 </tr>
21792</tbody></table>
21793
21794</section></div>
21795 </div>
21796</div>
21797
21798</section><section>
21799<h3 id='interactive-layer-event'>Events</h3>
21800
21801<section class='collapsable'>
21802
21803<h4 id='interactive-layer-mouse-events'>Mouse events</h4>
21804
21805
21806<table><thead>
21807 <tr>
21808 <th>Event</th>
21809 <th>Data</th>
21810 <th>Description</th>
21811 </tr>
21812 </thead><tbody>
21813 <tr id='interactive-layer-click'>
21814 <td><code><b>click</b></code></td>
21815 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21816 <td>Fired when the user clicks (or taps) the layer.</td>
21817 </tr>
21818 <tr id='interactive-layer-dblclick'>
21819 <td><code><b>dblclick</b></code></td>
21820 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21821 <td>Fired when the user double-clicks (or double-taps) the layer.</td>
21822 </tr>
21823 <tr id='interactive-layer-mousedown'>
21824 <td><code><b>mousedown</b></code></td>
21825 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21826 <td>Fired when the user pushes the mouse button on the layer.</td>
21827 </tr>
21828 <tr id='interactive-layer-mouseup'>
21829 <td><code><b>mouseup</b></code></td>
21830 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21831 <td>Fired when the user releases the mouse button pushed on the layer.</td>
21832 </tr>
21833 <tr id='interactive-layer-mouseover'>
21834 <td><code><b>mouseover</b></code></td>
21835 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21836 <td>Fired when the mouse enters the layer.</td>
21837 </tr>
21838 <tr id='interactive-layer-mouseout'>
21839 <td><code><b>mouseout</b></code></td>
21840 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21841 <td>Fired when the mouse leaves the layer.</td>
21842 </tr>
21843 <tr id='interactive-layer-contextmenu'>
21844 <td><code><b>contextmenu</b></code></td>
21845 <td><code><a href='#mouseevent'>MouseEvent</a></code></td>
21846 <td>Fired when the user right-clicks on the layer, prevents
21847default browser context menu from showing if there are listeners on
21848this event. Also fired on mobile when the user holds a single touch
21849for a second (also called long press).</td>
21850 </tr>
21851</tbody></table>
21852
21853</section>
21854
21855
21856<div class='accordion'>
21857 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
21858 <div class='accordion-overflow'>
21859 <div class='accordion-content'><section >
21860
21861
21862
21863
21864<table><thead>
21865 <tr>
21866 <th>Event</th>
21867 <th>Data</th>
21868 <th>Description</th>
21869 </tr>
21870 </thead><tbody>
21871 <tr id='interactive-layer-add'>
21872 <td><code><b>add</b></code></td>
21873 <td><code><a href='#event'>Event</a></code></td>
21874 <td>Fired after the layer is added to a map</td>
21875 </tr>
21876 <tr id='interactive-layer-remove'>
21877 <td><code><b>remove</b></code></td>
21878 <td><code><a href='#event'>Event</a></code></td>
21879 <td>Fired after the layer is removed from a map</td>
21880 </tr>
21881</tbody></table>
21882
21883</section></div>
21884 </div>
21885</div>
21886
21887<div class='accordion'>
21888 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
21889 <div class='accordion-overflow'>
21890 <div class='accordion-content'><section >
21891
21892
21893
21894
21895<table><thead>
21896 <tr>
21897 <th>Event</th>
21898 <th>Data</th>
21899 <th>Description</th>
21900 </tr>
21901 </thead><tbody>
21902 <tr id='interactive-layer-popupopen'>
21903 <td><code><b>popupopen</b></code></td>
21904 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
21905 <td>Fired when a popup bound to this layer is opened</td>
21906 </tr>
21907 <tr id='interactive-layer-popupclose'>
21908 <td><code><b>popupclose</b></code></td>
21909 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
21910 <td>Fired when a popup bound to this layer is closed</td>
21911 </tr>
21912</tbody></table>
21913
21914</section></div>
21915 </div>
21916</div>
21917
21918<div class='accordion'>
21919 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
21920 <div class='accordion-overflow'>
21921 <div class='accordion-content'><section >
21922
21923
21924
21925
21926<table><thead>
21927 <tr>
21928 <th>Event</th>
21929 <th>Data</th>
21930 <th>Description</th>
21931 </tr>
21932 </thead><tbody>
21933 <tr id='interactive-layer-tooltipopen'>
21934 <td><code><b>tooltipopen</b></code></td>
21935 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
21936 <td>Fired when a tooltip bound to this layer is opened.</td>
21937 </tr>
21938 <tr id='interactive-layer-tooltipclose'>
21939 <td><code><b>tooltipclose</b></code></td>
21940 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
21941 <td>Fired when a tooltip bound to this layer is closed.</td>
21942 </tr>
21943</tbody></table>
21944
21945</section></div>
21946 </div>
21947</div>
21948
21949</section><section>
21950<h3 id=''>Methods</h3>
21951
21952
21953
21954
21955<div class='accordion'>
21956 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
21957 <div class='accordion-overflow'>
21958 <div class='accordion-content'><section >
21959
21960
21961
21962
21963<table><thead>
21964 <tr>
21965 <th>Method</th>
21966 <th>Returns</th>
21967 <th>Description</th>
21968 </tr>
21969 </thead><tbody>
21970 <tr id='interactive-layer-addto'>
21971 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
21972 <td><code>this</code></td>
21973 <td><p>Adds the layer to the given map or layer group.</p>
21974</td>
21975 </tr>
21976 <tr id='interactive-layer-remove'>
21977 <td><code><b>remove</b>()</code></td>
21978 <td><code>this</code></td>
21979 <td><p>Removes the layer from the map it is currently active on.</p>
21980</td>
21981 </tr>
21982 <tr id='interactive-layer-removefrom'>
21983 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
21984 <td><code>this</code></td>
21985 <td><p>Removes the layer from the given map</p>
21986</td>
21987 </tr>
21988 <tr id='interactive-layer-removefrom'>
21989 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
21990 <td><code>this</code></td>
21991 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
21992</td>
21993 </tr>
21994 <tr id='interactive-layer-getpane'>
21995 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
21996 <td><code>HTMLElement</code></td>
21997 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
21998</td>
21999 </tr>
22000 <tr id='interactive-layer-getattribution'>
22001 <td><code><b>getAttribution</b>()</code></td>
22002 <td><code>String</code></td>
22003 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
22004</td>
22005 </tr>
22006</tbody></table>
22007
22008</section></div>
22009 </div>
22010</div>
22011
22012<div class='accordion'>
22013 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
22014 <div class='accordion-overflow'>
22015 <div class='accordion-content'><section >
22016
22017
22018
22019
22020<table><thead>
22021 <tr>
22022 <th>Method</th>
22023 <th>Returns</th>
22024 <th>Description</th>
22025 </tr>
22026 </thead><tbody>
22027 <tr id='interactive-layer-bindpopup'>
22028 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
22029 <td><code>this</code></td>
22030 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
22031necessary event listeners. If a <code>Function</code> is passed it will receive
22032the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
22033</td>
22034 </tr>
22035 <tr id='interactive-layer-unbindpopup'>
22036 <td><code><b>unbindPopup</b>()</code></td>
22037 <td><code>this</code></td>
22038 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
22039</td>
22040 </tr>
22041 <tr id='interactive-layer-openpopup'>
22042 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
22043 <td><code>this</code></td>
22044 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
22045</td>
22046 </tr>
22047 <tr id='interactive-layer-closepopup'>
22048 <td><code><b>closePopup</b>()</code></td>
22049 <td><code>this</code></td>
22050 <td><p>Closes the popup bound to this layer if it is open.</p>
22051</td>
22052 </tr>
22053 <tr id='interactive-layer-togglepopup'>
22054 <td><code><b>togglePopup</b>()</code></td>
22055 <td><code>this</code></td>
22056 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
22057</td>
22058 </tr>
22059 <tr id='interactive-layer-ispopupopen'>
22060 <td><code><b>isPopupOpen</b>()</code></td>
22061 <td><code>boolean</code></td>
22062 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
22063</td>
22064 </tr>
22065 <tr id='interactive-layer-setpopupcontent'>
22066 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
22067 <td><code>this</code></td>
22068 <td><p>Sets the content of the popup bound to this layer.</p>
22069</td>
22070 </tr>
22071 <tr id='interactive-layer-getpopup'>
22072 <td><code><b>getPopup</b>()</code></td>
22073 <td><code><a href='#popup'>Popup</a></code></td>
22074 <td><p>Returns the popup bound to this layer.</p>
22075</td>
22076 </tr>
22077</tbody></table>
22078
22079</section></div>
22080 </div>
22081</div>
22082
22083<div class='accordion'>
22084 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
22085 <div class='accordion-overflow'>
22086 <div class='accordion-content'><section >
22087
22088
22089
22090
22091<table><thead>
22092 <tr>
22093 <th>Method</th>
22094 <th>Returns</th>
22095 <th>Description</th>
22096 </tr>
22097 </thead><tbody>
22098 <tr id='interactive-layer-bindtooltip'>
22099 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
22100 <td><code>this</code></td>
22101 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
22102necessary event listeners. If a <code>Function</code> is passed it will receive
22103the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
22104</td>
22105 </tr>
22106 <tr id='interactive-layer-unbindtooltip'>
22107 <td><code><b>unbindTooltip</b>()</code></td>
22108 <td><code>this</code></td>
22109 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
22110</td>
22111 </tr>
22112 <tr id='interactive-layer-opentooltip'>
22113 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
22114 <td><code>this</code></td>
22115 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
22116</td>
22117 </tr>
22118 <tr id='interactive-layer-closetooltip'>
22119 <td><code><b>closeTooltip</b>()</code></td>
22120 <td><code>this</code></td>
22121 <td><p>Closes the tooltip bound to this layer if it is open.</p>
22122</td>
22123 </tr>
22124 <tr id='interactive-layer-toggletooltip'>
22125 <td><code><b>toggleTooltip</b>()</code></td>
22126 <td><code>this</code></td>
22127 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
22128</td>
22129 </tr>
22130 <tr id='interactive-layer-istooltipopen'>
22131 <td><code><b>isTooltipOpen</b>()</code></td>
22132 <td><code>boolean</code></td>
22133 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
22134</td>
22135 </tr>
22136 <tr id='interactive-layer-settooltipcontent'>
22137 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
22138 <td><code>this</code></td>
22139 <td><p>Sets the content of the tooltip bound to this layer.</p>
22140</td>
22141 </tr>
22142 <tr id='interactive-layer-gettooltip'>
22143 <td><code><b>getTooltip</b>()</code></td>
22144 <td><code><a href='#tooltip'>Tooltip</a></code></td>
22145 <td><p>Returns the tooltip bound to this layer.</p>
22146</td>
22147 </tr>
22148</tbody></table>
22149
22150</section></div>
22151 </div>
22152</div>
22153
22154<div class='accordion'>
22155 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
22156 <div class='accordion-overflow'>
22157 <div class='accordion-content'><section >
22158
22159
22160
22161
22162<table><thead>
22163 <tr>
22164 <th>Method</th>
22165 <th>Returns</th>
22166 <th>Description</th>
22167 </tr>
22168 </thead><tbody>
22169 <tr id='interactive-layer-on'>
22170 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
22171 <td><code>this</code></td>
22172 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
22173</td>
22174 </tr>
22175 <tr id='interactive-layer-on'>
22176 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
22177 <td><code>this</code></td>
22178 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
22179</td>
22180 </tr>
22181 <tr id='interactive-layer-off'>
22182 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
22183 <td><code>this</code></td>
22184 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
22185</td>
22186 </tr>
22187 <tr id='interactive-layer-off'>
22188 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
22189 <td><code>this</code></td>
22190 <td><p>Removes a set of type/listener pairs.</p>
22191</td>
22192 </tr>
22193 <tr id='interactive-layer-off'>
22194 <td><code><b>off</b>()</code></td>
22195 <td><code>this</code></td>
22196 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
22197</td>
22198 </tr>
22199 <tr id='interactive-layer-fire'>
22200 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
22201 <td><code>this</code></td>
22202 <td><p>Fires an event of the specified type. You can optionally provide an data
22203object — the first argument of the listener function will contain its
22204properties. The event can optionally be propagated to event parents.</p>
22205</td>
22206 </tr>
22207 <tr id='interactive-layer-listens'>
22208 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
22209 <td><code>Boolean</code></td>
22210 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
22211</td>
22212 </tr>
22213 <tr id='interactive-layer-once'>
22214 <td><code><b>once</b>(<i></i>)</code></td>
22215 <td><code>this</code></td>
22216 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
22217</td>
22218 </tr>
22219 <tr id='interactive-layer-addeventparent'>
22220 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
22221 <td><code>this</code></td>
22222 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
22223</td>
22224 </tr>
22225 <tr id='interactive-layer-removeeventparent'>
22226 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
22227 <td><code>this</code></td>
22228 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
22229</td>
22230 </tr>
22231 <tr id='interactive-layer-addeventlistener'>
22232 <td><code><b>addEventListener</b>(<i></i>)</code></td>
22233 <td><code>this</code></td>
22234 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
22235</td>
22236 </tr>
22237 <tr id='interactive-layer-removeeventlistener'>
22238 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
22239 <td><code>this</code></td>
22240 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
22241</td>
22242 </tr>
22243 <tr id='interactive-layer-clearalleventlisteners'>
22244 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
22245 <td><code>this</code></td>
22246 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
22247</td>
22248 </tr>
22249 <tr id='interactive-layer-addonetimeeventlistener'>
22250 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
22251 <td><code>this</code></td>
22252 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
22253</td>
22254 </tr>
22255 <tr id='interactive-layer-fireevent'>
22256 <td><code><b>fireEvent</b>(<i></i>)</code></td>
22257 <td><code>this</code></td>
22258 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
22259</td>
22260 </tr>
22261 <tr id='interactive-layer-haseventlisteners'>
22262 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
22263 <td><code>Boolean</code></td>
22264 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
22265</td>
22266 </tr>
22267</tbody></table>
22268
22269</section></div>
22270 </div>
22271</div>
22272
22273</section><h2 id='control'>Control</h2><p>L.Control is a base class for implementing map controls. Handles positioning.
22274All other controls extend from this class.</p>
22275
22276<section>
22277<h3 id='control-option'>Options</h3>
22278
22279<section >
22280
22281
22282
22283
22284<table><thead>
22285 <tr>
22286 <th>Option</th>
22287 <th>Type</th>
22288 <th>Default</th>
22289 <th>Description</th>
22290 </tr>
22291 </thead><tbody>
22292 <tr id='control-position'>
22293 <td><code><b>position</b></code></td>
22294 <td><code>String</code></td>
22295 <td><code>&#x27;topright&#x27;</code></td>
22296 <td>The position of the control (one of the map corners). Possible values are <code>&#39;topleft&#39;</code>,
22297<code>&#39;topright&#39;</code>, <code>&#39;bottomleft&#39;</code> or <code>&#39;bottomright&#39;</code></td>
22298 </tr>
22299</tbody></table>
22300
22301</section>
22302
22303
22304</section><section>
22305<h3 id='control-method'>Methods</h3>
22306
22307<section >
22308
22309
22310
22311<div class='section-comments'>Classes extending L.Control will inherit the following methods:</div>
22312
22313<table><thead>
22314 <tr>
22315 <th>Method</th>
22316 <th>Returns</th>
22317 <th>Description</th>
22318 </tr>
22319 </thead><tbody>
22320 <tr id='control-getposition'>
22321 <td><code><b>getPosition</b>()</code></td>
22322 <td><code>string</code></td>
22323 <td><p>Returns the position of the control.</p>
22324</td>
22325 </tr>
22326 <tr id='control-setposition'>
22327 <td><code><b>setPosition</b>(<nobr>&lt;string&gt;</nobr> <i>position</i>)</code></td>
22328 <td><code>this</code></td>
22329 <td><p>Sets the position of the control.</p>
22330</td>
22331 </tr>
22332 <tr id='control-getcontainer'>
22333 <td><code><b>getContainer</b>()</code></td>
22334 <td><code>HTMLElement</code></td>
22335 <td><p>Returns the HTMLElement that contains the control.</p>
22336</td>
22337 </tr>
22338 <tr id='control-addto'>
22339 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
22340 <td><code>this</code></td>
22341 <td><p>Adds the control to the given map.</p>
22342</td>
22343 </tr>
22344 <tr id='control-remove'>
22345 <td><code><b>remove</b>()</code></td>
22346 <td><code>this</code></td>
22347 <td><p>Removes the control from the map it is currently active on.</p>
22348</td>
22349 </tr>
22350</tbody></table>
22351
22352</section><section class='collapsable'>
22353
22354<h4 id='control-extension-methods'>Extension methods</h4>
22355
22356<div class='section-comments'>Every control should extend from <a href="#control"><code>L.Control</code></a> and (re-)implement the following methods.</div>
22357
22358<table><thead>
22359 <tr>
22360 <th>Method</th>
22361 <th>Returns</th>
22362 <th>Description</th>
22363 </tr>
22364 </thead><tbody>
22365 <tr id='control-onadd'>
22366 <td><code><b>onAdd</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
22367 <td><code>HTMLElement</code></td>
22368 <td><p>Should return the container DOM element for the control and add listeners on relevant map events. Called on <a href="#control-addTo"><code>control.addTo(map)</code></a>.</p>
22369</td>
22370 </tr>
22371 <tr id='control-onremove'>
22372 <td><code><b>onRemove</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
22373 <td><code></code></td>
22374 <td><p>Optional method. Should contain all clean up code that removes the listeners previously added in <a href="#control-onadd"><code>onAdd</code></a>. Called on <a href="#control-remove"><code>control.remove()</code></a>.</p>
22375</td>
22376 </tr>
22377</tbody></table>
22378
22379</section>
22380
22381
22382</section><h2 id='handler'>Handler</h2><p>Abstract class for map interaction handlers</p>
22383
22384<section>
22385<h3 id='handler-method'>Methods</h3>
22386
22387<section >
22388
22389
22390
22391
22392<table><thead>
22393 <tr>
22394 <th>Method</th>
22395 <th>Returns</th>
22396 <th>Description</th>
22397 </tr>
22398 </thead><tbody>
22399 <tr id='handler-enable'>
22400 <td><code><b>enable</b>()</code></td>
22401 <td><code>this</code></td>
22402 <td><p>Enables the handler</p>
22403</td>
22404 </tr>
22405 <tr id='handler-disable'>
22406 <td><code><b>disable</b>()</code></td>
22407 <td><code>this</code></td>
22408 <td><p>Disables the handler</p>
22409</td>
22410 </tr>
22411 <tr id='handler-enabled'>
22412 <td><code><b>enabled</b>()</code></td>
22413 <td><code>Boolean</code></td>
22414 <td><p>Returns <code>true</code> if the handler is enabled</p>
22415</td>
22416 </tr>
22417</tbody></table>
22418
22419</section><section class='collapsable'>
22420
22421<h4 id='handler-extension-methods'>Extension methods</h4>
22422
22423<div class='section-comments'>Classes inheriting from <a href="#handler"><code>Handler</code></a> must implement the two following methods:</div>
22424
22425<table><thead>
22426 <tr>
22427 <th>Method</th>
22428 <th>Returns</th>
22429 <th>Description</th>
22430 </tr>
22431 </thead><tbody>
22432 <tr id='handler-addhooks'>
22433 <td><code><b>addHooks</b>()</code></td>
22434 <td><code></code></td>
22435 <td><p>Called when the handler is enabled, should add event hooks.</p>
22436</td>
22437 </tr>
22438 <tr id='handler-removehooks'>
22439 <td><code><b>removeHooks</b>()</code></td>
22440 <td><code></code></td>
22441 <td><p>Called when the handler is disabled, should remove the event hooks added previously.</p>
22442</td>
22443 </tr>
22444</tbody></table>
22445
22446</section>
22447
22448
22449</section><section>
22450<h3 id='handler-function'>Functions</h3>
22451
22452<section class='collapsable'>
22453
22454<h4 id='handler-there-is-static-function-which-can-be-called-without-instantiating-l-handler:'>There is static function which can be called without instantiating L.Handler:</h4>
22455
22456
22457<table><thead>
22458 <tr>
22459 <th>Function</th>
22460 <th>Returns</th>
22461 <th>Description</th>
22462 </tr>
22463 </thead><tbody>
22464 <tr id='handler-addto'>
22465 <td><code><b>addTo</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>, <nobr>&lt;String&gt;</nobr> <i>name</i>)</code></td>
22466 <td><code>this</code></td>
22467 <td>Adds a new Handler to the given map with the given name.</td>
22468 </tr>
22469</tbody></table>
22470
22471</section>
22472
22473
22474</section><h2 id='projection'>Projection</h2><p>An object with methods for projecting geographical coordinates of the world onto
22475a flat surface (and back). See <a href="http://en.wikipedia.org/wiki/Map_projection">Map projection</a>.</p>
22476
22477<section>
22478<h3 id='projection-method'>Methods</h3>
22479
22480<section >
22481
22482
22483
22484
22485<table><thead>
22486 <tr>
22487 <th>Method</th>
22488 <th>Returns</th>
22489 <th>Description</th>
22490 </tr>
22491 </thead><tbody>
22492 <tr id='projection-project'>
22493 <td><code><b>project</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
22494 <td><code><a href='#point'>Point</a></code></td>
22495 <td><p>Projects geographical coordinates into a 2D point.
22496Only accepts actual <a href="#latlng"><code>L.LatLng</code></a> instances, not arrays.</p>
22497</td>
22498 </tr>
22499 <tr id='projection-unproject'>
22500 <td><code><b>unproject</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
22501 <td><code><a href='#latlng'>LatLng</a></code></td>
22502 <td><p>The inverse of <code>project</code>. Projects a 2D point into a geographical location.
22503Only accepts actual <a href="#point"><code>L.Point</code></a> instances, not arrays.
22504Note that the projection instances do not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
22505and can&#39;t be instantiated. Also, new classes can&#39;t inherit from them,
22506and methods can&#39;t be added to them with the <code>include</code> function.</p>
22507</td>
22508 </tr>
22509</tbody></table>
22510
22511</section>
22512
22513
22514</section><section>
22515<h3 id='projection-property'>Properties</h3>
22516
22517<section >
22518
22519
22520
22521
22522<table><thead>
22523 <tr>
22524 <th>Property</th>
22525 <th>Type</th>
22526 <th>Description</th>
22527 </tr>
22528 </thead><tbody>
22529 <tr id='projection-bounds'>
22530 <td><code><b>bounds</b></code></td>
22531 <td><code><a href='#bounds'>Bounds</a></code></td>
22532 <td>The bounds (specified in CRS units) where the projection is valid</td>
22533 </tr>
22534</tbody></table>
22535
22536</section>
22537
22538
22539</section><section>
22540<h3 id='projection-projection'>Defined projections</h3>
22541
22542<section >
22543
22544
22545
22546<div class='section-comments'>Leaflet comes with a set of already defined Projections out of the box:</div>
22547
22548<table><thead>
22549 <tr>
22550 <th>Projection</th>
22551 <th>Description</th>
22552 </tr>
22553 </thead><tbody>
22554 <tr id='projection-l-projection-lonlat'>
22555 <td><code><b>L.Projection.LonLat</b></code></td>
22556 <td>Equirectangular, or Plate Carree projection — the most simple projection,
22557mostly used by GIS enthusiasts. Directly maps <code>x</code> as longitude, and <code>y</code> as
22558latitude. Also suitable for flat worlds, e.g. game maps. Used by the
22559<code>EPSG:4326</code> and <code>Simple</code> CRS.</td>
22560 </tr>
22561 <tr id='projection-l-projection-mercator'>
22562 <td><code><b>L.Projection.Mercator</b></code></td>
22563 <td>Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.</td>
22564 </tr>
22565 <tr id='projection-l-projection-sphericalmercator'>
22566 <td><code><b>L.Projection.SphericalMercator</b></code></td>
22567 <td>Spherical Mercator projection — the most common projection for online maps,
22568used by almost all free and commercial tile providers. Assumes that Earth is
22569a sphere. Used by the <code>EPSG:3857</code> CRS.</td>
22570 </tr>
22571</tbody></table>
22572
22573</section>
22574
22575
22576</section><h2 id='crs'>CRS</h2>
22577<section>
22578<h3 id='crs-method'>Methods</h3>
22579
22580<section >
22581
22582
22583
22584
22585<table><thead>
22586 <tr>
22587 <th>Method</th>
22588 <th>Returns</th>
22589 <th>Description</th>
22590 </tr>
22591 </thead><tbody>
22592 <tr id='crs-latlngtopoint'>
22593 <td><code><b>latLngToPoint</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
22594 <td><code><a href='#point'>Point</a></code></td>
22595 <td><p>Projects geographical coordinates into pixel coordinates for a given zoom.</p>
22596</td>
22597 </tr>
22598 <tr id='crs-pointtolatlng'>
22599 <td><code><b>pointToLatLng</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>, <nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
22600 <td><code><a href='#latlng'>LatLng</a></code></td>
22601 <td><p>The inverse of <code>latLngToPoint</code>. Projects pixel coordinates on a given
22602zoom into geographical coordinates.</p>
22603</td>
22604 </tr>
22605 <tr id='crs-project'>
22606 <td><code><b>project</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
22607 <td><code><a href='#point'>Point</a></code></td>
22608 <td><p>Projects geographical coordinates into coordinates in units accepted for
22609this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).</p>
22610</td>
22611 </tr>
22612 <tr id='crs-unproject'>
22613 <td><code><b>unproject</b>(<nobr>&lt;<a href='#point'>Point</a>&gt;</nobr> <i>point</i>)</code></td>
22614 <td><code><a href='#latlng'>LatLng</a></code></td>
22615 <td><p>Given a projected coordinate returns the corresponding LatLng.
22616The inverse of <code>project</code>.</p>
22617</td>
22618 </tr>
22619 <tr id='crs-scale'>
22620 <td><code><b>scale</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
22621 <td><code>Number</code></td>
22622 <td><p>Returns the scale used when transforming projected coordinates into
22623pixel coordinates for a particular zoom. For example, it returns
22624<code>256 * 2^zoom</code> for Mercator-based CRS.</p>
22625</td>
22626 </tr>
22627 <tr id='crs-zoom'>
22628 <td><code><b>zoom</b>(<nobr>&lt;Number&gt;</nobr> <i>scale</i>)</code></td>
22629 <td><code>Number</code></td>
22630 <td><p>Inverse of <code>scale()</code>, returns the zoom level corresponding to a scale
22631factor of <code>scale</code>.</p>
22632</td>
22633 </tr>
22634 <tr id='crs-getprojectedbounds'>
22635 <td><code><b>getProjectedBounds</b>(<nobr>&lt;Number&gt;</nobr> <i>zoom</i>)</code></td>
22636 <td><code><a href='#bounds'>Bounds</a></code></td>
22637 <td><p>Returns the projection&#39;s bounds scaled and transformed for the provided <code>zoom</code>.</p>
22638</td>
22639 </tr>
22640 <tr id='crs-distance'>
22641 <td><code><b>distance</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng1</i>, <nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng2</i>)</code></td>
22642 <td><code>Number</code></td>
22643 <td><p>Returns the distance between two geographical coordinates.</p>
22644</td>
22645 </tr>
22646 <tr id='crs-wraplatlng'>
22647 <td><code><b>wrapLatLng</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng</i>)</code></td>
22648 <td><code><a href='#latlng'>LatLng</a></code></td>
22649 <td><p>Returns a <a href="#latlng"><code>LatLng</code></a> where lat and lng has been wrapped according to the
22650CRS&#39;s <code>wrapLat</code> and <code>wrapLng</code> properties, if they are outside the CRS&#39;s bounds.</p>
22651</td>
22652 </tr>
22653 <tr id='crs-wraplatlngbounds'>
22654 <td><code><b>wrapLatLngBounds</b>(<nobr>&lt;<a href='#latlngbounds'>LatLngBounds</a>&gt;</nobr> <i>bounds</i>)</code></td>
22655 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
22656 <td><p>Returns a <a href="#latlngbounds"><code>LatLngBounds</code></a> with the same size as the given one, ensuring
22657that its center is within the CRS&#39;s bounds.
22658Only accepts actual <a href="#latlngbounds"><code>L.LatLngBounds</code></a> instances, not arrays.</p>
22659</td>
22660 </tr>
22661</tbody></table>
22662
22663</section>
22664
22665
22666</section><section>
22667<h3 id='crs-property'>Properties</h3>
22668
22669<section >
22670
22671
22672
22673
22674<table><thead>
22675 <tr>
22676 <th>Property</th>
22677 <th>Type</th>
22678 <th>Description</th>
22679 </tr>
22680 </thead><tbody>
22681 <tr id='crs-code'>
22682 <td><code><b>code</b></code></td>
22683 <td><code>String</code></td>
22684 <td>Standard code name of the CRS passed into WMS services (e.g. <code>&#39;EPSG:3857&#39;</code>)</td>
22685 </tr>
22686 <tr id='crs-wraplng'>
22687 <td><code><b>wrapLng</b></code></td>
22688 <td><code>Number[]</code></td>
22689 <td>An array of two numbers defining whether the longitude (horizontal) coordinate
22690axis wraps around a given range and how. Defaults to <code>[-180, 180]</code> in most
22691geographical CRSs. If <code>undefined</code>, the longitude axis does not wrap around.</td>
22692 </tr>
22693 <tr id='crs-wraplat'>
22694 <td><code><b>wrapLat</b></code></td>
22695 <td><code>Number[]</code></td>
22696 <td>Like <code>wrapLng</code>, but for the latitude (vertical) axis.</td>
22697 </tr>
22698 <tr id='crs-infinite'>
22699 <td><code><b>infinite</b></code></td>
22700 <td><code>Boolean</code></td>
22701 <td>If true, the coordinate space will be unbounded (infinite in both axes)</td>
22702 </tr>
22703</tbody></table>
22704
22705</section>
22706
22707
22708</section><section>
22709<h3 id='crs-crs'>Defined CRSs</h3>
22710
22711<section >
22712
22713
22714
22715
22716<table><thead>
22717 <tr>
22718 <th>CRS</th>
22719 <th>Description</th>
22720 </tr>
22721 </thead><tbody>
22722 <tr id='crs-l-crs-epsg3395'>
22723 <td><code><b>L.CRS.EPSG3395</b></code></td>
22724 <td>Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.</td>
22725 </tr>
22726 <tr id='crs-l-crs-epsg3857'>
22727 <td><code><b>L.CRS.EPSG3857</b></code></td>
22728 <td>The most common CRS for online maps, used by almost all free and commercial
22729tile providers. Uses Spherical Mercator projection. Set in by default in
22730Map&#39;s <a href="#crs"><code>crs</code></a> option.</td>
22731 </tr>
22732 <tr id='crs-l-crs-epsg4326'>
22733 <td><code><b>L.CRS.EPSG4326</b></code></td>
22734 <td>A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
22735Leaflet 1.0.x complies with the <a href="https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic">TMS coordinate scheme for EPSG:4326</a>,
22736which is a breaking change from 0.7.x behaviour. If you are using a <a href="#tilelayer"><code>TileLayer</code></a>
22737with this CRS, ensure that there are two 256x256 pixel tiles covering the
22738whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
22739or (-180,-90) for <code>TileLayer</code>s with <a href="#tilelayer-tms">the <code>tms</code> option</a> set.</td>
22740 </tr>
22741 <tr id='crs-l-crs-earth'>
22742 <td><code><b>L.CRS.Earth</b></code></td>
22743 <td>Serves as the base for CRS that are global such that they cover the earth.
22744Can only be used as the base for other CRS and cannot be used directly,
22745since it does not have a <code>code</code>, <a href="#projection"><code>projection</code></a> or <a href="#transformation"><code>transformation</code></a>. <code>distance()</code> returns
22746meters.</td>
22747 </tr>
22748 <tr id='crs-l-crs-simple'>
22749 <td><code><b>L.CRS.Simple</b></code></td>
22750 <td>A simple CRS that maps longitude and latitude into <code>x</code> and <code>y</code> directly.
22751May be used for maps of flat surfaces (e.g. game maps). Note that the <code>y</code>
22752axis should still be inverted (going from bottom to top). <code>distance()</code> returns
22753simple euclidean distance.</td>
22754 </tr>
22755 <tr id='crs-l-crs-base'>
22756 <td><code><b>L.CRS.Base</b></code></td>
22757 <td>Object that defines coordinate reference systems for projecting
22758geographical points into pixel (screen) coordinates and back (and to
22759coordinates in other units for <a href="https://en.wikipedia.org/wiki/Web_Map_Service">WMS</a> services). See
22760<a href="http://en.wikipedia.org/wiki/Coordinate_reference_system">spatial reference system</a>.
22761Leaflet defines the most usual CRSs by default. If you want to use a
22762CRS not defined by default, take a look at the
22763<a href="https://github.com/kartena/Proj4Leaflet">Proj4Leaflet</a> plugin.
22764Note that the CRS instances do not inherit from Leaflet&#39;s <a href="#class"><code>Class</code></a> object,
22765and can&#39;t be instantiated. Also, new classes can&#39;t inherit from them,
22766and methods can&#39;t be added to them with the <code>include</code> function.</td>
22767 </tr>
22768</tbody></table>
22769
22770</section>
22771
22772
22773</section><h2 id='renderer'>Renderer</h2><p>Base class for vector renderer implementations (<a href="#svg"><code>SVG</code></a>, <a href="#canvas"><code>Canvas</code></a>). Handles the
22774DOM container of the renderer, its bounds, and its zoom animation.
22775A <a href="#renderer"><code>Renderer</code></a> works as an implicit layer group for all <a href="#path"><code>Path</code></a>s - the renderer
22776itself can be added or removed to the map. All paths use a renderer, which can
22777be implicit (the map will decide the type of renderer and use it automatically)
22778or explicit (using the <a href="#path-renderer"><a href="#renderer"><code>renderer</code></a></a> option of the path).
22779Do not use this class directly, use <code>SVG</code> and <code>Canvas</code> instead.</p>
22780
22781<section>
22782<h3 id='renderer-option'>Options</h3>
22783
22784<section >
22785
22786
22787
22788
22789<table><thead>
22790 <tr>
22791 <th>Option</th>
22792 <th>Type</th>
22793 <th>Default</th>
22794 <th>Description</th>
22795 </tr>
22796 </thead><tbody>
22797 <tr id='renderer-padding'>
22798 <td><code><b>padding</b></code></td>
22799 <td><code>Number</code></td>
22800 <td><code>0.1</code></td>
22801 <td>How much to extend the clip area around the map view (relative to its size)
22802e.g. 0.1 would be 10% of map view in each direction</td>
22803 </tr>
22804 <tr id='renderer-tolerance'>
22805 <td><code><b>tolerance</b></code></td>
22806 <td><code>Number</code></td>
22807 <td><code>0</code></td>
22808 <td>How much to extend click tolerance round a path/object on the map</td>
22809 </tr>
22810</tbody></table>
22811
22812</section>
22813
22814
22815<div class='accordion'>
22816 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
22817 <div class='accordion-overflow'>
22818 <div class='accordion-content'><section >
22819
22820
22821
22822
22823<table><thead>
22824 <tr>
22825 <th>Option</th>
22826 <th>Type</th>
22827 <th>Default</th>
22828 <th>Description</th>
22829 </tr>
22830 </thead><tbody>
22831 <tr id='renderer-pane'>
22832 <td><code><b>pane</b></code></td>
22833 <td><code>String</code></td>
22834 <td><code>&#x27;overlayPane&#x27;</code></td>
22835 <td>By default the layer will be added to the map&#39;s <a href="#map-overlaypane">overlay pane</a>. Overriding this option will cause the layer to be placed on another pane by default.</td>
22836 </tr>
22837 <tr id='renderer-attribution'>
22838 <td><code><b>attribution</b></code></td>
22839 <td><code>String</code></td>
22840 <td><code>null</code></td>
22841 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
22842 </tr>
22843</tbody></table>
22844
22845</section></div>
22846 </div>
22847</div>
22848
22849</section><section>
22850<h3 id='renderer-event'>Events</h3>
22851
22852<section >
22853
22854
22855
22856
22857<table><thead>
22858 <tr>
22859 <th>Event</th>
22860 <th>Data</th>
22861 <th>Description</th>
22862 </tr>
22863 </thead><tbody>
22864 <tr id='renderer-update'>
22865 <td><code><b>update</b></code></td>
22866 <td><code><a href='#event'>Event</a></code></td>
22867 <td>Fired when the renderer updates its bounds, center and zoom, for example when
22868its map has moved</td>
22869 </tr>
22870</tbody></table>
22871
22872</section>
22873
22874
22875<div class='accordion'>
22876 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
22877 <div class='accordion-overflow'>
22878 <div class='accordion-content'><section >
22879
22880
22881
22882
22883<table><thead>
22884 <tr>
22885 <th>Event</th>
22886 <th>Data</th>
22887 <th>Description</th>
22888 </tr>
22889 </thead><tbody>
22890 <tr id='renderer-add'>
22891 <td><code><b>add</b></code></td>
22892 <td><code><a href='#event'>Event</a></code></td>
22893 <td>Fired after the layer is added to a map</td>
22894 </tr>
22895 <tr id='renderer-remove'>
22896 <td><code><b>remove</b></code></td>
22897 <td><code><a href='#event'>Event</a></code></td>
22898 <td>Fired after the layer is removed from a map</td>
22899 </tr>
22900</tbody></table>
22901
22902</section></div>
22903 </div>
22904</div>
22905
22906<div class='accordion'>
22907 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
22908 <div class='accordion-overflow'>
22909 <div class='accordion-content'><section >
22910
22911
22912
22913
22914<table><thead>
22915 <tr>
22916 <th>Event</th>
22917 <th>Data</th>
22918 <th>Description</th>
22919 </tr>
22920 </thead><tbody>
22921 <tr id='renderer-popupopen'>
22922 <td><code><b>popupopen</b></code></td>
22923 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
22924 <td>Fired when a popup bound to this layer is opened</td>
22925 </tr>
22926 <tr id='renderer-popupclose'>
22927 <td><code><b>popupclose</b></code></td>
22928 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
22929 <td>Fired when a popup bound to this layer is closed</td>
22930 </tr>
22931</tbody></table>
22932
22933</section></div>
22934 </div>
22935</div>
22936
22937<div class='accordion'>
22938 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
22939 <div class='accordion-overflow'>
22940 <div class='accordion-content'><section >
22941
22942
22943
22944
22945<table><thead>
22946 <tr>
22947 <th>Event</th>
22948 <th>Data</th>
22949 <th>Description</th>
22950 </tr>
22951 </thead><tbody>
22952 <tr id='renderer-tooltipopen'>
22953 <td><code><b>tooltipopen</b></code></td>
22954 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
22955 <td>Fired when a tooltip bound to this layer is opened.</td>
22956 </tr>
22957 <tr id='renderer-tooltipclose'>
22958 <td><code><b>tooltipclose</b></code></td>
22959 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
22960 <td>Fired when a tooltip bound to this layer is closed.</td>
22961 </tr>
22962</tbody></table>
22963
22964</section></div>
22965 </div>
22966</div>
22967
22968</section><section>
22969<h3 id=''>Methods</h3>
22970
22971
22972
22973
22974<div class='accordion'>
22975 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
22976 <div class='accordion-overflow'>
22977 <div class='accordion-content'><section >
22978
22979
22980
22981
22982<table><thead>
22983 <tr>
22984 <th>Method</th>
22985 <th>Returns</th>
22986 <th>Description</th>
22987 </tr>
22988 </thead><tbody>
22989 <tr id='renderer-addto'>
22990 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
22991 <td><code>this</code></td>
22992 <td><p>Adds the layer to the given map or layer group.</p>
22993</td>
22994 </tr>
22995 <tr id='renderer-remove'>
22996 <td><code><b>remove</b>()</code></td>
22997 <td><code>this</code></td>
22998 <td><p>Removes the layer from the map it is currently active on.</p>
22999</td>
23000 </tr>
23001 <tr id='renderer-removefrom'>
23002 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
23003 <td><code>this</code></td>
23004 <td><p>Removes the layer from the given map</p>
23005</td>
23006 </tr>
23007 <tr id='renderer-removefrom'>
23008 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
23009 <td><code>this</code></td>
23010 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
23011</td>
23012 </tr>
23013 <tr id='renderer-getpane'>
23014 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
23015 <td><code>HTMLElement</code></td>
23016 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
23017</td>
23018 </tr>
23019 <tr id='renderer-getattribution'>
23020 <td><code><b>getAttribution</b>()</code></td>
23021 <td><code>String</code></td>
23022 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
23023</td>
23024 </tr>
23025</tbody></table>
23026
23027</section></div>
23028 </div>
23029</div>
23030
23031<div class='accordion'>
23032 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
23033 <div class='accordion-overflow'>
23034 <div class='accordion-content'><section >
23035
23036
23037
23038
23039<table><thead>
23040 <tr>
23041 <th>Method</th>
23042 <th>Returns</th>
23043 <th>Description</th>
23044 </tr>
23045 </thead><tbody>
23046 <tr id='renderer-bindpopup'>
23047 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
23048 <td><code>this</code></td>
23049 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
23050necessary event listeners. If a <code>Function</code> is passed it will receive
23051the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
23052</td>
23053 </tr>
23054 <tr id='renderer-unbindpopup'>
23055 <td><code><b>unbindPopup</b>()</code></td>
23056 <td><code>this</code></td>
23057 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
23058</td>
23059 </tr>
23060 <tr id='renderer-openpopup'>
23061 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
23062 <td><code>this</code></td>
23063 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
23064</td>
23065 </tr>
23066 <tr id='renderer-closepopup'>
23067 <td><code><b>closePopup</b>()</code></td>
23068 <td><code>this</code></td>
23069 <td><p>Closes the popup bound to this layer if it is open.</p>
23070</td>
23071 </tr>
23072 <tr id='renderer-togglepopup'>
23073 <td><code><b>togglePopup</b>()</code></td>
23074 <td><code>this</code></td>
23075 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
23076</td>
23077 </tr>
23078 <tr id='renderer-ispopupopen'>
23079 <td><code><b>isPopupOpen</b>()</code></td>
23080 <td><code>boolean</code></td>
23081 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
23082</td>
23083 </tr>
23084 <tr id='renderer-setpopupcontent'>
23085 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
23086 <td><code>this</code></td>
23087 <td><p>Sets the content of the popup bound to this layer.</p>
23088</td>
23089 </tr>
23090 <tr id='renderer-getpopup'>
23091 <td><code><b>getPopup</b>()</code></td>
23092 <td><code><a href='#popup'>Popup</a></code></td>
23093 <td><p>Returns the popup bound to this layer.</p>
23094</td>
23095 </tr>
23096</tbody></table>
23097
23098</section></div>
23099 </div>
23100</div>
23101
23102<div class='accordion'>
23103 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
23104 <div class='accordion-overflow'>
23105 <div class='accordion-content'><section >
23106
23107
23108
23109
23110<table><thead>
23111 <tr>
23112 <th>Method</th>
23113 <th>Returns</th>
23114 <th>Description</th>
23115 </tr>
23116 </thead><tbody>
23117 <tr id='renderer-bindtooltip'>
23118 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
23119 <td><code>this</code></td>
23120 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
23121necessary event listeners. If a <code>Function</code> is passed it will receive
23122the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
23123</td>
23124 </tr>
23125 <tr id='renderer-unbindtooltip'>
23126 <td><code><b>unbindTooltip</b>()</code></td>
23127 <td><code>this</code></td>
23128 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
23129</td>
23130 </tr>
23131 <tr id='renderer-opentooltip'>
23132 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
23133 <td><code>this</code></td>
23134 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
23135</td>
23136 </tr>
23137 <tr id='renderer-closetooltip'>
23138 <td><code><b>closeTooltip</b>()</code></td>
23139 <td><code>this</code></td>
23140 <td><p>Closes the tooltip bound to this layer if it is open.</p>
23141</td>
23142 </tr>
23143 <tr id='renderer-toggletooltip'>
23144 <td><code><b>toggleTooltip</b>()</code></td>
23145 <td><code>this</code></td>
23146 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
23147</td>
23148 </tr>
23149 <tr id='renderer-istooltipopen'>
23150 <td><code><b>isTooltipOpen</b>()</code></td>
23151 <td><code>boolean</code></td>
23152 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
23153</td>
23154 </tr>
23155 <tr id='renderer-settooltipcontent'>
23156 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
23157 <td><code>this</code></td>
23158 <td><p>Sets the content of the tooltip bound to this layer.</p>
23159</td>
23160 </tr>
23161 <tr id='renderer-gettooltip'>
23162 <td><code><b>getTooltip</b>()</code></td>
23163 <td><code><a href='#tooltip'>Tooltip</a></code></td>
23164 <td><p>Returns the tooltip bound to this layer.</p>
23165</td>
23166 </tr>
23167</tbody></table>
23168
23169</section></div>
23170 </div>
23171</div>
23172
23173<div class='accordion'>
23174 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
23175 <div class='accordion-overflow'>
23176 <div class='accordion-content'><section >
23177
23178
23179
23180
23181<table><thead>
23182 <tr>
23183 <th>Method</th>
23184 <th>Returns</th>
23185 <th>Description</th>
23186 </tr>
23187 </thead><tbody>
23188 <tr id='renderer-on'>
23189 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
23190 <td><code>this</code></td>
23191 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
23192</td>
23193 </tr>
23194 <tr id='renderer-on'>
23195 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
23196 <td><code>this</code></td>
23197 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
23198</td>
23199 </tr>
23200 <tr id='renderer-off'>
23201 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
23202 <td><code>this</code></td>
23203 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
23204</td>
23205 </tr>
23206 <tr id='renderer-off'>
23207 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
23208 <td><code>this</code></td>
23209 <td><p>Removes a set of type/listener pairs.</p>
23210</td>
23211 </tr>
23212 <tr id='renderer-off'>
23213 <td><code><b>off</b>()</code></td>
23214 <td><code>this</code></td>
23215 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
23216</td>
23217 </tr>
23218 <tr id='renderer-fire'>
23219 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
23220 <td><code>this</code></td>
23221 <td><p>Fires an event of the specified type. You can optionally provide an data
23222object — the first argument of the listener function will contain its
23223properties. The event can optionally be propagated to event parents.</p>
23224</td>
23225 </tr>
23226 <tr id='renderer-listens'>
23227 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
23228 <td><code>Boolean</code></td>
23229 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
23230</td>
23231 </tr>
23232 <tr id='renderer-once'>
23233 <td><code><b>once</b>(<i></i>)</code></td>
23234 <td><code>this</code></td>
23235 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
23236</td>
23237 </tr>
23238 <tr id='renderer-addeventparent'>
23239 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
23240 <td><code>this</code></td>
23241 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
23242</td>
23243 </tr>
23244 <tr id='renderer-removeeventparent'>
23245 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
23246 <td><code>this</code></td>
23247 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
23248</td>
23249 </tr>
23250 <tr id='renderer-addeventlistener'>
23251 <td><code><b>addEventListener</b>(<i></i>)</code></td>
23252 <td><code>this</code></td>
23253 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
23254</td>
23255 </tr>
23256 <tr id='renderer-removeeventlistener'>
23257 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
23258 <td><code>this</code></td>
23259 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
23260</td>
23261 </tr>
23262 <tr id='renderer-clearalleventlisteners'>
23263 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
23264 <td><code>this</code></td>
23265 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
23266</td>
23267 </tr>
23268 <tr id='renderer-addonetimeeventlistener'>
23269 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
23270 <td><code>this</code></td>
23271 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
23272</td>
23273 </tr>
23274 <tr id='renderer-fireevent'>
23275 <td><code><b>fireEvent</b>(<i></i>)</code></td>
23276 <td><code>this</code></td>
23277 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
23278</td>
23279 </tr>
23280 <tr id='renderer-haseventlisteners'>
23281 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
23282 <td><code>Boolean</code></td>
23283 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
23284</td>
23285 </tr>
23286</tbody></table>
23287
23288</section></div>
23289 </div>
23290</div>
23291
23292</section><h2 id='event-objects'>Event objects</h2><p>Whenever a class inheriting from <a href="#evented"><code>Evented</code></a> fires an event, a listener function
23293will be called with an event argument, which is a plain object containing
23294information about the event. For example:</p>
23295<pre><code class="lang-js">map.on(&#39;click&#39;, function(ev) {
23296 alert(ev.latlng); // ev is an event object (MouseEvent in this case)
23297});
23298</code></pre>
23299<p>The information available depends on the event type:</p>
23300
23301<span id='event'></span>
23302
23303<section>
23304<h3 id='event-property'>Event</h3>
23305
23306<section >
23307
23308
23309
23310<div class='section-comments'>The base event object. All other event objects contain these properties too.</div>
23311
23312<table><thead>
23313 <tr>
23314 <th>Property</th>
23315 <th>Type</th>
23316 <th>Description</th>
23317 </tr>
23318 </thead><tbody>
23319 <tr id='event-type'>
23320 <td><code><b>type</b></code></td>
23321 <td><code>String</code></td>
23322 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23323 </tr>
23324 <tr id='event-target'>
23325 <td><code><b>target</b></code></td>
23326 <td><code>Object</code></td>
23327 <td>The object that fired the event. For propagated events, the last object in
23328the propagation chain that fired the event.</td>
23329 </tr>
23330 <tr id='event-sourcetarget'>
23331 <td><code><b>sourceTarget</b></code></td>
23332 <td><code>Object</code></td>
23333 <td>The object that originally fired the event. For non-propagated events, this will
23334be the same as the <code>target</code>.</td>
23335 </tr>
23336 <tr id='event-propagatedfrom'>
23337 <td><code><b>propagatedFrom</b></code></td>
23338 <td><code>Object</code></td>
23339 <td>For propagated events, the last object that propagated the event to its
23340event parent.</td>
23341 </tr>
23342 <tr id='event-layer'>
23343 <td><code><b>layer</b></code></td>
23344 <td><code>Object</code></td>
23345 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23346 </tr>
23347</tbody></table>
23348
23349</section>
23350
23351
23352</section><span id='keyboardevent'></span>
23353
23354<section>
23355<h3 id='keyboardevent-property'>KeyboardEvent</h3>
23356
23357<section >
23358
23359
23360
23361
23362<table><thead>
23363 <tr>
23364 <th>Property</th>
23365 <th>Type</th>
23366 <th>Description</th>
23367 </tr>
23368 </thead><tbody>
23369 <tr id='keyboardevent-originalevent'>
23370 <td><code><b>originalEvent</b></code></td>
23371 <td><code>DOMEvent</code></td>
23372 <td>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent">DOM <a href="#keyboardevent"><code>KeyboardEvent</code></a></a> that triggered this Leaflet event.</td>
23373 </tr>
23374</tbody></table>
23375
23376</section>
23377
23378
23379<div class='accordion'>
23380 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23381 <div class='accordion-overflow'>
23382 <div class='accordion-content'><section >
23383
23384
23385
23386
23387<table><thead>
23388 <tr>
23389 <th>Property</th>
23390 <th>Type</th>
23391 <th>Description</th>
23392 </tr>
23393 </thead><tbody>
23394 <tr id='keyboardevent-type'>
23395 <td><code><b>type</b></code></td>
23396 <td><code>String</code></td>
23397 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23398 </tr>
23399 <tr id='keyboardevent-target'>
23400 <td><code><b>target</b></code></td>
23401 <td><code>Object</code></td>
23402 <td>The object that fired the event. For propagated events, the last object in
23403the propagation chain that fired the event.</td>
23404 </tr>
23405 <tr id='keyboardevent-sourcetarget'>
23406 <td><code><b>sourceTarget</b></code></td>
23407 <td><code>Object</code></td>
23408 <td>The object that originally fired the event. For non-propagated events, this will
23409be the same as the <code>target</code>.</td>
23410 </tr>
23411 <tr id='keyboardevent-propagatedfrom'>
23412 <td><code><b>propagatedFrom</b></code></td>
23413 <td><code>Object</code></td>
23414 <td>For propagated events, the last object that propagated the event to its
23415event parent.</td>
23416 </tr>
23417 <tr id='keyboardevent-layer'>
23418 <td><code><b>layer</b></code></td>
23419 <td><code>Object</code></td>
23420 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23421 </tr>
23422</tbody></table>
23423
23424</section></div>
23425 </div>
23426</div>
23427
23428</section><span id='mouseevent'></span>
23429
23430<section>
23431<h3 id='mouseevent-property'>MouseEvent</h3>
23432
23433<section >
23434
23435
23436
23437
23438<table><thead>
23439 <tr>
23440 <th>Property</th>
23441 <th>Type</th>
23442 <th>Description</th>
23443 </tr>
23444 </thead><tbody>
23445 <tr id='mouseevent-latlng'>
23446 <td><code><b>latlng</b></code></td>
23447 <td><code><a href='#latlng'>LatLng</a></code></td>
23448 <td>The geographical point where the mouse event occurred.</td>
23449 </tr>
23450 <tr id='mouseevent-layerpoint'>
23451 <td><code><b>layerPoint</b></code></td>
23452 <td><code><a href='#point'>Point</a></code></td>
23453 <td>Pixel coordinates of the point where the mouse event occurred relative to the map layer.</td>
23454 </tr>
23455 <tr id='mouseevent-containerpoint'>
23456 <td><code><b>containerPoint</b></code></td>
23457 <td><code><a href='#point'>Point</a></code></td>
23458 <td>Pixel coordinates of the point where the mouse event occurred relative to the map сontainer.</td>
23459 </tr>
23460 <tr id='mouseevent-originalevent'>
23461 <td><code><b>originalEvent</b></code></td>
23462 <td><code>DOMEvent</code></td>
23463 <td>The original <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent">DOM <a href="#mouseevent"><code>MouseEvent</code></a></a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent">DOM <code>TouchEvent</code></a> that triggered this Leaflet event.</td>
23464 </tr>
23465</tbody></table>
23466
23467</section>
23468
23469
23470<div class='accordion'>
23471 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23472 <div class='accordion-overflow'>
23473 <div class='accordion-content'><section >
23474
23475
23476
23477
23478<table><thead>
23479 <tr>
23480 <th>Property</th>
23481 <th>Type</th>
23482 <th>Description</th>
23483 </tr>
23484 </thead><tbody>
23485 <tr id='mouseevent-type'>
23486 <td><code><b>type</b></code></td>
23487 <td><code>String</code></td>
23488 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23489 </tr>
23490 <tr id='mouseevent-target'>
23491 <td><code><b>target</b></code></td>
23492 <td><code>Object</code></td>
23493 <td>The object that fired the event. For propagated events, the last object in
23494the propagation chain that fired the event.</td>
23495 </tr>
23496 <tr id='mouseevent-sourcetarget'>
23497 <td><code><b>sourceTarget</b></code></td>
23498 <td><code>Object</code></td>
23499 <td>The object that originally fired the event. For non-propagated events, this will
23500be the same as the <code>target</code>.</td>
23501 </tr>
23502 <tr id='mouseevent-propagatedfrom'>
23503 <td><code><b>propagatedFrom</b></code></td>
23504 <td><code>Object</code></td>
23505 <td>For propagated events, the last object that propagated the event to its
23506event parent.</td>
23507 </tr>
23508 <tr id='mouseevent-layer'>
23509 <td><code><b>layer</b></code></td>
23510 <td><code>Object</code></td>
23511 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23512 </tr>
23513</tbody></table>
23514
23515</section></div>
23516 </div>
23517</div>
23518
23519</section><span id='locationevent'></span>
23520
23521<section>
23522<h3 id='locationevent-property'>LocationEvent</h3>
23523
23524<section >
23525
23526
23527
23528
23529<table><thead>
23530 <tr>
23531 <th>Property</th>
23532 <th>Type</th>
23533 <th>Description</th>
23534 </tr>
23535 </thead><tbody>
23536 <tr id='locationevent-latlng'>
23537 <td><code><b>latlng</b></code></td>
23538 <td><code><a href='#latlng'>LatLng</a></code></td>
23539 <td>Detected geographical location of the user.</td>
23540 </tr>
23541 <tr id='locationevent-bounds'>
23542 <td><code><b>bounds</b></code></td>
23543 <td><code><a href='#latlngbounds'>LatLngBounds</a></code></td>
23544 <td>Geographical bounds of the area user is located in (with respect to the accuracy of location).</td>
23545 </tr>
23546 <tr id='locationevent-accuracy'>
23547 <td><code><b>accuracy</b></code></td>
23548 <td><code>Number</code></td>
23549 <td>Accuracy of location in meters.</td>
23550 </tr>
23551 <tr id='locationevent-altitude'>
23552 <td><code><b>altitude</b></code></td>
23553 <td><code>Number</code></td>
23554 <td>Height of the position above the WGS84 ellipsoid in meters.</td>
23555 </tr>
23556 <tr id='locationevent-altitudeaccuracy'>
23557 <td><code><b>altitudeAccuracy</b></code></td>
23558 <td><code>Number</code></td>
23559 <td>Accuracy of altitude in meters.</td>
23560 </tr>
23561 <tr id='locationevent-heading'>
23562 <td><code><b>heading</b></code></td>
23563 <td><code>Number</code></td>
23564 <td>The direction of travel in degrees counting clockwise from true North.</td>
23565 </tr>
23566 <tr id='locationevent-speed'>
23567 <td><code><b>speed</b></code></td>
23568 <td><code>Number</code></td>
23569 <td>Current velocity in meters per second.</td>
23570 </tr>
23571 <tr id='locationevent-timestamp'>
23572 <td><code><b>timestamp</b></code></td>
23573 <td><code>Number</code></td>
23574 <td>The time when the position was acquired.</td>
23575 </tr>
23576</tbody></table>
23577
23578</section>
23579
23580
23581<div class='accordion'>
23582 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23583 <div class='accordion-overflow'>
23584 <div class='accordion-content'><section >
23585
23586
23587
23588
23589<table><thead>
23590 <tr>
23591 <th>Property</th>
23592 <th>Type</th>
23593 <th>Description</th>
23594 </tr>
23595 </thead><tbody>
23596 <tr id='locationevent-type'>
23597 <td><code><b>type</b></code></td>
23598 <td><code>String</code></td>
23599 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23600 </tr>
23601 <tr id='locationevent-target'>
23602 <td><code><b>target</b></code></td>
23603 <td><code>Object</code></td>
23604 <td>The object that fired the event. For propagated events, the last object in
23605the propagation chain that fired the event.</td>
23606 </tr>
23607 <tr id='locationevent-sourcetarget'>
23608 <td><code><b>sourceTarget</b></code></td>
23609 <td><code>Object</code></td>
23610 <td>The object that originally fired the event. For non-propagated events, this will
23611be the same as the <code>target</code>.</td>
23612 </tr>
23613 <tr id='locationevent-propagatedfrom'>
23614 <td><code><b>propagatedFrom</b></code></td>
23615 <td><code>Object</code></td>
23616 <td>For propagated events, the last object that propagated the event to its
23617event parent.</td>
23618 </tr>
23619 <tr id='locationevent-layer'>
23620 <td><code><b>layer</b></code></td>
23621 <td><code>Object</code></td>
23622 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23623 </tr>
23624</tbody></table>
23625
23626</section></div>
23627 </div>
23628</div>
23629
23630</section><span id='errorevent'></span>
23631
23632<section>
23633<h3 id='errorevent-property'>ErrorEvent</h3>
23634
23635<section >
23636
23637
23638
23639
23640<table><thead>
23641 <tr>
23642 <th>Property</th>
23643 <th>Type</th>
23644 <th>Description</th>
23645 </tr>
23646 </thead><tbody>
23647 <tr id='errorevent-message'>
23648 <td><code><b>message</b></code></td>
23649 <td><code>String</code></td>
23650 <td>Error message.</td>
23651 </tr>
23652 <tr id='errorevent-code'>
23653 <td><code><b>code</b></code></td>
23654 <td><code>Number</code></td>
23655 <td>Error code (if applicable).</td>
23656 </tr>
23657</tbody></table>
23658
23659</section>
23660
23661
23662<div class='accordion'>
23663 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23664 <div class='accordion-overflow'>
23665 <div class='accordion-content'><section >
23666
23667
23668
23669
23670<table><thead>
23671 <tr>
23672 <th>Property</th>
23673 <th>Type</th>
23674 <th>Description</th>
23675 </tr>
23676 </thead><tbody>
23677 <tr id='errorevent-type'>
23678 <td><code><b>type</b></code></td>
23679 <td><code>String</code></td>
23680 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23681 </tr>
23682 <tr id='errorevent-target'>
23683 <td><code><b>target</b></code></td>
23684 <td><code>Object</code></td>
23685 <td>The object that fired the event. For propagated events, the last object in
23686the propagation chain that fired the event.</td>
23687 </tr>
23688 <tr id='errorevent-sourcetarget'>
23689 <td><code><b>sourceTarget</b></code></td>
23690 <td><code>Object</code></td>
23691 <td>The object that originally fired the event. For non-propagated events, this will
23692be the same as the <code>target</code>.</td>
23693 </tr>
23694 <tr id='errorevent-propagatedfrom'>
23695 <td><code><b>propagatedFrom</b></code></td>
23696 <td><code>Object</code></td>
23697 <td>For propagated events, the last object that propagated the event to its
23698event parent.</td>
23699 </tr>
23700 <tr id='errorevent-layer'>
23701 <td><code><b>layer</b></code></td>
23702 <td><code>Object</code></td>
23703 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23704 </tr>
23705</tbody></table>
23706
23707</section></div>
23708 </div>
23709</div>
23710
23711</section><span id='layerevent'></span>
23712
23713<section>
23714<h3 id='layerevent-property'>LayerEvent</h3>
23715
23716<section >
23717
23718
23719
23720
23721<table><thead>
23722 <tr>
23723 <th>Property</th>
23724 <th>Type</th>
23725 <th>Description</th>
23726 </tr>
23727 </thead><tbody>
23728 <tr id='layerevent-layer'>
23729 <td><code><b>layer</b></code></td>
23730 <td><code><a href='#layer'>Layer</a></code></td>
23731 <td>The layer that was added or removed.</td>
23732 </tr>
23733</tbody></table>
23734
23735</section>
23736
23737
23738<div class='accordion'>
23739 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23740 <div class='accordion-overflow'>
23741 <div class='accordion-content'><section >
23742
23743
23744
23745
23746<table><thead>
23747 <tr>
23748 <th>Property</th>
23749 <th>Type</th>
23750 <th>Description</th>
23751 </tr>
23752 </thead><tbody>
23753 <tr id='layerevent-type'>
23754 <td><code><b>type</b></code></td>
23755 <td><code>String</code></td>
23756 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23757 </tr>
23758 <tr id='layerevent-target'>
23759 <td><code><b>target</b></code></td>
23760 <td><code>Object</code></td>
23761 <td>The object that fired the event. For propagated events, the last object in
23762the propagation chain that fired the event.</td>
23763 </tr>
23764 <tr id='layerevent-sourcetarget'>
23765 <td><code><b>sourceTarget</b></code></td>
23766 <td><code>Object</code></td>
23767 <td>The object that originally fired the event. For non-propagated events, this will
23768be the same as the <code>target</code>.</td>
23769 </tr>
23770 <tr id='layerevent-propagatedfrom'>
23771 <td><code><b>propagatedFrom</b></code></td>
23772 <td><code>Object</code></td>
23773 <td>For propagated events, the last object that propagated the event to its
23774event parent.</td>
23775 </tr>
23776</tbody></table>
23777
23778</section></div>
23779 </div>
23780</div>
23781
23782</section><span id='layerscontrolevent'></span>
23783
23784<section>
23785<h3 id='layerscontrolevent-property'>LayersControlEvent</h3>
23786
23787<section >
23788
23789
23790
23791
23792<table><thead>
23793 <tr>
23794 <th>Property</th>
23795 <th>Type</th>
23796 <th>Description</th>
23797 </tr>
23798 </thead><tbody>
23799 <tr id='layerscontrolevent-layer'>
23800 <td><code><b>layer</b></code></td>
23801 <td><code><a href='#layer'>Layer</a></code></td>
23802 <td>The layer that was added or removed.</td>
23803 </tr>
23804 <tr id='layerscontrolevent-name'>
23805 <td><code><b>name</b></code></td>
23806 <td><code>String</code></td>
23807 <td>The name of the layer that was added or removed.</td>
23808 </tr>
23809</tbody></table>
23810
23811</section>
23812
23813
23814<div class='accordion'>
23815 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23816 <div class='accordion-overflow'>
23817 <div class='accordion-content'><section >
23818
23819
23820
23821
23822<table><thead>
23823 <tr>
23824 <th>Property</th>
23825 <th>Type</th>
23826 <th>Description</th>
23827 </tr>
23828 </thead><tbody>
23829 <tr id='layerscontrolevent-type'>
23830 <td><code><b>type</b></code></td>
23831 <td><code>String</code></td>
23832 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23833 </tr>
23834 <tr id='layerscontrolevent-target'>
23835 <td><code><b>target</b></code></td>
23836 <td><code>Object</code></td>
23837 <td>The object that fired the event. For propagated events, the last object in
23838the propagation chain that fired the event.</td>
23839 </tr>
23840 <tr id='layerscontrolevent-sourcetarget'>
23841 <td><code><b>sourceTarget</b></code></td>
23842 <td><code>Object</code></td>
23843 <td>The object that originally fired the event. For non-propagated events, this will
23844be the same as the <code>target</code>.</td>
23845 </tr>
23846 <tr id='layerscontrolevent-propagatedfrom'>
23847 <td><code><b>propagatedFrom</b></code></td>
23848 <td><code>Object</code></td>
23849 <td>For propagated events, the last object that propagated the event to its
23850event parent.</td>
23851 </tr>
23852</tbody></table>
23853
23854</section></div>
23855 </div>
23856</div>
23857
23858</section><span id='tileevent'></span>
23859
23860<section>
23861<h3 id='tileevent-property'>TileEvent</h3>
23862
23863<section >
23864
23865
23866
23867
23868<table><thead>
23869 <tr>
23870 <th>Property</th>
23871 <th>Type</th>
23872 <th>Description</th>
23873 </tr>
23874 </thead><tbody>
23875 <tr id='tileevent-tile'>
23876 <td><code><b>tile</b></code></td>
23877 <td><code>HTMLElement</code></td>
23878 <td>The tile element (image).</td>
23879 </tr>
23880 <tr id='tileevent-coords'>
23881 <td><code><b>coords</b></code></td>
23882 <td><code><a href='#point'>Point</a></code></td>
23883 <td>Point object with the tile&#39;s <code>x</code>, <code>y</code>, and <code>z</code> (zoom level) coordinates.</td>
23884 </tr>
23885</tbody></table>
23886
23887</section>
23888
23889
23890<div class='accordion'>
23891 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23892 <div class='accordion-overflow'>
23893 <div class='accordion-content'><section >
23894
23895
23896
23897
23898<table><thead>
23899 <tr>
23900 <th>Property</th>
23901 <th>Type</th>
23902 <th>Description</th>
23903 </tr>
23904 </thead><tbody>
23905 <tr id='tileevent-type'>
23906 <td><code><b>type</b></code></td>
23907 <td><code>String</code></td>
23908 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23909 </tr>
23910 <tr id='tileevent-target'>
23911 <td><code><b>target</b></code></td>
23912 <td><code>Object</code></td>
23913 <td>The object that fired the event. For propagated events, the last object in
23914the propagation chain that fired the event.</td>
23915 </tr>
23916 <tr id='tileevent-sourcetarget'>
23917 <td><code><b>sourceTarget</b></code></td>
23918 <td><code>Object</code></td>
23919 <td>The object that originally fired the event. For non-propagated events, this will
23920be the same as the <code>target</code>.</td>
23921 </tr>
23922 <tr id='tileevent-propagatedfrom'>
23923 <td><code><b>propagatedFrom</b></code></td>
23924 <td><code>Object</code></td>
23925 <td>For propagated events, the last object that propagated the event to its
23926event parent.</td>
23927 </tr>
23928 <tr id='tileevent-layer'>
23929 <td><code><b>layer</b></code></td>
23930 <td><code>Object</code></td>
23931 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
23932 </tr>
23933</tbody></table>
23934
23935</section></div>
23936 </div>
23937</div>
23938
23939</section><span id='tileerrorevent'></span>
23940
23941<section>
23942<h3 id='tileerrorevent-property'>TileErrorEvent</h3>
23943
23944<section >
23945
23946
23947
23948
23949<table><thead>
23950 <tr>
23951 <th>Property</th>
23952 <th>Type</th>
23953 <th>Description</th>
23954 </tr>
23955 </thead><tbody>
23956 <tr id='tileerrorevent-tile'>
23957 <td><code><b>tile</b></code></td>
23958 <td><code>HTMLElement</code></td>
23959 <td>The tile element (image).</td>
23960 </tr>
23961 <tr id='tileerrorevent-coords'>
23962 <td><code><b>coords</b></code></td>
23963 <td><code><a href='#point'>Point</a></code></td>
23964 <td>Point object with the tile&#39;s <code>x</code>, <code>y</code>, and <code>z</code> (zoom level) coordinates.</td>
23965 </tr>
23966 <tr id='tileerrorevent-error'>
23967 <td><code><b>error</b></code></td>
23968 <td><code>*</code></td>
23969 <td>Error passed to the tile&#39;s <code>done()</code> callback.</td>
23970 </tr>
23971</tbody></table>
23972
23973</section>
23974
23975
23976<div class='accordion'>
23977 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
23978 <div class='accordion-overflow'>
23979 <div class='accordion-content'><section >
23980
23981
23982
23983
23984<table><thead>
23985 <tr>
23986 <th>Property</th>
23987 <th>Type</th>
23988 <th>Description</th>
23989 </tr>
23990 </thead><tbody>
23991 <tr id='tileerrorevent-type'>
23992 <td><code><b>type</b></code></td>
23993 <td><code>String</code></td>
23994 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
23995 </tr>
23996 <tr id='tileerrorevent-target'>
23997 <td><code><b>target</b></code></td>
23998 <td><code>Object</code></td>
23999 <td>The object that fired the event. For propagated events, the last object in
24000the propagation chain that fired the event.</td>
24001 </tr>
24002 <tr id='tileerrorevent-sourcetarget'>
24003 <td><code><b>sourceTarget</b></code></td>
24004 <td><code>Object</code></td>
24005 <td>The object that originally fired the event. For non-propagated events, this will
24006be the same as the <code>target</code>.</td>
24007 </tr>
24008 <tr id='tileerrorevent-propagatedfrom'>
24009 <td><code><b>propagatedFrom</b></code></td>
24010 <td><code>Object</code></td>
24011 <td>For propagated events, the last object that propagated the event to its
24012event parent.</td>
24013 </tr>
24014 <tr id='tileerrorevent-layer'>
24015 <td><code><b>layer</b></code></td>
24016 <td><code>Object</code></td>
24017 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24018 </tr>
24019</tbody></table>
24020
24021</section></div>
24022 </div>
24023</div>
24024
24025</section><span id='resizeevent'></span>
24026
24027<section>
24028<h3 id='resizeevent-property'>ResizeEvent</h3>
24029
24030<section >
24031
24032
24033
24034
24035<table><thead>
24036 <tr>
24037 <th>Property</th>
24038 <th>Type</th>
24039 <th>Description</th>
24040 </tr>
24041 </thead><tbody>
24042 <tr id='resizeevent-oldsize'>
24043 <td><code><b>oldSize</b></code></td>
24044 <td><code><a href='#point'>Point</a></code></td>
24045 <td>The old size before resize event.</td>
24046 </tr>
24047 <tr id='resizeevent-newsize'>
24048 <td><code><b>newSize</b></code></td>
24049 <td><code><a href='#point'>Point</a></code></td>
24050 <td>The new size after the resize event.</td>
24051 </tr>
24052</tbody></table>
24053
24054</section>
24055
24056
24057<div class='accordion'>
24058 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24059 <div class='accordion-overflow'>
24060 <div class='accordion-content'><section >
24061
24062
24063
24064
24065<table><thead>
24066 <tr>
24067 <th>Property</th>
24068 <th>Type</th>
24069 <th>Description</th>
24070 </tr>
24071 </thead><tbody>
24072 <tr id='resizeevent-type'>
24073 <td><code><b>type</b></code></td>
24074 <td><code>String</code></td>
24075 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24076 </tr>
24077 <tr id='resizeevent-target'>
24078 <td><code><b>target</b></code></td>
24079 <td><code>Object</code></td>
24080 <td>The object that fired the event. For propagated events, the last object in
24081the propagation chain that fired the event.</td>
24082 </tr>
24083 <tr id='resizeevent-sourcetarget'>
24084 <td><code><b>sourceTarget</b></code></td>
24085 <td><code>Object</code></td>
24086 <td>The object that originally fired the event. For non-propagated events, this will
24087be the same as the <code>target</code>.</td>
24088 </tr>
24089 <tr id='resizeevent-propagatedfrom'>
24090 <td><code><b>propagatedFrom</b></code></td>
24091 <td><code>Object</code></td>
24092 <td>For propagated events, the last object that propagated the event to its
24093event parent.</td>
24094 </tr>
24095 <tr id='resizeevent-layer'>
24096 <td><code><b>layer</b></code></td>
24097 <td><code>Object</code></td>
24098 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24099 </tr>
24100</tbody></table>
24101
24102</section></div>
24103 </div>
24104</div>
24105
24106</section><span id='geojsonevent'></span>
24107
24108<section>
24109<h3 id='geojsonevent-property'>GeoJSONEvent</h3>
24110
24111<section >
24112
24113
24114
24115
24116<table><thead>
24117 <tr>
24118 <th>Property</th>
24119 <th>Type</th>
24120 <th>Description</th>
24121 </tr>
24122 </thead><tbody>
24123 <tr id='geojsonevent-layer'>
24124 <td><code><b>layer</b></code></td>
24125 <td><code><a href='#layer'>Layer</a></code></td>
24126 <td>The layer for the GeoJSON feature that is being added to the map.</td>
24127 </tr>
24128 <tr id='geojsonevent-properties'>
24129 <td><code><b>properties</b></code></td>
24130 <td><code>Object</code></td>
24131 <td>GeoJSON properties of the feature.</td>
24132 </tr>
24133 <tr id='geojsonevent-geometrytype'>
24134 <td><code><b>geometryType</b></code></td>
24135 <td><code>String</code></td>
24136 <td>GeoJSON geometry type of the feature.</td>
24137 </tr>
24138 <tr id='geojsonevent-id'>
24139 <td><code><b>id</b></code></td>
24140 <td><code>String</code></td>
24141 <td>GeoJSON ID of the feature (if present).</td>
24142 </tr>
24143</tbody></table>
24144
24145</section>
24146
24147
24148<div class='accordion'>
24149 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24150 <div class='accordion-overflow'>
24151 <div class='accordion-content'><section >
24152
24153
24154
24155
24156<table><thead>
24157 <tr>
24158 <th>Property</th>
24159 <th>Type</th>
24160 <th>Description</th>
24161 </tr>
24162 </thead><tbody>
24163 <tr id='geojsonevent-type'>
24164 <td><code><b>type</b></code></td>
24165 <td><code>String</code></td>
24166 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24167 </tr>
24168 <tr id='geojsonevent-target'>
24169 <td><code><b>target</b></code></td>
24170 <td><code>Object</code></td>
24171 <td>The object that fired the event. For propagated events, the last object in
24172the propagation chain that fired the event.</td>
24173 </tr>
24174 <tr id='geojsonevent-sourcetarget'>
24175 <td><code><b>sourceTarget</b></code></td>
24176 <td><code>Object</code></td>
24177 <td>The object that originally fired the event. For non-propagated events, this will
24178be the same as the <code>target</code>.</td>
24179 </tr>
24180 <tr id='geojsonevent-propagatedfrom'>
24181 <td><code><b>propagatedFrom</b></code></td>
24182 <td><code>Object</code></td>
24183 <td>For propagated events, the last object that propagated the event to its
24184event parent.</td>
24185 </tr>
24186</tbody></table>
24187
24188</section></div>
24189 </div>
24190</div>
24191
24192</section><span id='popupevent'></span>
24193
24194<section>
24195<h3 id='popupevent-property'>PopupEvent</h3>
24196
24197<section >
24198
24199
24200
24201
24202<table><thead>
24203 <tr>
24204 <th>Property</th>
24205 <th>Type</th>
24206 <th>Description</th>
24207 </tr>
24208 </thead><tbody>
24209 <tr id='popupevent-popup'>
24210 <td><code><b>popup</b></code></td>
24211 <td><code><a href='#popup'>Popup</a></code></td>
24212 <td>The popup that was opened or closed.</td>
24213 </tr>
24214</tbody></table>
24215
24216</section>
24217
24218
24219<div class='accordion'>
24220 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24221 <div class='accordion-overflow'>
24222 <div class='accordion-content'><section >
24223
24224
24225
24226
24227<table><thead>
24228 <tr>
24229 <th>Property</th>
24230 <th>Type</th>
24231 <th>Description</th>
24232 </tr>
24233 </thead><tbody>
24234 <tr id='popupevent-type'>
24235 <td><code><b>type</b></code></td>
24236 <td><code>String</code></td>
24237 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24238 </tr>
24239 <tr id='popupevent-target'>
24240 <td><code><b>target</b></code></td>
24241 <td><code>Object</code></td>
24242 <td>The object that fired the event. For propagated events, the last object in
24243the propagation chain that fired the event.</td>
24244 </tr>
24245 <tr id='popupevent-sourcetarget'>
24246 <td><code><b>sourceTarget</b></code></td>
24247 <td><code>Object</code></td>
24248 <td>The object that originally fired the event. For non-propagated events, this will
24249be the same as the <code>target</code>.</td>
24250 </tr>
24251 <tr id='popupevent-propagatedfrom'>
24252 <td><code><b>propagatedFrom</b></code></td>
24253 <td><code>Object</code></td>
24254 <td>For propagated events, the last object that propagated the event to its
24255event parent.</td>
24256 </tr>
24257 <tr id='popupevent-layer'>
24258 <td><code><b>layer</b></code></td>
24259 <td><code>Object</code></td>
24260 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24261 </tr>
24262</tbody></table>
24263
24264</section></div>
24265 </div>
24266</div>
24267
24268</section><span id='tooltipevent'></span>
24269
24270<section>
24271<h3 id='tooltipevent-property'>TooltipEvent</h3>
24272
24273<section >
24274
24275
24276
24277
24278<table><thead>
24279 <tr>
24280 <th>Property</th>
24281 <th>Type</th>
24282 <th>Description</th>
24283 </tr>
24284 </thead><tbody>
24285 <tr id='tooltipevent-tooltip'>
24286 <td><code><b>tooltip</b></code></td>
24287 <td><code><a href='#tooltip'>Tooltip</a></code></td>
24288 <td>The tooltip that was opened or closed.</td>
24289 </tr>
24290</tbody></table>
24291
24292</section>
24293
24294
24295<div class='accordion'>
24296 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24297 <div class='accordion-overflow'>
24298 <div class='accordion-content'><section >
24299
24300
24301
24302
24303<table><thead>
24304 <tr>
24305 <th>Property</th>
24306 <th>Type</th>
24307 <th>Description</th>
24308 </tr>
24309 </thead><tbody>
24310 <tr id='tooltipevent-type'>
24311 <td><code><b>type</b></code></td>
24312 <td><code>String</code></td>
24313 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24314 </tr>
24315 <tr id='tooltipevent-target'>
24316 <td><code><b>target</b></code></td>
24317 <td><code>Object</code></td>
24318 <td>The object that fired the event. For propagated events, the last object in
24319the propagation chain that fired the event.</td>
24320 </tr>
24321 <tr id='tooltipevent-sourcetarget'>
24322 <td><code><b>sourceTarget</b></code></td>
24323 <td><code>Object</code></td>
24324 <td>The object that originally fired the event. For non-propagated events, this will
24325be the same as the <code>target</code>.</td>
24326 </tr>
24327 <tr id='tooltipevent-propagatedfrom'>
24328 <td><code><b>propagatedFrom</b></code></td>
24329 <td><code>Object</code></td>
24330 <td>For propagated events, the last object that propagated the event to its
24331event parent.</td>
24332 </tr>
24333 <tr id='tooltipevent-layer'>
24334 <td><code><b>layer</b></code></td>
24335 <td><code>Object</code></td>
24336 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24337 </tr>
24338</tbody></table>
24339
24340</section></div>
24341 </div>
24342</div>
24343
24344</section><span id='dragendevent'></span>
24345
24346<section>
24347<h3 id='dragendevent-property'>DragEndEvent</h3>
24348
24349<section >
24350
24351
24352
24353
24354<table><thead>
24355 <tr>
24356 <th>Property</th>
24357 <th>Type</th>
24358 <th>Description</th>
24359 </tr>
24360 </thead><tbody>
24361 <tr id='dragendevent-distance'>
24362 <td><code><b>distance</b></code></td>
24363 <td><code>Number</code></td>
24364 <td>The distance in pixels the draggable element was moved by.</td>
24365 </tr>
24366</tbody></table>
24367
24368</section>
24369
24370
24371<div class='accordion'>
24372 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24373 <div class='accordion-overflow'>
24374 <div class='accordion-content'><section >
24375
24376
24377
24378
24379<table><thead>
24380 <tr>
24381 <th>Property</th>
24382 <th>Type</th>
24383 <th>Description</th>
24384 </tr>
24385 </thead><tbody>
24386 <tr id='dragendevent-type'>
24387 <td><code><b>type</b></code></td>
24388 <td><code>String</code></td>
24389 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24390 </tr>
24391 <tr id='dragendevent-target'>
24392 <td><code><b>target</b></code></td>
24393 <td><code>Object</code></td>
24394 <td>The object that fired the event. For propagated events, the last object in
24395the propagation chain that fired the event.</td>
24396 </tr>
24397 <tr id='dragendevent-sourcetarget'>
24398 <td><code><b>sourceTarget</b></code></td>
24399 <td><code>Object</code></td>
24400 <td>The object that originally fired the event. For non-propagated events, this will
24401be the same as the <code>target</code>.</td>
24402 </tr>
24403 <tr id='dragendevent-propagatedfrom'>
24404 <td><code><b>propagatedFrom</b></code></td>
24405 <td><code>Object</code></td>
24406 <td>For propagated events, the last object that propagated the event to its
24407event parent.</td>
24408 </tr>
24409 <tr id='dragendevent-layer'>
24410 <td><code><b>layer</b></code></td>
24411 <td><code>Object</code></td>
24412 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24413 </tr>
24414</tbody></table>
24415
24416</section></div>
24417 </div>
24418</div>
24419
24420</section><span id='zoomanimevent'></span>
24421
24422<section>
24423<h3 id='zoomanimevent-property'>ZoomAnimEvent</h3>
24424
24425<section >
24426
24427
24428
24429
24430<table><thead>
24431 <tr>
24432 <th>Property</th>
24433 <th>Type</th>
24434 <th>Description</th>
24435 </tr>
24436 </thead><tbody>
24437 <tr id='zoomanimevent-center'>
24438 <td><code><b>center</b></code></td>
24439 <td><code><a href='#latlng'>LatLng</a></code></td>
24440 <td>The current center of the map</td>
24441 </tr>
24442 <tr id='zoomanimevent-zoom'>
24443 <td><code><b>zoom</b></code></td>
24444 <td><code>Number</code></td>
24445 <td>The current zoom level of the map</td>
24446 </tr>
24447 <tr id='zoomanimevent-noupdate'>
24448 <td><code><b>noUpdate</b></code></td>
24449 <td><code>Boolean</code></td>
24450 <td>Whether layers should update their contents due to this event</td>
24451 </tr>
24452</tbody></table>
24453
24454</section>
24455
24456
24457<div class='accordion'>
24458 <label><span class='expander'></span> Properties inherited from <a href='#event'>Event</a></label>
24459 <div class='accordion-overflow'>
24460 <div class='accordion-content'><section >
24461
24462
24463
24464
24465<table><thead>
24466 <tr>
24467 <th>Property</th>
24468 <th>Type</th>
24469 <th>Description</th>
24470 </tr>
24471 </thead><tbody>
24472 <tr id='zoomanimevent-type'>
24473 <td><code><b>type</b></code></td>
24474 <td><code>String</code></td>
24475 <td>The event type (e.g. <code>&#39;click&#39;</code>).</td>
24476 </tr>
24477 <tr id='zoomanimevent-target'>
24478 <td><code><b>target</b></code></td>
24479 <td><code>Object</code></td>
24480 <td>The object that fired the event. For propagated events, the last object in
24481the propagation chain that fired the event.</td>
24482 </tr>
24483 <tr id='zoomanimevent-sourcetarget'>
24484 <td><code><b>sourceTarget</b></code></td>
24485 <td><code>Object</code></td>
24486 <td>The object that originally fired the event. For non-propagated events, this will
24487be the same as the <code>target</code>.</td>
24488 </tr>
24489 <tr id='zoomanimevent-propagatedfrom'>
24490 <td><code><b>propagatedFrom</b></code></td>
24491 <td><code>Object</code></td>
24492 <td>For propagated events, the last object that propagated the event to its
24493event parent.</td>
24494 </tr>
24495 <tr id='zoomanimevent-layer'>
24496 <td><code><b>layer</b></code></td>
24497 <td><code>Object</code></td>
24498 <td><strong>Deprecated.</strong> The same as <code>propagatedFrom</code>.</td>
24499 </tr>
24500</tbody></table>
24501
24502</section></div>
24503 </div>
24504</div>
24505
24506</section><h2 id='divoverlay'>DivOverlay</h2><p>Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.</p>
24507
24508<section>
24509<h3 id='divoverlay-option'>Options</h3>
24510
24511<section >
24512
24513
24514
24515
24516<table><thead>
24517 <tr>
24518 <th>Option</th>
24519 <th>Type</th>
24520 <th>Default</th>
24521 <th>Description</th>
24522 </tr>
24523 </thead><tbody>
24524 <tr id='divoverlay-offset'>
24525 <td><code><b>offset</b></code></td>
24526 <td><code><a href='#point'>Point</a></code></td>
24527 <td><code>Point(0, 7)</code></td>
24528 <td>The offset of the popup position. Useful to control the anchor
24529of the popup when opening it on some overlays.</td>
24530 </tr>
24531 <tr id='divoverlay-classname'>
24532 <td><code><b>className</b></code></td>
24533 <td><code>String</code></td>
24534 <td><code>&#x27;&#x27;</code></td>
24535 <td>A custom CSS class name to assign to the popup.</td>
24536 </tr>
24537 <tr id='divoverlay-pane'>
24538 <td><code><b>pane</b></code></td>
24539 <td><code>String</code></td>
24540 <td><code>&#x27;popupPane&#x27;</code></td>
24541 <td><code>Map pane</code> where the popup will be added.</td>
24542 </tr>
24543</tbody></table>
24544
24545</section>
24546
24547
24548<div class='accordion'>
24549 <label><span class='expander'></span> Options inherited from <a href='#layer'>Layer</a></label>
24550 <div class='accordion-overflow'>
24551 <div class='accordion-content'><section >
24552
24553
24554
24555
24556<table><thead>
24557 <tr>
24558 <th>Option</th>
24559 <th>Type</th>
24560 <th>Default</th>
24561 <th>Description</th>
24562 </tr>
24563 </thead><tbody>
24564 <tr id='divoverlay-attribution'>
24565 <td><code><b>attribution</b></code></td>
24566 <td><code>String</code></td>
24567 <td><code>null</code></td>
24568 <td>String to be shown in the attribution control, e.g. &quot;© OpenStreetMap contributors&quot;. It describes the layer data and is often a legal obligation towards copyright holders and tile providers.</td>
24569 </tr>
24570</tbody></table>
24571
24572</section></div>
24573 </div>
24574</div>
24575
24576</section><section>
24577<h3 id=''>Events</h3>
24578
24579
24580
24581
24582<div class='accordion'>
24583 <label><span class='expander'></span> Events inherited from <a href='#layer'>Layer</a></label>
24584 <div class='accordion-overflow'>
24585 <div class='accordion-content'><section >
24586
24587
24588
24589
24590<table><thead>
24591 <tr>
24592 <th>Event</th>
24593 <th>Data</th>
24594 <th>Description</th>
24595 </tr>
24596 </thead><tbody>
24597 <tr id='divoverlay-add'>
24598 <td><code><b>add</b></code></td>
24599 <td><code><a href='#event'>Event</a></code></td>
24600 <td>Fired after the layer is added to a map</td>
24601 </tr>
24602 <tr id='divoverlay-remove'>
24603 <td><code><b>remove</b></code></td>
24604 <td><code><a href='#event'>Event</a></code></td>
24605 <td>Fired after the layer is removed from a map</td>
24606 </tr>
24607</tbody></table>
24608
24609</section></div>
24610 </div>
24611</div>
24612
24613<div class='accordion'>
24614 <label><span class='expander'></span> Popup events inherited from <a href='#layer'>Layer</a></label>
24615 <div class='accordion-overflow'>
24616 <div class='accordion-content'><section >
24617
24618
24619
24620
24621<table><thead>
24622 <tr>
24623 <th>Event</th>
24624 <th>Data</th>
24625 <th>Description</th>
24626 </tr>
24627 </thead><tbody>
24628 <tr id='divoverlay-popupopen'>
24629 <td><code><b>popupopen</b></code></td>
24630 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
24631 <td>Fired when a popup bound to this layer is opened</td>
24632 </tr>
24633 <tr id='divoverlay-popupclose'>
24634 <td><code><b>popupclose</b></code></td>
24635 <td><code><a href='#popupevent'>PopupEvent</a></code></td>
24636 <td>Fired when a popup bound to this layer is closed</td>
24637 </tr>
24638</tbody></table>
24639
24640</section></div>
24641 </div>
24642</div>
24643
24644<div class='accordion'>
24645 <label><span class='expander'></span> Tooltip events inherited from <a href='#layer'>Layer</a></label>
24646 <div class='accordion-overflow'>
24647 <div class='accordion-content'><section >
24648
24649
24650
24651
24652<table><thead>
24653 <tr>
24654 <th>Event</th>
24655 <th>Data</th>
24656 <th>Description</th>
24657 </tr>
24658 </thead><tbody>
24659 <tr id='divoverlay-tooltipopen'>
24660 <td><code><b>tooltipopen</b></code></td>
24661 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
24662 <td>Fired when a tooltip bound to this layer is opened.</td>
24663 </tr>
24664 <tr id='divoverlay-tooltipclose'>
24665 <td><code><b>tooltipclose</b></code></td>
24666 <td><code><a href='#tooltipevent'>TooltipEvent</a></code></td>
24667 <td>Fired when a tooltip bound to this layer is closed.</td>
24668 </tr>
24669</tbody></table>
24670
24671</section></div>
24672 </div>
24673</div>
24674
24675</section><section>
24676<h3 id=''>Methods</h3>
24677
24678
24679
24680
24681<div class='accordion'>
24682 <label><span class='expander'></span> Methods inherited from <a href='#layer'>Layer</a></label>
24683 <div class='accordion-overflow'>
24684 <div class='accordion-content'><section >
24685
24686
24687
24688
24689<table><thead>
24690 <tr>
24691 <th>Method</th>
24692 <th>Returns</th>
24693 <th>Description</th>
24694 </tr>
24695 </thead><tbody>
24696 <tr id='divoverlay-addto'>
24697 <td><code><b>addTo</b>(<nobr>&lt;Map|LayerGroup&gt;</nobr> <i>map</i>)</code></td>
24698 <td><code>this</code></td>
24699 <td><p>Adds the layer to the given map or layer group.</p>
24700</td>
24701 </tr>
24702 <tr id='divoverlay-remove'>
24703 <td><code><b>remove</b>()</code></td>
24704 <td><code>this</code></td>
24705 <td><p>Removes the layer from the map it is currently active on.</p>
24706</td>
24707 </tr>
24708 <tr id='divoverlay-removefrom'>
24709 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#map'>Map</a>&gt;</nobr> <i>map</i>)</code></td>
24710 <td><code>this</code></td>
24711 <td><p>Removes the layer from the given map</p>
24712</td>
24713 </tr>
24714 <tr id='divoverlay-removefrom'>
24715 <td><code><b>removeFrom</b>(<nobr>&lt;<a href='#layergroup'>LayerGroup</a>&gt;</nobr> <i>group</i>)</code></td>
24716 <td><code>this</code></td>
24717 <td><p>Removes the layer from the given <a href="#layergroup"><code>LayerGroup</code></a></p>
24718</td>
24719 </tr>
24720 <tr id='divoverlay-getpane'>
24721 <td><code><b>getPane</b>(<nobr>&lt;String&gt;</nobr> <i>name?</i>)</code></td>
24722 <td><code>HTMLElement</code></td>
24723 <td><p>Returns the <code>HTMLElement</code> representing the named pane on the map. If <code>name</code> is omitted, returns the pane for this layer.</p>
24724</td>
24725 </tr>
24726 <tr id='divoverlay-getattribution'>
24727 <td><code><b>getAttribution</b>()</code></td>
24728 <td><code>String</code></td>
24729 <td><p>Used by the <code>attribution control</code>, returns the <a href="#gridlayer-attribution">attribution option</a>.</p>
24730</td>
24731 </tr>
24732</tbody></table>
24733
24734</section></div>
24735 </div>
24736</div>
24737
24738<div class='accordion'>
24739 <label><span class='expander'></span> Popup methods inherited from <a href='#layer'>Layer</a></label>
24740 <div class='accordion-overflow'>
24741 <div class='accordion-content'><section >
24742
24743
24744
24745
24746<table><thead>
24747 <tr>
24748 <th>Method</th>
24749 <th>Returns</th>
24750 <th>Description</th>
24751 </tr>
24752 </thead><tbody>
24753 <tr id='divoverlay-bindpopup'>
24754 <td><code><b>bindPopup</b>(<nobr>&lt;String|HTMLElement|Function|Popup&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#popup-option'>Popup options</a>&gt;</nobr> <i>options?</i>)</code></td>
24755 <td><code>this</code></td>
24756 <td><p>Binds a popup to the layer with the passed <code>content</code> and sets up the
24757necessary event listeners. If a <code>Function</code> is passed it will receive
24758the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
24759</td>
24760 </tr>
24761 <tr id='divoverlay-unbindpopup'>
24762 <td><code><b>unbindPopup</b>()</code></td>
24763 <td><code>this</code></td>
24764 <td><p>Removes the popup previously bound with <code>bindPopup</code>.</p>
24765</td>
24766 </tr>
24767 <tr id='divoverlay-openpopup'>
24768 <td><code><b>openPopup</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
24769 <td><code>this</code></td>
24770 <td><p>Opens the bound popup at the specified <a href="#latlng"><code>latlng</code></a> or at the default popup anchor if no <code>latlng</code> is passed.</p>
24771</td>
24772 </tr>
24773 <tr id='divoverlay-closepopup'>
24774 <td><code><b>closePopup</b>()</code></td>
24775 <td><code>this</code></td>
24776 <td><p>Closes the popup bound to this layer if it is open.</p>
24777</td>
24778 </tr>
24779 <tr id='divoverlay-togglepopup'>
24780 <td><code><b>togglePopup</b>()</code></td>
24781 <td><code>this</code></td>
24782 <td><p>Opens or closes the popup bound to this layer depending on its current state.</p>
24783</td>
24784 </tr>
24785 <tr id='divoverlay-ispopupopen'>
24786 <td><code><b>isPopupOpen</b>()</code></td>
24787 <td><code>boolean</code></td>
24788 <td><p>Returns <code>true</code> if the popup bound to this layer is currently open.</p>
24789</td>
24790 </tr>
24791 <tr id='divoverlay-setpopupcontent'>
24792 <td><code><b>setPopupContent</b>(<nobr>&lt;String|HTMLElement|Popup&gt;</nobr> <i>content</i>)</code></td>
24793 <td><code>this</code></td>
24794 <td><p>Sets the content of the popup bound to this layer.</p>
24795</td>
24796 </tr>
24797 <tr id='divoverlay-getpopup'>
24798 <td><code><b>getPopup</b>()</code></td>
24799 <td><code><a href='#popup'>Popup</a></code></td>
24800 <td><p>Returns the popup bound to this layer.</p>
24801</td>
24802 </tr>
24803</tbody></table>
24804
24805</section></div>
24806 </div>
24807</div>
24808
24809<div class='accordion'>
24810 <label><span class='expander'></span> Tooltip methods inherited from <a href='#layer'>Layer</a></label>
24811 <div class='accordion-overflow'>
24812 <div class='accordion-content'><section >
24813
24814
24815
24816
24817<table><thead>
24818 <tr>
24819 <th>Method</th>
24820 <th>Returns</th>
24821 <th>Description</th>
24822 </tr>
24823 </thead><tbody>
24824 <tr id='divoverlay-bindtooltip'>
24825 <td><code><b>bindTooltip</b>(<nobr>&lt;String|HTMLElement|Function|Tooltip&gt;</nobr> <i>content</i>, <nobr>&lt;<a href='#tooltip-option'>Tooltip options</a>&gt;</nobr> <i>options?</i>)</code></td>
24826 <td><code>this</code></td>
24827 <td><p>Binds a tooltip to the layer with the passed <code>content</code> and sets up the
24828necessary event listeners. If a <code>Function</code> is passed it will receive
24829the layer as the first argument and should return a <code>String</code> or <code>HTMLElement</code>.</p>
24830</td>
24831 </tr>
24832 <tr id='divoverlay-unbindtooltip'>
24833 <td><code><b>unbindTooltip</b>()</code></td>
24834 <td><code>this</code></td>
24835 <td><p>Removes the tooltip previously bound with <code>bindTooltip</code>.</p>
24836</td>
24837 </tr>
24838 <tr id='divoverlay-opentooltip'>
24839 <td><code><b>openTooltip</b>(<nobr>&lt;<a href='#latlng'>LatLng</a>&gt;</nobr> <i>latlng?</i>)</code></td>
24840 <td><code>this</code></td>
24841 <td><p>Opens the bound tooltip at the specified <a href="#latlng"><code>latlng</code></a> or at the default tooltip anchor if no <code>latlng</code> is passed.</p>
24842</td>
24843 </tr>
24844 <tr id='divoverlay-closetooltip'>
24845 <td><code><b>closeTooltip</b>()</code></td>
24846 <td><code>this</code></td>
24847 <td><p>Closes the tooltip bound to this layer if it is open.</p>
24848</td>
24849 </tr>
24850 <tr id='divoverlay-toggletooltip'>
24851 <td><code><b>toggleTooltip</b>()</code></td>
24852 <td><code>this</code></td>
24853 <td><p>Opens or closes the tooltip bound to this layer depending on its current state.</p>
24854</td>
24855 </tr>
24856 <tr id='divoverlay-istooltipopen'>
24857 <td><code><b>isTooltipOpen</b>()</code></td>
24858 <td><code>boolean</code></td>
24859 <td><p>Returns <code>true</code> if the tooltip bound to this layer is currently open.</p>
24860</td>
24861 </tr>
24862 <tr id='divoverlay-settooltipcontent'>
24863 <td><code><b>setTooltipContent</b>(<nobr>&lt;String|HTMLElement|Tooltip&gt;</nobr> <i>content</i>)</code></td>
24864 <td><code>this</code></td>
24865 <td><p>Sets the content of the tooltip bound to this layer.</p>
24866</td>
24867 </tr>
24868 <tr id='divoverlay-gettooltip'>
24869 <td><code><b>getTooltip</b>()</code></td>
24870 <td><code><a href='#tooltip'>Tooltip</a></code></td>
24871 <td><p>Returns the tooltip bound to this layer.</p>
24872</td>
24873 </tr>
24874</tbody></table>
24875
24876</section></div>
24877 </div>
24878</div>
24879
24880<div class='accordion'>
24881 <label><span class='expander'></span> Methods inherited from <a href='#evented'>Evented</a></label>
24882 <div class='accordion-overflow'>
24883 <div class='accordion-content'><section >
24884
24885
24886
24887
24888<table><thead>
24889 <tr>
24890 <th>Method</th>
24891 <th>Returns</th>
24892 <th>Description</th>
24893 </tr>
24894 </thead><tbody>
24895 <tr id='divoverlay-on'>
24896 <td><code><b>on</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
24897 <td><code>this</code></td>
24898 <td><p>Adds a listener function (<code>fn</code>) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. <code>&#39;click dblclick&#39;</code>).</p>
24899</td>
24900 </tr>
24901 <tr id='divoverlay-on'>
24902 <td><code><b>on</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
24903 <td><code>this</code></td>
24904 <td><p>Adds a set of type/listener pairs, e.g. <code>{click: onClick, mousemove: onMouseMove}</code></p>
24905</td>
24906 </tr>
24907 <tr id='divoverlay-off'>
24908 <td><code><b>off</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Function&gt;</nobr> <i>fn?</i>, <nobr>&lt;Object&gt;</nobr> <i>context?</i>)</code></td>
24909 <td><code>this</code></td>
24910 <td><p>Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to <code>on</code>, you must pass the same context to <code>off</code> in order to remove the listener.</p>
24911</td>
24912 </tr>
24913 <tr id='divoverlay-off'>
24914 <td><code><b>off</b>(<nobr>&lt;Object&gt;</nobr> <i>eventMap</i>)</code></td>
24915 <td><code>this</code></td>
24916 <td><p>Removes a set of type/listener pairs.</p>
24917</td>
24918 </tr>
24919 <tr id='divoverlay-off'>
24920 <td><code><b>off</b>()</code></td>
24921 <td><code>this</code></td>
24922 <td><p>Removes all listeners to all events on the object. This includes implicitly attached events.</p>
24923</td>
24924 </tr>
24925 <tr id='divoverlay-fire'>
24926 <td><code><b>fire</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>, <nobr>&lt;Object&gt;</nobr> <i>data?</i>, <nobr>&lt;Boolean&gt;</nobr> <i>propagate?</i>)</code></td>
24927 <td><code>this</code></td>
24928 <td><p>Fires an event of the specified type. You can optionally provide an data
24929object — the first argument of the listener function will contain its
24930properties. The event can optionally be propagated to event parents.</p>
24931</td>
24932 </tr>
24933 <tr id='divoverlay-listens'>
24934 <td><code><b>listens</b>(<nobr>&lt;String&gt;</nobr> <i>type</i>)</code></td>
24935 <td><code>Boolean</code></td>
24936 <td><p>Returns <code>true</code> if a particular event type has any listeners attached to it.</p>
24937</td>
24938 </tr>
24939 <tr id='divoverlay-once'>
24940 <td><code><b>once</b>(<i></i>)</code></td>
24941 <td><code>this</code></td>
24942 <td><p>Behaves as <a href="#evented-on"><code>on(…)</code></a>, except the listener will only get fired once and then removed.</p>
24943</td>
24944 </tr>
24945 <tr id='divoverlay-addeventparent'>
24946 <td><code><b>addEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
24947 <td><code>this</code></td>
24948 <td><p>Adds an event parent - an <a href="#evented"><code>Evented</code></a> that will receive propagated events</p>
24949</td>
24950 </tr>
24951 <tr id='divoverlay-removeeventparent'>
24952 <td><code><b>removeEventParent</b>(<nobr>&lt;<a href='#evented'>Evented</a>&gt;</nobr> <i>obj</i>)</code></td>
24953 <td><code>this</code></td>
24954 <td><p>Removes an event parent, so it will stop receiving propagated events</p>
24955</td>
24956 </tr>
24957 <tr id='divoverlay-addeventlistener'>
24958 <td><code><b>addEventListener</b>(<i></i>)</code></td>
24959 <td><code>this</code></td>
24960 <td><p>Alias to <a href="#evented-on"><code>on(…)</code></a></p>
24961</td>
24962 </tr>
24963 <tr id='divoverlay-removeeventlistener'>
24964 <td><code><b>removeEventListener</b>(<i></i>)</code></td>
24965 <td><code>this</code></td>
24966 <td><p>Alias to <a href="#evented-off"><code>off(…)</code></a></p>
24967</td>
24968 </tr>
24969 <tr id='divoverlay-clearalleventlisteners'>
24970 <td><code><b>clearAllEventListeners</b>(<i></i>)</code></td>
24971 <td><code>this</code></td>
24972 <td><p>Alias to <a href="#evented-off"><code>off()</code></a></p>
24973</td>
24974 </tr>
24975 <tr id='divoverlay-addonetimeeventlistener'>
24976 <td><code><b>addOneTimeEventListener</b>(<i></i>)</code></td>
24977 <td><code>this</code></td>
24978 <td><p>Alias to <a href="#evented-once"><code>once(…)</code></a></p>
24979</td>
24980 </tr>
24981 <tr id='divoverlay-fireevent'>
24982 <td><code><b>fireEvent</b>(<i></i>)</code></td>
24983 <td><code>this</code></td>
24984 <td><p>Alias to <a href="#evented-fire"><code>fire(…)</code></a></p>
24985</td>
24986 </tr>
24987 <tr id='divoverlay-haseventlisteners'>
24988 <td><code><b>hasEventListeners</b>(<i></i>)</code></td>
24989 <td><code>Boolean</code></td>
24990 <td><p>Alias to <a href="#evented-listens"><code>listens(…)</code></a></p>
24991</td>
24992 </tr>
24993</tbody></table>
24994
24995</section></div>
24996 </div>
24997</div>
24998
24999</section><h2 id='global-switches'>Global Switches</h2><p>Global switches are created for rare cases and generally make
25000Leaflet to not detect a particular browser feature even if it&#39;s
25001there. You need to set the switch as a global variable to true
25002before including Leaflet on the page, like this:</p>
25003<pre><code class="lang-html">&lt;script&gt;L_NO_TOUCH = true;&lt;/script&gt;
25004&lt;script src=&quot;leaflet.js&quot;&gt;&lt;/script&gt;
25005</code></pre>
25006<table>
25007<thead>
25008<tr>
25009<th>Switch</th>
25010<th>Description</th>
25011</tr>
25012</thead>
25013<tbody>
25014<tr>
25015<td><code>L_NO_TOUCH</code></td>
25016<td>Forces Leaflet to not use touch events even if it detects them.</td>
25017</tr>
25018<tr>
25019<td><code>L_DISABLE_3D</code></td>
25020<td>Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they&#39;re supported.</td>
25021</tr>
25022</tbody>
25023</table>
25024
25025<h2 id='noconflict'>noConflict</h2><p>This method restores the <code>L</code> global variable to the original value
25026it had before Leaflet inclusion, and returns the real Leaflet
25027namespace so you can put it elsewhere, like this:</p>
25028<pre><code class="lang-html">&lt;script src=&#39;libs/l.js&#39;&gt;
25029&lt;!-- L points to some other library --&gt;
25030&lt;script src=&#39;leaflet.js&#39;&gt;
25031&lt;!-- you include Leaflet, it replaces the L variable to Leaflet namespace --&gt;
25032&lt;script&gt;
25033var Leaflet = L.noConflict();
25034// now L points to that other library again, and you can use Leaflet.Map etc.
25035&lt;/script&gt;
25036</code></pre>
25037
25038<h2 id='version'>version</h2><p>A constant that represents the Leaflet version in use.</p>
25039<pre><code class="lang-js">L.version; // contains &quot;1.0.0&quot; (or whatever version is currently in use)
25040</code></pre>
25041
25042
25043
25044 <!-- CUT HERE FOR docs/reference-*.html -->
25045
25046 </div>
25047
25048 <script src="../docs/docs/js/docs.js"></script>
25049 <script src="../docs/docs/js/reference.js"></script>
25050
25051</body></html>