-
Notifications
You must be signed in to change notification settings - Fork 302
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
Can the style in ColorLayer support function callback function? #2397
Comments
As you said, we support for each attributes. In this proposal, could you give us an example of what you're expecting. |
Example: source_steam-wfs_raster.html. I understand it to be either color or width, but I have a requirement: there is a water supply pipeline geojson data, and I need to render the style based on the pipeline material (color) and diameter (width). If the style callback function returns a result of an object such as: |
Thank you for using itowns. I fell like I understand your motivation. (You want to be able to use a single callback to define a style instead of using several callbacks for each style.properties). Unfortunatly, we decided in a technical choice, not to allow callbacks at the Style level, to limite the number of checks in order to validate the style. Looking at the previous example, you can do :
But i guess, your real case is more complex... |
@ftoromanoff I suggest considering that my job is more focused on business. Openlayer has this method, which is very convenient for setting styles and greatly reduces development costs. Thank you |
Hello, In your example this would mean being able to do:
(And in this case it will be hard to check for the mandatory values) |
Can the style in ColorLayer support function callback function? Currently, we have checked that each specific property supports callback. I want to dynamically modify the fill color and stroke color based on data properties, which requires multiple callbacks and is not very user-friendly. How to directly support callback function in style? After setting the property, I return a stylle object, which is more convenient to use
The text was updated successfully, but these errors were encountered: