From 173b46451b1826a1419a7da6046981449389a42b Mon Sep 17 00:00:00 2001 From: Greg Date: Mon, 1 Jul 2024 17:25:10 +0200 Subject: [PATCH] Rename registry functions --- packages/base/src/commands.ts | 2 +- packages/base/src/tools.ts | 6 +++--- python/jupytergis_core/src/layerBrowserRegistry.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/base/src/commands.ts b/packages/base/src/commands.ts index 52bd5ea45..8026bbbbd 100644 --- a/packages/base/src/commands.ts +++ b/packages/base/src/commands.ts @@ -133,7 +133,7 @@ namespace Private { const dialog = new Dialog({ body: new LayerBrowserWidget( current.context.model, - layerBrowserRegistry.getProviders() + layerBrowserRegistry.getRegistryLayers() ), buttons: [Dialog.cancelButton(), Dialog.okButton()] }); diff --git a/packages/base/src/tools.ts b/packages/base/src/tools.ts index ad4b3f7fd..b313713a0 100644 --- a/packages/base/src/tools.ts +++ b/packages/base/src/tools.ts @@ -186,7 +186,7 @@ export function createDefaultLayerRegistry( if ('url' in xyzprovider) { const tile = convertToRegistryEntry(entry, xyzprovider); - layerBrowserRegistry.registerProvider(tile); + layerBrowserRegistry.addRegistryLayer(tile); } else { Object.keys(xyzprovider).forEach(mapName => { const tile = convertToRegistryEntry( @@ -195,11 +195,11 @@ export function createDefaultLayerRegistry( entry ); - layerBrowserRegistry.registerProvider(tile); + layerBrowserRegistry.addRegistryLayer(tile); }); } - console.log('register', layerBrowserRegistry.getProviders()); + console.log('register', layerBrowserRegistry.getRegistryLayers()); } // TODO: These need better names diff --git a/python/jupytergis_core/src/layerBrowserRegistry.ts b/python/jupytergis_core/src/layerBrowserRegistry.ts index 9043cf936..17d185b73 100644 --- a/python/jupytergis_core/src/layerBrowserRegistry.ts +++ b/python/jupytergis_core/src/layerBrowserRegistry.ts @@ -12,15 +12,15 @@ export class JupyterGISLayerBrowserRegistry this._registry = []; } - getProviders(): IRasterLayerGalleryEntry[] { + getRegistryLayers(): IRasterLayerGalleryEntry[] { return [...this._registry]; } - registerProvider(data: IRasterLayerGalleryEntry): void { + addRegistryLayer(data: IRasterLayerGalleryEntry): void { this._registry.push(data); } - removeProvider(name: string): void { + removeRegistryLayer(name: string): void { this._registry = this._registry.filter(item => item.name !== name); }