esri-leaflet
Version:
Leaflet plugins for consuming ArcGIS Online and ArcGIS Server services.
342 lines (312 loc) • 10.1 kB
HTML
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="not-ie"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Events | Esri Leaflet</title>
<meta name="description" content="Esri Leaflet">
<meta name="viewport" content="width=device-width">
<!--[if lt IE 9]>
<script src="//cdn.jsdelivr.net/html5shiv/3.7.2/html5shiv-printshiv.js"></script>
<![endif]-->
<!-- google fonts -->
<link href='//fonts.googleapis.com/css?family=Vollkorn:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//brick.a.ssl.fastly.net/Source+Code+Pro:300">
<link href='//fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<!-- stylesheet -->
<link rel="stylesheet" href="../css/style.css">
<!-- leaflet -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/leaflet/0.7.7/leaflet.css" />
<!-- require combined leaflet, esri leaflet and jsdelivr-rum -->
<script src="//cdn.jsdelivr.net/leaflet/0.7.7/leaflet.js"></script>
<!--script src="//cdn.jsdelivr.net/leaflet.esri/1.0.3/esri-leaflet.js"></script-->
<script src="../../js/esri-leaflet-src.js"></script>
<script src="//cdn.jsdelivr.net/jsdelivr-rum/latest/jsdelivr-rum.min.js"></script>
<!-- 'livereload' for development -->
<script src="//localhost:35729/livereload.js"></script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44963317-3', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>
<body>
<div class="page-content ">
<div class="container">
<a class="site-nav" href="../" class="left logo">Esri Leaflet</a>
<nav class="right">
<a class="site-nav" href="../examples/">Examples</a>
<a class="site-nav" href="../api-reference/">API Reference</a>
<a class="site-nav" href="../download/">Download</a>
<a class="site-nav" href="https://github.com/Esri/esri-leaflet">View on GitHub</a>
</nav>
</div>
<div id="background-map" class="background-map"></div>
<div class="container white">
<aside class="sidebar">
<h5>L.esri.Layers</h5>
<nav>
<a href="../api-reference/layers/basemap-layer.html">BasemapLayer</a>
<a href="../api-reference/layers/feature-layer.html">FeatureLayer</a>
<a href="../api-reference/layers/tiled-map-layer.html">TiledMapLayer</a>
<a href="../api-reference/layers/dynamic-map-layer.html">DynamicMapLayer</a>
<a href="../api-reference/layers/image-map-layer.html">ImageMapLayer</a>
<a href="../api-reference/layers/clustered-feature-layer.html">ClusteredFeatureLayer</a>
<a href="../api-reference/layers/heatmap-feature-layer.html">HeatmapFeatureLayer</a>
</nav>
<h5>L.esri.Tasks</h5>
<nav>
<a href="../api-reference/tasks/query.html">Query</a>
<a href="../api-reference/tasks/find.html">Find</a>
<a href="../api-reference/tasks/identify-features.html">Identify Features</a>
<a href="../api-reference/tasks/identify-image.html">Identify Image</a>
<a href="../api-reference/tasks/task.html">Task</a>
</nav>
<h5>Misc.</h5>
<nav>
<a href="../api-reference/request.html">Request</a>
<a href="../api-reference/util.html">Util</a>
<a href="../api-reference/events.html">Events</a>
</nav>
<h5>Base Classes</h5>
<nav>
<a href="../api-reference/services/image-service.html">ImageService</a>
<a href="../api-reference/services/feature-layer.html">FeatureLayerService</a>
<a href="../api-reference/services/map-service.html">MapService</a>
<a href="../api-reference/services/service.html">Service</a>
</nav>
</aside>
<div class="main-content">
<h1 id="events">Events</h1>
<p>Event types common across components of Esri Leaflet are documented here.</p>
<h3 id="loading-event">Loading Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bounds</code></td>
<td><a href="http://leafletjs.com/reference.html#latlngbounds"><code>LatLngBounds</code></a></td>
<td>The bounds that are currently being loaded.</td>
</tr>
</tbody>
</table>
<h3 id="load-event">Load Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bounds</code></td>
<td><a href="http://leafletjs.com/reference.html#latlngbounds"><code>LatLngBounds</code></a></td>
<td>The bounds that were loaded.</td>
</tr>
</tbody>
</table>
<p><strong>NOTE</strong>: The <code>load</code> event will not fire if you add the layer to the map before adding the event listener. You must add the listener first and then add the layer to the map as follows.</p>
<pre><code class="language-js"><span class="keyword">var</span> layer = <span class="keyword">new</span> L.esri.FeatureLayer(url, options);
layer.on(<span class="string">'load'</span>, <span class="function"><span class="keyword">function</span><span class="params">(e)</span>{</span>
<span class="comment">// do something on load</span>
});
layer.addTo(map);</code></pre>
<h3 id="feature-create">Feature Create</h3>
<p><code>createfeature</code> is fired when a feature from the Feature Layer is loaded for the first time.</p>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>feature</code></td>
<td><a href="http://geojson.org/geojson-spec.html#feature-objects"><code>GeoJSON Feature</code></a></td>
<td>GeoJSON respresentation of the feature that was created.</td>
</tr>
</tbody>
</table>
<h3 id="feature-remove">Feature Remove</h3>
<p><code>removefeature</code> is fired when a feature is removed from the map, either as the result of a filter operation or because it was deleted from the service.</p>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>feature</code></td>
<td><a href="http://geojson.org/geojson-spec.html#feature-objects"><code>GeoJSON Feature</code></a></td>
<td>GeoJSON respresentation of the feature that was created.</td>
</tr>
<tr>
<td><code>permanent</code></td>
<td><code>Boolean</code></td>
<td><code>true</code> if the feature was permanently deleted from the service or <code>false</code> if the feature was removed as the result of a filter operation.</td>
</tr>
</tbody>
</table>
<h3 id="feature-add">Feature Add</h3>
<p><code>addfeature</code> is fired when a feature that has already been created is added to the map again, usually the result of a filtering operation.</p>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>feature</code></td>
<td><a href="http://geojson.org/geojson-spec.html#feature-objects"><code>GeoJSON Feature</code></a></td>
<td>GeoJSON respresentation of the feature that was added.</td>
</tr>
</tbody>
</table>
<h3 id="request-event">Request Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td><code>String</code></td>
<td>The url the request was made to.</td>
</tr>
<tr>
<td><code>params</code></td>
<td><code>Object</code></td>
<td>The parameters that were passed to the request.</td>
</tr>
<tr>
<td><code>method</code></td>
<td><code>String</code></td>
<td>The HTTP method that was used for the request.</td>
</tr>
</tbody>
</table>
<h3 id="request-success-event">Request Success Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td><code>String</code></td>
<td>The url the request was made to.</td>
</tr>
<tr>
<td><code>params</code></td>
<td><code>Object</code></td>
<td>The parameters that were passed to the request.</td>
</tr>
<tr>
<td><code>method</code></td>
<td><code>String</code></td>
<td>The HTTP method that was used for the request.</td>
</tr>
<tr>
<td><code>response</code></td>
<td><code>Object</code></td>
<td>The JSON returned from the request.</td>
</tr>
</tbody>
</table>
<h3 id="request-error-event">Request Error Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td><code>String</code></td>
<td>The url the request was made to.</td>
</tr>
<tr>
<td><code>params</code></td>
<td><code>Object</code></td>
<td>The parameters that were passed to the request.</td>
</tr>
<tr>
<td><code>method</code></td>
<td><code>String</code></td>
<td>The HTTP method that was used for the request.</td>
</tr>
<tr>
<td><code>code</code></td>
<td><code>Integer</code></td>
<td>The error code that was returned.</td>
</tr>
<tr>
<td><code>message</code></td>
<td><code>String</code></td>
<td>The error message that was returned.</td>
</tr>
</tbody>
</table>
<h3 id="authentication-event">Authentication Event</h3>
<table>
<thead>
<tr>
<th>Data</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>authenticate</code></td>
<td><code>Function</code></td>
<td>Pass a new access token to this method to retry the failed request(s).</td>
</tr>
</tbody>
</table>
<p><a href="http://github.com/esri/esri-leaflet/edit/master/site/source/pages/api-reference/events.md">Edit this page on GitHub</a></p>
</div>
<div style='clear:both;'></div>
</div>
<div class="container centered-text">
<p class="copyright">Esri Leaflet is a project from the <a href="http://pdx.esri.com">Esri PDX R&D Center</a> and the <a href="https://github.com/Esri/esri-leaflet/graphs/contributors">Esri Community</a></p>
</div>
</div>
<script src="../js/script.js"></script>
</body>
</html>