Skip to content

Commit

Permalink
0.2.4 - Updated clear features behaviour to also clear loaded extents. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ponlawat-w authored Dec 14, 2023
1 parent ad430cb commit 4db40ba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Updated imports and exports
Updated clear features behaviour to also clear loaded extents.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ol-osmoverpass",
"type": "module",
"version": "0.2.3",
"version": "0.2.4",
"description": "OverLayers vector layer source for OpenStreetMap elements using Overpass API",
"main": "dist/index.js",
"keywords": [
Expand Down
6 changes: 5 additions & 1 deletion src/source/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default abstract class OSMOverpassSourceBase<GeometryType extends OSMGeom
this._busy = true;
if (this.getFeatures().length > this.options.cachedFeaturesCount) {
this.clear(true);
this.loadedExtents.clear();
}
const features = await this.fetchOSMOverpass(fetchExtent, projection);
this.addFeatures(features.filter(x => !this.getFeatureById(x.getId()!)));
Expand All @@ -124,6 +123,11 @@ export default abstract class OSMOverpassSourceBase<GeometryType extends OSMGeom
}
}

public clear(fast?: boolean | undefined): void {
this.loadedExtents.clear();
super.clear(fast);
}

/**
* Get default style of OSM source to the layer, default to be invisible as it is used for snapping only.
* @returns Style
Expand Down

0 comments on commit 4db40ba

Please sign in to comment.