forked from MapComplete/MapComplete
Refactoring: improve caching
This commit is contained in:
parent
f203a1158d
commit
e36e9123f3
5 changed files with 91 additions and 20 deletions
|
@ -20,7 +20,14 @@ export default class LocalStorageFeatureSource extends DynamicTileSource {
|
|||
const storage = TileLocalStorage.construct<Feature[]>(layername)
|
||||
super(
|
||||
zoomlevel,
|
||||
(tileIndex) => new StaticFeatureSource(storage.getTileSource(tileIndex)),
|
||||
(tileIndex) =>
|
||||
new StaticFeatureSource(
|
||||
storage
|
||||
.getTileSource(tileIndex)
|
||||
.map((features) =>
|
||||
features?.filter((f) => !f.properties.id.match(/(node|way)\/-[0-9]+/))
|
||||
)
|
||||
),
|
||||
mapProperties,
|
||||
options
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue