Closed PedroVenancio closed 1 year ago
Hi, thank you for reporting the issue.
I see your issue. As you mentioned, it happens when using Leaflet v1.9.3. It seems like the feature
property does not exist on the callback's event value when using Leaflet v1.9.3.
I reviewed the Leaflet release notes for v1.9.3 and do not see any breaking changes listed, so it's hard to tell if this is an issue with Leaflet or Esri Leaflet. This needs more investigation.
1.9.2
I think this issue is happening because of https://github.com/Leaflet/Leaflet/pull/8571. Specifically, these lines: https://github.com/Leaflet/Leaflet/pull/8571/files#diff-2b5b78f24babc48279b336b4e9d85623e3d1fd37c43fdfe5e7240e736d5fcf7aR425-R427 ... in Leaflet v1.9.3 the code was changed to:
this._popup._source
gets set to this
. This is breaking our code since feature
is on this._popup._source
and so the feature
is lost when this._popup._source
gets set to this
. Given the discussion around this change: https://github.com/Leaflet/Leaflet/pull/8571/files#r996012452, where it was just added to "fix" some unit tests, my initial thought is that this code in leaflet@1.9.3 is wrong and should be removed, but I'm not totally sure.
Hi @gavinr
Thanks for checking! Do you think this should be raised in Leaflet issue tracker?
@gavinr @PedroVenancio I've opened https://github.com/Leaflet/Leaflet/issues/8761 to report the regression to Leaflet. I'm willing to bet we will need to fix this in Esri Leaflet since they made this change to fix a bug in Leaflet.
In the meantime 1.9.2 works and should be used.
The fix for this was released in v3.0.10.
Thank you very much @gavinr @patrickarlt ! It's fixed in v3.0.10!
Hi @patrickarlt @gavinr
I was testing further and it seems that it's still something wrong when using clusters.
Please take a look at this sample: https://codepen.io/PedroNGV/pen/QWBOpJd
TypeError: can't access property "properties", layer.feature is undefined
Should I open a new issue, or maybe reopen this one?
Thank you very much!
@patrickarlt do you think we need to apply the same change from PR #1350 into Esri Leaflet Cluster Feature Layer?
@patrickarlt do you think we need to apply the same change from PR #1350 into Esri Leaflet Cluster Feature Layer?
@gavinr @patrickarlt Do you think it is better to open a new issue, given it is related but it is not exactly the same issue?
Yes, please log an issue in https://github.com/Esri/esri-leaflet-cluster
Describe the bug
Hi, I'm testing Leaflet v1.9.3, updating from Leaflet v1.9.2 and I'm getting this error:
Uncaught TypeError: can't access property "properties", layer.feature is undefined
This happens when getting data from a service (
L.esri.featureLayer
) to construct the bindPopup or bindTooltip:The problem does not occur with Leaflet v1.9.2. In both cases, I'm using esri-leaflet-v3.0.9.
Reproduction
The issue can be seen in this sample:
https://developers.arcgis.com/esri-leaflet/samples/feature-layer-popups/
Logs
System Info
Additional Information
No response