Using some dynamic value replacements in style properties is currently not possible without hacking module code (modules/openlayers_ui/plugins/export_ui/openlayers_styles_ui.class.php
file). It's because dynamic value replacements are not evaluated before checking the value of style property value.
So we need to:
- be able to set view (and display) to check the dynamic value replacements against
- load that view and check type of every value in corresponding field
- report problems that have been found to the style editor
Original question:
I had an issue with letting the ${count} attribute control the radius og the styles. At first it did not work, but I then hacked the style form and removed the check that only allowed numbers in the point radius field. And it worked, the gouping count can then deside the size of the markers.
But why is this not allowed in the first place? I propose to remove this check so one can enter relative values.
Comments
Comment #1
PolHello,
If you provide a patch I'll include it asap.
Thanks !
Comment #2
falster CreditAttribution: falster commentedI am sorry but I don't know how to make an patch, I'm not an programmer...
But anyhow.
In the file openlayers/modules/openlayers_ui/includes/openlayers_ui.styles.inc
On the line 32 -33 remove this:
Comment #3
PolI'm sorry I don't have such file, could you be more specific ?
Also, for which field you want to remove that check and why ? Could you develop ?
Thanks.
Comment #4
falster CreditAttribution: falster commentedI don't quite understand. It is in the openlayers module. Under the user interface I can find openlayers_ui.styles.inc
Are you sure you don't find the file?
But the field in question is the point radius field, who sets the size of the marker.
This:
The last check only allows numbers to be entered, I want to enter an attribute like ${number_from_views}, wich is completely possible apart from the check in the form.
Comment #5
PolI'm not aware that we can replace this by tokens, I will check this out.
Thanks !
Comment #6
PolComment #7
PolIt should be fixed now.
Comment #9
milos.kroulik CreditAttribution: milos.kroulik commentedThere are other style properties, that can be defined dynamically, so I decided to reopen this issue. For my usecase I needed to set dynamic strokeWidth, which has to be positive integer. It succeeded only after disabling check in modules/openlayers_ui/plugins/export_ui/openlayers_styles_ui.class.php. Perhaps we should name the issue differently like "Evaluate dynamic replacement value before checking correct style property value"?
Comment #10
PolCould be a good idea to implement.
Patches are welcome !
Comment #11
milos.kroulik CreditAttribution: milos.kroulik commentedThanks for response! I don't have required time (and probably knowledge) right now, but will definitely try to work on this in the future. I modified the issue in proposed manner, hopefully it's OK.
Comment #12
milos.kroulik CreditAttribution: milos.kroulik commentedThis is duplicate of https://drupal.org/node/2241391