To add this widget to your Enketo Express installation see this guidance.
For in-depth usage documentation, please refer to https://github.com/kobotoolbox/wfp-svg-map-documentation.
Works on SVG media if the following is present for a question in XLSForm (or XForm):
- Appearance
"image-customization"
onselect_one
andselect_multiple
questions. - The column
"body::kb:image-customization"
is present with a${style}
reference for that question. - The settings sheet has a namespaces setting containing
kb="http://kobotoolbox.org/xforms"
. - The
${style}
calculation produces a stringified JSON format with SVG style instructions. The special"selected"
property is optional and can be used to override the selected style in the image-map widget (in case both are combined). The other properties correspond to anid
attribute on a<path>
in the SVG. Multiple style properties can be customized. See example:
{
"selected": {
"stroke": "yellow",
"stroke-width": 4
},
"AL": {
"fill": "#ccc"
},
"CO": {
"fill": "#ababab"
}
}
Note that this widget is a custom hack for which we cannot device a proper sane XForm syntax. It is therefore not suitable for inclusion in the common Enketo tools and the ODK XForms specification.