UNPKG

2gis-maps

Version:

Interactive 2GIS maps API, based on Leaflet

55 lines (53 loc) 1.84 kB
<h2 id="2gis-project detection module">2GIS Project Detection Module</h2><p>Project is agglomeration, which includes a major city and the surrounding areas. This plugin allows to get information about the project which is being viewed at the current moment of time.</p> <p><dl class="api-incut"><ul class="page-contents"><li><a href="#examples-of usage">Examples of usage</a></li><li><a href="#events">Events</a><ul><li><a href="#methods">Methods</a></li></ul></dl></p> <h3 id="examples-of usage">Examples of usage</h3><p>Subscribe to the projectchange event:</p> <pre><code>map.on(&#39;projectchange&#39;, function (e) { console.log(e); }); </code></pre><p>Subscribe to the projectleave event:</p> <pre><code>map.on(&#39;projectleave&#39;, function (e) { console.log(e); }); </code></pre><h3 id="events">Events</h3><table> <thead> <tr> <th>Event</th> <th>Data</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>projectchange</td> <td>ProjectEvent</td> <td>Occurs when the user goes from one project to another.</td> </tr> <tr> <td>projectleave</td> <td>ProjectEvent</td> <td>Occurs when the user is outside of the current project.</td> </tr> </tbody> </table> <h4 id="methods">Methods</h4><table> <thead> <tr> <th>Method</th> <th>Returns</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>getProjectsList</td> <td>Object</td> <td>Returns all available projects.</td> </tr> <tr> <td>getProject</td> <td>Object</td> <td>Returns the current project.</td> </tr> </tbody> </table>