0

I am using a dynamicMapLayer with point data. If I bind a custom popup to this layer, it does not return the properties for the point.

https://plnkr.co/16IooEUXpoo9fvqlfnhU

If I use polygon data with the dynamicMapLayer, it does return the properties.

https://plnkr.co/o4lrf32DlL9KOFpMJEs9

If I use a featureLayer, it does return the properties for point data.

https://plnkr.co/cHFt1qA1zLTkqQ1iETne

Is this behaviour correct? I would rather use a dynamic layer, it seems faster and returns symbology also.

1
  • This is very strange, I was just at home over lunch and I tried this on my chromebook and it worked.
    – joffreyj
    Commented Apr 22, 2016 at 18:35

1 Answer 1

2

your sample is working fine for me. if you're having trouble clicking on point features, consider calling tolerance() and passing in a number of screen pixels greater than the default value of 3.

that being said, you are not limited to working with L.esri.dynamicMapLayer in order to get a reference to the symbology defined by the service itself. when working with L.esri.featureLayers, you can use our renderers plugin to get the same effect with graphics on the map instead of a raster image produced by the server on the fly.

edit (4/25/2016):
i'm noticing now that our API just passes along whatever value you supply for the layers parameter directly, while the operation itself expects you to concatenate a modifier like top:, visible: or all: to allow for more finegrained control. (see my own working example with default tolerance here).

.layers('all:0')

if you can confirm that my modification solves the problem on your end, then i see two options going forward.

  1. ensure the API appends all: automatically, since its the most versatile modifier.
  2. explain in the documentation that its up to developers to construct a valid value using one of the modifiers themselves.
4
  • Hi John thanks I will try that, I did use the renderers plugin initially but had trouble getting it to work with my secured service via proxy. I guess I need to spend some time working on authentication / tokens.
    – joffreyj
    Commented Apr 24, 2016 at 8:38
  • So I added the code for the identify and jacked the tolerance up to 25 and it still does not work for me at the office on any machine I have tried (Windows 10 Pro / Dell Precision T5610). It does work for me at home on my chromebook, I will try it on the surface at home (also windows 10) and my ipad and if they work bring them into the office and try to isolate this problem @john-gravois. While it never identified the correct layer (at th office), at times it will return properties from a polygon layer that I have not included in the dynamic layer. plnkr.co/16IooEUXpoo9fvqlfnhU
    – joffreyj
    Commented Apr 25, 2016 at 16:20
  • i've edited my original answer and looking forward to hearing your response. Commented Apr 25, 2016 at 17:31
  • I was able to get it working with your suggestion, thanks, but identify still won't work with any tolerance below 10 on my system, maybe this is why bindPopup won't work for me? I vote for option #2. Also found this, it would be really nice to have... github.com/Esri/esri-leaflet/issues/633
    – joffreyj
    Commented Apr 25, 2016 at 19:52

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.