Skip to content

[Feat] Add enhanced highlight options #9852

@rory-orennia

Description

@rory-orennia

Target Use Case

It would be great if there was some more options for the highlighting of features on your map. For example we'd like to outline the selected or hovered polygon rather than just fill it in with a different color. We're currently working around this by making a new "selected-item" layer every time you select something, but I think everyone would benefit from it being built into deck.gl instead

Proposal

We currently have highlightColor and that's your only option for stying a highlight. I think there's a couple options we could add:

  1. Simply add a new highlightStyle: "fill" | "outline" | "both" option, and then a secondary option like highlightOutlineWidth. hightlightStyle probably doesn't do anything on lines, but you could still increase the size of the outline width to get your highlighted line to pop out more
  2. Add full customization similar to how the normal rendering of points/lines/polygons works:
    2.1 - add highlightFillColor and highlightOutlineColor
    2.2 - "style" is determined by if these are set or not. So you would just render the outline if that was set, or just the fill if that was set. And then if both are there you can make a nice highlight where the outline is 100% opacity and the fill is 30%
    2.3 - add highlightOutlineWidth, maybe all the scale, units, minPixels, etc from Line properties

With that 2nd option you can have something similar to this:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions