Skip to content

Commit

Permalink
Rename registry functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmooney committed Jul 1, 2024
1 parent 19fc68e commit a92a688
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/base/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
});
Expand Down
6 changes: 3 additions & 3 deletions packages/base/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions packages/schema/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ export interface IRasterLayerGalleryEntry {
}

export interface IJGISLayerBrowserRegistry {
getProviders(): IRasterLayerGalleryEntry[];
registerProvider(data: IRasterLayerGalleryEntry): void;
getRegistryLayers(): IRasterLayerGalleryEntry[];
addRegistryLayer(data: IRasterLayerGalleryEntry): void;
removeRegistryLayer(name: string): void;
clearRegistry(): void;
}
6 changes: 3 additions & 3 deletions python/jupytergis_core/src/layerBrowserRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a92a688

Please sign in to comment.