-
Notifications
You must be signed in to change notification settings - Fork 74
Auto zoom when adding a layer from the UI #1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
eed1613
350a39f
18eaf79
b3d79fa
e18331c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -500,6 +500,7 @@ export class JupyterGISModel implements IJupyterGISModel { | |
| ): void { | ||
| if (!this.getLayer(id)) { | ||
| this.sharedModel.addLayer(id, layer); | ||
| this.syncLastAddedLayer(id); | ||
| } | ||
|
|
||
| this._addLayerTreeItem(id, groupName, position); | ||
|
|
@@ -585,6 +586,12 @@ export class JupyterGISModel implements IJupyterGISModel { | |
| }); | ||
| } | ||
|
|
||
| syncLastAddedLayer(layerId: string): void { | ||
| this.sharedModel.awareness.setLocalStateField('lastAddedLayer', { | ||
| layerId, | ||
| clientId: this.getClientId(), | ||
| }); | ||
| } | ||
|
Comment on lines
+582
to
+593
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you double check why we don't need to inject
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK let me check this one 👍
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes we can get rid of manually adding |
||
| get selected(): { [key: string]: ISelection } | undefined { | ||
| return this.localState?.selected?.value; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.