UNPKG

leaflet-geometryutil

Version:
6,153 lines 84.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Global - Documentation</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav>
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Tutorials</li><li class="nav-item"><a href="tutorial-closest.html">closest</a></li><li class="nav-item"><a href="tutorial-distance-length.html">distance-length</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#accumulatedLengths">accumulatedLengths</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#angle">angle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#bearing">bearing</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#belongsSegment">belongsSegment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#closest">closest</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#closestLayer">closestLayer</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#closestLayerSnap">closestLayerSnap</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#closestOnSegment">closestOnSegment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#computeAngle">computeAngle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#computeSlope">computeSlope</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#destination">destination</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#destinationOnSegment">destinationOnSegment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#distance">distance</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#distanceSegment">distanceSegment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#extract">extract</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#interpolateOnLine">interpolateOnLine</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#interpolateOnPointSegment">interpolateOnPointSegment</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isAfter">isAfter</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isBefore">isBefore</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#layersWithin">layersWithin</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#length">length</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#locateOnLine">locateOnLine</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#nClosestLayers">nClosestLayers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#readableDistance">readableDistance</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#reverse">reverse</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#rotatePoint">rotatePoint</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#startsAtExtremity">startsAtExtremity</a></span></li>
</nav>

<div id="main">
    
    <h1 class="page-title">Global</h1>
    

    




<section>

<header>
    
        <h2>
        
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>


        
    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            
<div class="section-method">

    

    <h4 class="name" id="accumulatedLengths"><span class="type-signature"></span>accumulatedLengths<span class="signature">(coords)</span><span class="type-signature"> &rarr; {Array.&lt;Number>}</span></h4>

    



<div class="description">
    <p>Returns a list of accumulated length along a line.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line123">line 123</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>coords</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Polyline</code></span>
|

<span class="param-type"><code>Array.&lt;L.Point></code></span>
|

<span class="param-type"><code>Array.&lt;L.LatLng></code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Set of coordinates</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Array.&lt;Number></code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>Array of accumulated lengths (pixels for Point, meters for LatLng)</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="angle"><span class="type-signature"></span>angle<span class="signature">(map:, latlngA:, latlngB:)</span><span class="type-signature"> &rarr; {Float}</span></h4>

    



<div class="description">
    <p>Returns the the angle of the given segment and the Equator in degrees,
clockwise from 0 degrees north.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line742">line 742</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point A of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point B of the segment</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Float</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>the angle in degrees.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="bearing"><span class="type-signature"></span>bearing<span class="signature">(latlng1:, latlng2:)</span><span class="type-signature"> &rarr; {float}</span></h4>

    



<div class="description">
    <p>Returns the bearing in degrees clockwise from north (0 degrees)
from the first L.LatLng to the second, at the first LatLng</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line689">line 689</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng1:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>origin point of the bearing</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng2:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>destination point of the bearing</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>float</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>degrees clockwise from north.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="belongsSegment"><span class="type-signature"></span>belongsSegment<span class="signature">(latlng, latlngA, latlngB, tolerance<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    <p>Returns true if the latlng belongs to segment A-B</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line99">line 99</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>geographical point A of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>geographical point B of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tolerance</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    0.2
                
                </td>
            

            <td class="description last">
                <p>tolerance to accept if latlng belongs really</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>boolean</code></span>


    </dd>
