I have a dynamicMapLayer with a layer definition set to filter out certain features, the problem is that the popup which is bound to this layer does not recognize the layer definition and will display information for features not drawn on the map.

  var map = L.map('map').setView([38.95, -81.203], 8);
  var mines = L.esri.dynamicMapLayer({
    layers: [1],
    layerDefs: {1:"SEAM = 'Redstone'"},
    opacity: 0.5,
    useCors: false
  var popupTemplate = "<h3>{SEAM}</h3><br><small>Name: {MINE_NAME}<small>";
  mines.bindPopup(function (error, featureCollection) {
    if(error || featureCollection.features.length === 0) {
      return false;
    } else {
      return L.Util.template(popupTemplate, featureCollection.features[0].properties);

1 Answer 1


This appears to have been a bug and the problem has been resolved in pass through layer definitions when binding a popup.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.