Closed ghost closed 4 years ago
I posted a reply on SO, but here's a copy of it:
To remove features, the easiest is to just no longer provide those features to the success
callback.
So, to remove the trail, you would add some condition under which the trail should no longer be visible and call success
like this:
success({
type: 'FeatureCollection',
features: [data, trail]
});
Likewise, if you want to remove the marker as well, call success with empty features
:
success({
type: 'FeatureCollection',
features: []
});
Please see this SO question