If you want to switch to a different feature style when a user selects a feature, you have 2 options:
-
Set the
selected
flag of thePaintState
in thepaintBody
orpaintLabel
methods of theFeaturePainter
. See the Visualizing and styling feature data tutorial for an illustration. -
Use the
addSelection
function of theFeaturePainterUtil
module to add selection behavior to yourFeaturePainter
. Although this option limits your choices, it’s a quick and easy way to equip aFeaturePainter
with selection behavior.