-
Notifications
You must be signed in to change notification settings - Fork 592
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
How to change the initial custom styling of a feature after we draw it? #1298
Comments
I also want to achieve the color change problem, but I change it when drawing a new line |
I also have a requirement, which is to add serial numbers to the drawing points, such as 123 in your video. I would like to ask whether you use external labels to implement it or implement it in draw. If you implement it in the draw plug-in, how to implement it? |
I found the following solution sameerabit answer |
Hi @Quietly-20201113, could you share tips on what should I apply in my case? |
I wrote it when I studied adding serial numbers and other functions. Unfortunately, this function is not what I need, so I did not record it. I can only provide you with the corresponding documentation and examples of API and JSFIDDLE.NET. To you. [API-UserProperties] (https://github.com/mapbox/mapbox-gl-blob/min/docs/api.md), UserProperties settings are important [corresponding questions in stackoverflow] https://stackoverflow.com/questions/51303181/How-to-COLOR-InDividual-drawn-with-Mapbox-Gl-Draw) [Example in JSFIDDLE.NET] (https://jsfiddle.net/5lotf4ka/) This problem is actually very easy to solve. The biggest problem that hinders our realization is that API's words are difficult to do. |
Hi @Quietly-20201113 , the JSFiffle is not found: |
Sorry, I may have changed the case of the URL when I copied it, https://jsfiddle.net/5Lotf4ka/, note that the L is capitalized |
Hi everyone,
In the image below I draw roofs on the the top of the building:
This how I draw the roof :
I created a map instance :
I defined the styles using this function:
Everything works as expected but when I click on the roof ID ( circle ID), I want to change the color of that selected roof (feature) to red but Mapbox gl does not influence the change:
c0c91e36-12f5-43ea-8ed6-f3ce538f93c3.webm
This is the method I use:
I did not understand how to use the property
userProperties
Is it possible to change the color of each feature?I appreciate any example that you can provide.
Example: drawing to polygons in the first rendering and when I click on one of them, it will change its color.
Thank you
The text was updated successfully, but these errors were encountered: