Skip to content
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

Add support for styling lines and shapes in Select One from Map questions #5945

Closed
9 tasks done
seadowg opened this issue Feb 1, 2024 · 0 comments · Fixed by #6083
Closed
9 tasks done

Add support for styling lines and shapes in Select One from Map questions #5945

seadowg opened this issue Feb 1, 2024 · 0 comments · Fixed by #6083
Assignees
Milestone

Comments

@seadowg
Copy link
Member

seadowg commented Feb 1, 2024

As a form designer
I want to specify the color and width of lines in selectable lines and polygons
So that data collectors can more easily select the correct one

Forum thread · Issue for markers · Simple style spec

Note: in the future, we will likely introduce a rule-based way to assign colors based on other property values. This is a simple short-term solution that is useful in many contexts.

Stroke color

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has a value set for a property with name stroke
    And that the value is valid based on the criteria below
    When I open the select from map question
    Then the line segments for that option should all be the specified color

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has a value set for a property with name stroke
    And that the value is invalid based on the criteria below
    When I open the select from map question
    Then the line segments for that option should all be the default color

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has no value set for a property with name stroke
    When I open the select from map question
    Then the line segments for that option should all be the default color

Stroke width

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has a value set for a property with name stroke-width
    And that the value is a floating point number greater than or equal to 0
    When I open the select from map question
    Then the line segments for that option should all have the specified stroke width in dp

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has a value set for a property with name stroke-width
    And that the value is NOT a floating point number greater than or equal to 0
    When I open the select from map question
    Then the line segments for that option should all have the default stroke width

  • Given that I have a form definition with a select from map
    And that a choice that is either a line or a polygon has no value set for a property with name stroke-width
    When I open the select from map question
    Then the line segments for that option should all have the default stroke width

Fill

  • Given that I have a form definition with a select from map
    And that a choice that is a polygon has a value set for a property with name fill
    And that the value is valid based on the criteria below
    When I open the select from map question
    Then the polygon for that option should be filled with the specified color and default opacity

  • Given that I have a form definition with a select from map
    And that a choice that is a polygon has a value set for a property with name fill
    And that the value is invalid based on the criteria below
    When I open the select from map question
    Then the polygon for that option should be filled with the default color and default opacity

  • Given that I have a form definition with a select from map
    And that a choice that is a polygon has NO value set for a property with name fill
    When I open the select from map question
    Then the polygon for that option should be filled with the default color and default opacity

Color rules

// Colors can be in short form:
// "#ace"
// or long form
// "#aaccee"
// with or without the # prefix.
// Colors are interpreted the same as in CSS,
// in #RRGGBB and #RGB order.
// But other color formats or named colors
// are not supported

@seadowg seadowg converted this from a draft issue Feb 1, 2024
@seadowg seadowg added this to the v2024.2 milestone Feb 1, 2024
@lognaturel lognaturel changed the title Add support for styling lines in Select One from Map questions Add support for styling lines and shapes in Select One from Map questions Apr 2, 2024
@seadowg seadowg moved this from not ready to ready in ODK Collect Apr 4, 2024
@grzesiek2010 grzesiek2010 self-assigned this Apr 10, 2024
@grzesiek2010 grzesiek2010 moved this from ready to in progress in ODK Collect Apr 10, 2024
@github-project-automation github-project-automation bot moved this from in progress to done in ODK Collect Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

2 participants