Closed vimception closed 7 months ago
Hello,
I think I'm hitting a bug, the shape of markers added to the map cannot be removed.
After adding a marker as follows:
var marker = new Marker(MarkerType.MarkerPin, coordinate, title) { Id = id }; map.MarkersList.Add(marker);
And subsequently removing the marker again:
var marker = map.MarkersList.First(_ => _.Id == id); map.MarkersList.Remove(marker);
The marker remains visible on the map.
I'm not an expert, but I think the problem might be attributed to this line of code: https://github.com/lolochristen/OpenLayers.Blazor/blob/main/src/OpenLayers.Blazor/wwwroot/openlayers_interop.js#L978.
Here, you are only looking at the Geometries. In case of a marker, I would expect:
var feature = this.Markers.getSource().getFeatureById(shape.id);
Let me know if I can assist.
Thanks.
Working like a charm in +1.5.8. Thanks a lot for the quick fix @lolochristen.
Hello,
I think I'm hitting a bug, the shape of markers added to the map cannot be removed.
After adding a marker as follows:
And subsequently removing the marker again:
The marker remains visible on the map.
I'm not an expert, but I think the problem might be attributed to this line of code: https://github.com/lolochristen/OpenLayers.Blazor/blob/main/src/OpenLayers.Blazor/wwwroot/openlayers_interop.js#L978.
Here, you are only looking at the Geometries. In case of a marker, I would expect:
Let me know if I can assist.
Thanks.