-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use promoteId and properties.id in mapbox/maplibre adapter #266
Comments
Thank you for raising this, I will do a bit of reading about this and get back to you shortly 👍🏻 |
I've looked into this a little, and wanted to get a better understanding of what your end goal is and what you are trying to achieve? Perhaps I am misunderstanding, but as a general rule it is advisable not to to interact with the layers/sources that Terra Draw creates for you as these are meant to be managed directly by the library (obviously we have no method of preventing this, hence why it is just advice!). |
Sorry for the late response! We are using a custom version of the maplibre adapter so that we can do a bit more with the styling and as such want to use feature-state which requires a valid ID. For example:
|
Hey @ScottEAdams sorry about my late response also! I understand - for people using the out the box MapLibre adapter I don't think they should need the promoted id, but can totally understand your specific use case. This is one of the USPs about Terra Draw, is you can clone the built in adapters and tweak them do do specific things if you need to, without having to fork the whole repository etc! I will close this soon, as I understand your custom requirements and it sounds like they're being satisfied via your own adapter. I will give a bit of time for anyone else to chime in if they have any thoughts. What are you working on out of interest? |
Just closing this out as no feedback from anyone else. Still keen to hear what you're work on however! |
We have a very old leaflet running in prod at https://kartor.eniro.se/ which we have moved to maplibre at https://www.eniro.se/kartor with our own tiles. Eniro are basically the equivalent of yellow pages but in Sweden. You can check out how I have implemented terra-draw by clicking the little layers icon on the right. |
@ScottEAdams very cool - thanks for sharing that with me, appreciate seeing Terra Draw live on web apps! |
Is your feature request related to a problem? Please describe.
Maplibre does not support uuid as a featureId out of the box (possibly other libs suffer the same). This causes features to have undefined id which prevents a bunch of things such as feature-state, lookups etc.
Old discussion can be seen here - maplibre/maplibre-gl-js#1043
Describe your proposed idea for the solution to this problem
Add the following to
mapbox-gl.adapter.ts
render:Together with the following in _addGeoJSONSource:
And you will get a valid feature Id:
The text was updated successfully, but these errors were encountered: