Skip to content

feat(geo)!: introduce VectorSourceLoader, LayerExtension API and refactor offline - #1944

Open
alecarn wants to merge 5 commits into
feat/auth-add-xhr-interceptor-for-geo-auth-interceptorfrom
feat/geo-vector-layer-isolate-offline
Open

feat(geo)!: introduce VectorSourceLoader, LayerExtension API and refactor offline#1944
alecarn wants to merge 5 commits into
feat/auth-add-xhr-interceptor-for-geo-auth-interceptorfrom
feat/geo-vector-layer-isolate-offline

Conversation

@alecarn

@alecarn alecarn commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

As part of the upcoming work to support the new layers for ogc-api, we propose cleaning up the vector layer to better support the upcoming changes.

Replace the monolithic vector loading logic with a composable VectorSourceLoader and a priority-ordered VectorLayerExtension interceptor chain. Move all offline (IndexedDB) concerns out of @igo2/geo into the new @igo2/geo/offline secondary entry point. Introduce VectorLayerPreloadOptions on VectorLayerOptions.

BREAKING CHANGE: VectorLayerOptions.idbInfo is removed. Replace with
offline: { enabled, contextUri } and preload: { bypassVisible, bypassResolution }.

BREAKING CHANGE: IdbInfo interface is removed. Use VectorLayerOfflineOptions instead.

BREAKING CHANGE: FeatureDataSourceOptions.preload is removed. Move preload options to VectorLayerOptions.preload.

BREAKING CHANGE: LayerService.createAsyncIdbLayers() is renamed to createAsyncOfflineLayers(). Prefer injecting OFFLINE_LAYER_RESTORE directly.

BREAKING CHANGE: provideOffline({ enable }) is removed from @igo2/geo. Import provideOffline and withIndexedDb from @igo2/geo/offline and call provideOffline(withIndexedDb()) instead.

BREAKING CHANGE: All offline symbols (GeoDB, LayerDB, GeoNetworkService, ConfigFileToGeoDBService, InsertSourceInsertDBEnum, IOfflineOptions, isIdbLayer) are removed from @igo2/geo. Import from @igo2/geo/offline.

BREAKING CHANGE: VectorLayer.customWFSLoader() is removed. Call layer.refresh() to reload WFS data.

BREAKING CHANGE: addLayerAndFeaturesToMap is no longer exported from @igo2/geo/import-export. It is now an internal function.

@pelord pelord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je n'ai pas pleinement révisé le code, mais fonctinnellement, il y a une régression.

Importe une donnée (drag and drop) et accepte de storer le layer.

Les features ne sont plus présentes lorsque tu recharge l'app

Load initial:

Image

Apres reload de la page:

Image

@alecarn

alecarn commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

C'est corrigé pour cette PR.

D'ailleurs dans la démo avec la v20, ça semble non fonctionnel
image

@alecarn
alecarn requested a review from pelord August 13, 2026 12:18
…ctor offline

Replace the monolithic vector loading logic with a composable VectorSourceLoader
and a priority-ordered VectorLayerExtension interceptor chain. Move all offline
(IndexedDB) concerns out of @igo2/geo into the new @igo2/geo/offline secondary
entry point. Introduce VectorLayerPreloadOptions on VectorLayerOptions.

BREAKING CHANGE: VectorLayerOptions.idbInfo is removed. Replace with
`offline: { enabled, contextUri }` and `preload: { bypassVisible, bypassResolution }`.

BREAKING CHANGE: IdbInfo interface is removed. Use VectorLayerOfflineOptions instead.

BREAKING CHANGE: FeatureDataSourceOptions.preload is removed. Move preload options
to VectorLayerOptions.preload.

BREAKING CHANGE: LayerService.createAsyncIdbLayers() is renamed to
createAsyncOfflineLayers(). Prefer injecting OFFLINE_LAYER_RESTORE directly.

BREAKING CHANGE: provideOffline({ enable }) is removed from @igo2/geo. Import
provideOffline and withIndexedDb from @igo2/geo/offline and call
provideOffline(withIndexedDb()) instead.

BREAKING CHANGE: All offline symbols (GeoDB, LayerDB, GeoNetworkService,
ConfigFileToGeoDBService, InsertSourceInsertDBEnum, IOfflineOptions, isIdbLayer)
are removed from @igo2/geo. Import from @igo2/geo/offline.

BREAKING CHANGE: VectorLayer.customWFSLoader() is removed. Call layer.refresh()
to reload WFS data.

BREAKING CHANGE: addLayerAndFeaturesToMap is no longer exported from
@igo2/geo/import-export. It is now an internal function.
@alecarn
alecarn force-pushed the feat/geo-vector-layer-isolate-offline branch from 5f75b82 to fed7409 Compare August 13, 2026 15:35
Comment thread packages/geo/offline/src/offline.interface.ts
Comment thread packages/geo/src/lib/layer/shared/layers/vector-layer.interface.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai l'impression que le batch se fait en série plutôt que en parallèle.

Il me semble que c'était en parallèle à l'origine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je l'ai testé et je confirme le comportement.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai poussé un commit pour ajuster le comportement

… folder

- Added VectorLayer class to manage vector layers with various data sources.
- Implemented VectorLayerOptions interface to define layer options including source, style, and preload options.
- Created VectorSourceLoader to handle loading features from vector sources with support for batching and error handling.
- Developed unit tests for VectorLayer to ensure correct behavior of layer functionalities and interactions with data sources.
- Updated search components to utilize the new VectorLayerOptions interface.
BREAKING CHANGE: The legacy boolean preload options `bypassVisible` and `bypassResolution` have been
replaced by the `bypass` mode on `VectorLayerPreloadOptions`
@alecarn
alecarn requested a review from pelord August 14, 2026 13:52
};
offline?: IOfflineOptions;
offline?: {
enable?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled, pour l'uniformité?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bien vu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants