-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Is there a method to delete layer style attributes #2683
Comments
@HarelM Can you help me take a look at this problem . I don't know if I have described it clearly . I am using translation software to communicate . |
You can add and remove a layer in theory to solve this. |
@HarelM I created an example with the following address . Url:
This line of code failed to perform the expected operation . There are many attributes in map styles that have priority . I don't know how to change the priority attribute through encoding after setting it to a higher priority attribute . If there were a corresponding method, it would be great . for example
Of course, without changing the existing API .
If it can perform the operation perfectly, it is also excellent . |
@HarelM |
I don't think so, only adding and removing the layer as I mentioned. |
Thank you for your reply .
Of course, this is just a small idea from me, which may not meet the design requirements very well . |
I would consider allowing setting |
I would be happy to participate . |
typescript is not that different than javascript, try fixing this issue, if you get stuck on something I'd love to help. |
I'd like to try my hand at this one! |
Go ahead 😀 |
maplibre-gl-js version: 2.4.0
browser:
Steps to Trigger Behavior
I briefly describe the needs .
According to some attributes of the api map, they have priority among each other .
For example: line-color and line-pattern .
line-pattern has higher priority than line-color .
When I create a layer and set the line-pattern property .
Now I want to use the line-color property .
How should I remove the effect of the line-gradient attribute .
I tried the following .
In this way, the console will report an error .
I checked the api and couldn't find the corresponding method .
Is it possible to provide a method to delete an attribute .
For example :
map.removePaintProperty('line', 'line-gradient')
Link to Demonstration
https:maplibre.org/maplibre-gl-js-docs/example/line-gradient/
Expected Behavior
Use the following method to delete an attribute in a layer
map.removePaintProperty(layerId, 'line-gradient')
Actual Behavior
The text was updated successfully, but these errors were encountered: