Skip to content

Feature is still displayed even if the layer is completely removed #81

@ImMak

Description

@ImMak

Hi, I'm facing a potential bug.

I'm displaying a graph on top of the map.
The graph is shown using a VectorLayer with features to display vertices and edges.

The map contains only two layers: the TileLayer and the VectorLayer.

A vertex contains a textStyle and circleStyle and if selected the textStyle is replaced with a different color and size to give the look that the selection is active.

An Edge has a strokeStyle (as it is just a line) and if selected the strokeStyle color is changed.

With a click outside the map or on another vertex/edge the previous selected feature turns back to the original style.

Now comes the problem: I want to give to the user the possibility to change the graph based on some options. To do this I remove the VectorLayer and create a new one with a new graph in it but if, before to change the graph, a vertex or an edge has been selected, the highlighted feature remains on the map.

I tried all the possible solutions (to bring back the highlighted feature to not highlighted, to remove the specific feature from the source of the vectorLayer, to remove ALL the layers to check if somehow the feature remained on the TileLayer) but it remains always there. I've also debugged and all the layers are cleared correctly.

Any idea? Am I forgetting something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions