How to get the correct information out of a dynamic layer with esri leaflet <p>Ok the problem is, that when i click on the map while having a dynamic layer on top of it the wrong information or no information is getting trough. </p> <p>The example to make it more understandable:</p> <p>The dynamic layer that will be added is:</p> <pre><code> vestigingLayer1 = L.esri.dynamicMapLayer("http://ags101.prvgld.nl/arcgis/rest/services/IBIS_bedrijventerrein_app/IBIS_bedrijventerrein_app/MapServer", { layers: [0], position: 'front', }) map.addLayer(vestigingLayer1); </code></pre> <p>The codepart that reacts on the mouseclick on the layer is:</p> <pre><code>map.on("click", function(e) { if(typeof vestigingLayer1 === 'undefined'){ } else{ vestigingLayer1.identify(e.latlng, function(data) { if(data.results.length &gt; 0) { // Popup toevoegen en informatie toevoegen popupText = "&lt;div style='overflow:scroll; max-width:250px; max-height:260px;'&gt;"; for (prop in data.results[0].attributes) { var val = data.results[0].attributes[prop]; if (val != 'undefined' &amp;&amp; val != "0" &amp;&amp; prop !="OBJECTID" &amp;&amp; prop != "Name") { popupText += "&lt;b&gt;" + prop.replace(" (Esri)",'') + "&lt;/b&gt;: " + val + "&lt;br&gt;"; } } popupText += "&lt;/div&gt;"; //Popup toevoegen op de plaats waar geklikt is. var popup = L.popup() .setLatLng(e.latlng) .setContent(popupText) .openOn(map); } }); } </code></pre> <p>so if you follow the code part via firebug you can see that in data the results always give the information of the same layer(1) or it has no results.</p> <p>Also a link to the working website to make it a bit more clear. <a href="http://geodev.prvgld.nl/geoapp/definitief/kaart.html" rel="nofollow">http://geodev.prvgld.nl/geoapp/definitief/kaart.html</a></p> <p>If someone knows the answer to this i'm really grateful for it.</p>