Can't retrieve id from a geoJSON Feature when clicking on it #1779
Unanswered
marcnajera
asked this question in
Q&A
Replies: 1 comment
-
Hi,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to figure out which Features are being clicked when loaded from a GeoJSON into a Layer. I've added the layer as part of the
interactiveLayerIds
array and when I click on the feature I can see all the feature's properties, the source and layer it comes from, butid
is always undefined (although it's part of the geoJson object).My setup:
The data looks something like this:
I know I could see the
id
if it was stored inside the feature'sproperties
, but it isn't optimal since I can't change how the data is stored on the database. Also, I've tried to pass inpromoteId='id'
to the Source but without any luck.Any ideas on how can I achieve that?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions