Issue with Feature ID Type Mismatch in onClick Event (String vs. Number) #2504
Unanswered
fabripetrelli
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m working with a
Points
layer where each point has anid
that is provided as a string from my API. This id is passed to the layer as a string. However, when I retrieve the feature using theonClick
event on the map, theid
is returned as a number. This wouldn’t be a problem, but since theid
is a large number, the last two digits are being converted to00
, resulting in an incorrectid
when I use it to call other APIs.For example:
Original
id
from API:123456789012345678
id
returned fromonClick
:123456789012345600
This mismatch is causing issues in my application. Is there a way to ensure that the
id
is returned as a string in theonClick
event, or is there a recommended approach to handle this type conversion issue?Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions