Removing existing features before adding new ones.
This commit is contained in:
1 parent
040122189c
commit
600ce534fe
3 files changed
+22
No files matched your search
@@ -99,6 +99,10 @@ export const Wpt: Component<Props> = ({ vectorSource, wptId: wptId }) => {
|
||||
|
||||
const features = new GeoJSON().readFeatures(geo);
|
||||
console.log({ caller: 'Wpt', features });
|
||||
const feature = vectorSource.getFeatureById(wptId);
|
||||
if (feature) {
|
||||
vectorSource.removeFeature(feature);
|
||||
}
|
||||
vectorSource.addFeatures(features);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user