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
Pointslayer where each point has anidthat 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 theonClickevent on the map, theidis returned as a number. This wouldn’t be a problem, but since theidis a large number, the last two digits are being converted to00, resulting in an incorrectidwhen I use it to call other APIs.For example:
Original
idfrom API:123456789012345678idreturned fromonClick:123456789012345600This mismatch is causing issues in my application. Is there a way to ensure that the
idis returned as a string in theonClickevent, 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