</dl>


    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="closest"><span class="type-signature"></span>closest<span class="signature">(map, layer, latlng, vertices<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns the closest latlng on layer.</p>
<pre><code>    Accept nested arrays</code></pre>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line173">line 173</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layer</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;L.LatLng></code></span>
|

<span class="param-type"><code>Array.&lt;Array.&lt;L.LatLng>></code></span>
|

<span class="param-type"><code>L.PolyLine</code></span>
|

<span class="param-type"><code>L.Polygon</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Layer that contains the result</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>vertices</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last">
                <p>Whether to restrict to path vertices.</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.LatLng</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>Closest geographical point or null if layer param is incorrect</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="closestLayer"><span class="type-signature"></span>closestLayer<span class="signature">(map, layers, latlng)</span><span class="type-signature"> &rarr; {object}</span></h4>

    



<div class="description">
    <p>Returns the closest layer to latlng among a list of layers.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line280">line 280</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;L.ILayer></code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Set of layers</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>object</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p><code>{layer, latlng, distance}</code> or <code>null</code> if list is empty;</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="closestLayerSnap"><span class="type-signature"></span>closestLayerSnap<span class="signature">(map, layers, latlng, tolerance<span class="signature-attributes">opt, nullable</span>, withVertices<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {object}</span></h4>

    



<div class="description">
    <p>Returns the closest position from specified {LatLng} among specified layers,
with a maximum tolerance in pixels, providing snapping behaviour.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line416">line 416</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;ILayer></code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>A list of layers to snap on.</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>The position to snap</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tolerance</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last">
                <p>Maximum number of pixels.</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>withVertices</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last">
                <p>Snap to layers vertices or segment points (not only vertex)</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>object</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>with snapped {LatLng} and snapped {Layer} or null if tolerance exceeded.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="closestOnSegment"><span class="type-signature"></span>closestOnSegment<span class="signature">(map, latlng, latlngA, latlngB)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns the closest point of a {L.LatLng} on the segment (A-B)</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line149">line 149</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point A of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point B of the segment</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.LatLng</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>Closest geographical point</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="computeAngle"><span class="type-signature"></span>computeAngle<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns horizontal angle in degres between two points.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line647">line 647</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>a</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Coordinates of point A</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>b</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Coordinates of point B</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Number</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>horizontal angle</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="computeSlope"><span class="type-signature"></span>computeSlope<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    <p>Returns slope (Ax+B) between two points.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line657">line 657</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>a</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Coordinates of point A</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>b</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Coordinates of point B</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Object</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>with <code>a</code> and <code>b</code> properties.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="destination"><span class="type-signature"></span>destination<span class="signature">(latlng:, heading:, distance:)</span><span class="type-signature"> &rarr; {L.latLng}</span></h4>

    



<div class="description">
    <p>Returns the point that is a distance and heading away from
the given origin point.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line713">line 713</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>origin point</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>heading:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>float</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>heading in degrees, clockwise from 0 degrees north.</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>distance:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>float</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>distance in meters</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.latLng</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>the destination point.
Many thanks to Chris Veness at http://www.movable-type.co.uk/scripts/latlong.html
for a great reference and examples.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="destinationOnSegment"><span class="type-signature"></span>destinationOnSegment<span class="signature">(map:, latlngA:, latlngB:, distance:)</span><span class="type-signature"> &rarr; {L.latLng}</span></h4>

    



<div class="description">
    <p>Returns a point snaps on the segment and heading away from the given origin point a distance.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line758">line 758</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point A of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point B of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>distance:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>float</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>distance in meters</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.latLng</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>the destination point.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="distance"><span class="type-signature"></span>distance<span class="signature">(map, latlngA, latlngB)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Shortcut function for planar distance between two {L.LatLng} at current zoom.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line42">line 42</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-distance-length.html">distance-length</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point A</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point B</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Number</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>planar distance</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="distanceSegment"><span class="type-signature"></span>distanceSegment<span class="signature">(map, latlng, latlngA, latlngB)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Shortcut function for planar distance between a {L.LatLng} and a segment (A-B).</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line54">line 54</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point A of the segment</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>geographical point B of the segment</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Number</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>planar distance</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="extract"><span class="type-signature"></span>extract<span class="signature">(map, polyline, start, end)</span><span class="type-signature"> &rarr; {Array.&lt;L.LatLng>}</span></h4>

    



<div class="description">
    <p>Returns a sub-part of the polyline, from start to end.
If start is superior to end, returns extraction from inverted line.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line573">line 573</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Polyline on which will be extracted the sub-part</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>start</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>ratio, expressed as a decimal between 0 and 1, inclusive</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>end</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>ratio, expressed as a decimal between 0 and 1, inclusive</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Array.&lt;L.LatLng></code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>new polyline</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="interpolateOnLine"><span class="type-signature"></span>interpolateOnLine<span class="signature">(map, latlngs, ratio)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    <p>Returns the coordinate of the point located on a line at the specified ratio of the line length.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line457">line 457</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngs</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;L.LatLng></code></span>
|

<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Set of geographical points</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ratio</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>the length ratio, expressed as a decimal between 0 and 1, inclusive</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Object</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>an object with latLng ({LatLng}) and predecessor ({Number}), the index of the preceding vertex in the Polyline
(-1 if the interpolated point is the first vertex)</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="interpolateOnPointSegment"><span class="type-signature"></span>interpolateOnPointSegment<span class="signature">(pA, pB, the)</span><span class="type-signature"> &rarr; {L.Point}</span></h4>

    



<div class="description">
    <p>Returns the Point located on a segment at the specified ratio of the segment length.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line442">line 442</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>pA</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>coordinates of point A</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pB</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Point</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>coordinates of point B</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>the</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>length ratio, expressed as a decimal between 0 and 1, inclusive.</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.Point</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>the interpolated point.</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="isAfter"><span class="type-signature"></span>isAfter<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline starts where second ends.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line620">line 620</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>First polyline</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Second polyline</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>bool</code></span>


    </dd>
</dl>


    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="isBefore"><span class="type-signature"></span>isBefore<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline ends where other second starts.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line607">line 607</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>First polyline</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Second polyline</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>bool</code></span>


    </dd>
</dl>


    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="layersWithin"><span class="type-signature"></span>layersWithin<span class="signature">(map, layers, latlng, radius<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {Array.&lt;object>}</span></h4>

    



<div class="description">
    <p>Returns all layers within a radius of the given position, in an ascending order of distance.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line372">line 372</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;ILayer></code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>A list of layers.</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>radius</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last">
                <p>Search radius in pixels</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Array.&lt;object></code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>an array of objects including layer within the radius, closest latlng, and distance</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="length"><span class="type-signature"></span>length<span class="signature">(coords)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns total length of line</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line113">line 113</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-distance-length.html">distance-length</a></li>
        </ul>
    </dd>
    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>coords</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Polyline</code></span>
|

<span class="param-type"><code>Array.&lt;L.Point></code></span>
|

<span class="param-type"><code>Array.&lt;L.LatLng></code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Set of coordinates</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Number</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>Total length (pixels for Point, meters for LatLng)</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="locateOnLine"><span class="type-signature"></span>locateOnLine<span class="signature">(map, polyline, latlng)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns a float between 0 and 1 representing the location of the
closest point on polyline to the given latlng, as a fraction of total line length.
(opposite of L.GeometryUtil.interpolateOnLine())</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line527">line 527</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Polyline on which the latlng will be search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Number</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>Float between 0 and 1</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="nClosestLayers"><span class="type-signature"></span>nClosestLayers<span class="signature">(map, layers, latlng, n<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {Array.&lt;object>}</span></h4>

    



<div class="description">
    <p>Returns the n closest layers to latlng among a list of input layers.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line323">line 323</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.Map</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Leaflet map to be used for this method</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Array.&lt;L.ILayer></code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>Set of layers</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>The position to search</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>n</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    layers.length
                
                </td>
            

            <td class="description last">
                <p>the expected number of output layers.</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>Array.&lt;object></code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>an array of objects <code>{layer, latlng, distance}</code> or <code>null</code> if the input is invalid (empty list or negative n)</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="readableDistance"><span class="type-signature"></span>readableDistance<span class="signature">(distance, unit)</span><span class="type-signature"> &rarr; {String}</span></h4>

    



<div class="description">
    <p>Shortcut function for converting distance to readable distance.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line67">line 67</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>distance</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Number</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>distance to be converted</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unit</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>'metric' or 'imperial'</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>String</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>in yard or miles</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="reverse"><span class="type-signature"></span>reverse<span class="signature">(polyline)</span><span class="type-signature"> &rarr; {L.PolyLine}</span></h4>

    



<div class="description">
    <p>Returns a clone with reversed coordinates.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line560">line 560</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>polyline to reverse</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.PolyLine</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>polyline reversed</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="rotatePoint"><span class="type-signature"></span>rotatePoint<span class="signature">(latlngPoint:, angleDeg:, latlngCenter:)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns LatLng of rotated point around specified LatLng center.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line670">line 670</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlngPoint:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>point to rotate</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>angleDeg:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>double</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>angle to rotate in degrees</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngCenter:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.LatLng</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>center of rotation</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>L.LatLng</code></span>


    </dd>
</dl>


<div class="param-desc">
    <p>rotated point</p>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="startsAtExtremity"><span class="type-signature"></span>startsAtExtremity<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline starts where second ends or start.</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line633">line 633</a>
    </li></ul></dd>
    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>First polyline</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>L.PolyLine</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>Second polyline</p>
                
            </td>
        </tr>

    
    </tbody>
</table>














<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>bool</code></span>


    </dd>
</dl>


    
</div>



</div>
        
    

    

    
</article>

</section>




</div>

<br class="clear">

<footer>
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Feb 13 2020 16:26:08 GMT+0100 (GMT+01:00) using the Minami theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>