AnsweredAssumed Answered

Leaflet - DynamicMapLayer/FeatureService Popup help

Question asked by on Mar 1, 2016
Latest reply on Mar 4, 2016 by

I had a DynamicMapLayer that I needed to style like a featurelayer. and I found this link which helped a little.

Style a DynamicMapLayer · Issue #321 · Esri/esri-leaflet · GitHub


Now my points show up as custom icon and my definition query works.


However the popup doesn't work quite right. I can get the hosp.bindPopup to open, but it doesn't see the fields in the service like a true featureService does. My html shows up, that's it.


I tried the  Identifying Features | Esri Leaflet  example but it doesn't work I get hosp.identify is not a function and it fails.


As a dynamicMapLayer the following worked but not now.


     hosp.bindPopup(function (error, featureCollection) {

        if(error || featureCollection.features.length === 0) {

          return false;

        } else {   

                      return ' Name: ' + featureCollection.features[0].properties["Facility Name"] + "<br> Facility Type: "+featureCollection.features[0].properties["Facility Type"];




What I really need is to symbolize and definition query my DynamicMapService and have a popup that shows some attributes, Any ideas, examples?