I have a component with maps. Within this component the user can switch between 2 layers.
So very simple, one layer needs to replace the entire existing layer. But doing that doesnt work upon initial function call, it only works upon the second (same)function call.
After the initial call, it seems that it has replaced everything except for shapeData visually -> (and yes, xxx.refresh() is being called). I came to this conclusion because of 1st function call switching to layer2 to layer1 and then hovering over the shape. It will return errors when hovering(except for a few on the rightside) trying to find the property belonging to the shape).
I have created a stackblits for testing/replicating. -> just select the same layer twice from the dropdown.
Any idea why this is happening?