@jupytergis/schema 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/interfaces.d.ts +13 -2
- package/lib/model.d.ts +15 -4
- package/lib/model.js +93 -15
- package/package.json +1 -1
package/lib/interfaces.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IChangedArgs } from '@jupyterlab/coreutils';
|
|
|
4
4
|
import { IDocumentManager } from '@jupyterlab/docmanager';
|
|
5
5
|
import { DocumentRegistry, IDocumentWidget } from '@jupyterlab/docregistry';
|
|
6
6
|
import { Contents, User } from '@jupyterlab/services';
|
|
7
|
+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
7
8
|
import { JSONObject } from '@lumino/coreutils';
|
|
8
9
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
9
10
|
import { SplitPanel } from '@lumino/widgets';
|
|
@@ -132,6 +133,7 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
132
133
|
geolocation: JgisCoordinates;
|
|
133
134
|
localState: IJupyterGISClientState | null;
|
|
134
135
|
annotationModel?: IAnnotationModel;
|
|
136
|
+
currentMode: 'panning' | 'identifying';
|
|
135
137
|
themeChanged: Signal<IJupyterGISModel, IChangedArgs<string, string | null, string>>;
|
|
136
138
|
clientStateChanged: ISignal<IJupyterGISModel, Map<number, IJupyterGISClientState>>;
|
|
137
139
|
sharedOptionsChanged: ISignal<IJupyterGISDoc, MapChange>;
|
|
@@ -156,7 +158,9 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
156
158
|
sourceId: string;
|
|
157
159
|
features: FeatureLike[];
|
|
158
160
|
}) => void;
|
|
159
|
-
getSettings():
|
|
161
|
+
getSettings(): Promise<ISettingRegistry.ISettings>;
|
|
162
|
+
settingsChanged: ISignal<IJupyterGISModel, string>;
|
|
163
|
+
jgisSettings: IJupyterGISSettings;
|
|
160
164
|
getContent(): IJGISContent;
|
|
161
165
|
getLayers(): IJGISLayers;
|
|
162
166
|
getLayer(id: string): IJGISLayer | undefined;
|
|
@@ -190,7 +194,6 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
190
194
|
removeMetadata(key: string): void;
|
|
191
195
|
centerOnPosition(id: string): void;
|
|
192
196
|
toggleIdentify(): void;
|
|
193
|
-
isIdentifying: boolean;
|
|
194
197
|
isTemporalControllerActive: boolean;
|
|
195
198
|
toggleTemporalController(): void;
|
|
196
199
|
addFeatureAsMs(id: string, selectedFeature: string): void;
|
|
@@ -292,4 +295,12 @@ export interface IAnnotation {
|
|
|
292
295
|
}
|
|
293
296
|
export interface IJupyterGISSettings {
|
|
294
297
|
proxyUrl: string;
|
|
298
|
+
leftPanelDisabled?: boolean;
|
|
299
|
+
rightPanelDisabled?: boolean;
|
|
300
|
+
layersDisabled?: boolean;
|
|
301
|
+
stacBrowserDisabled?: boolean;
|
|
302
|
+
filtersDisabled?: boolean;
|
|
303
|
+
objectPropertiesDisabled?: boolean;
|
|
304
|
+
annotationsDisabled?: boolean;
|
|
305
|
+
identifyDisabled?: boolean;
|
|
295
306
|
}
|
package/lib/model.d.ts
CHANGED
|
@@ -14,7 +14,16 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
14
14
|
* Initialize custom settings for JupyterLab.
|
|
15
15
|
*/
|
|
16
16
|
initSettings(): Promise<void>;
|
|
17
|
-
|
|
17
|
+
private _updateLocalSettings;
|
|
18
|
+
get jgisSettings(): IJupyterGISSettings;
|
|
19
|
+
/**
|
|
20
|
+
* Expose the settingsChanged signal for external use.
|
|
21
|
+
*/
|
|
22
|
+
get settingsChanged(): ISignal<JupyterGISModel, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Return stored settings.
|
|
25
|
+
*/
|
|
26
|
+
getSettings(): Promise<ISettingRegistry.ISettings>;
|
|
18
27
|
getFeaturesForCurrentTile({ sourceId }: {
|
|
19
28
|
sourceId: string;
|
|
20
29
|
}): FeatureLike[];
|
|
@@ -46,8 +55,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
46
55
|
get disposed(): ISignal<JupyterGISModel, void>;
|
|
47
56
|
get sharedMetadataChanged(): ISignal<this, MapChange>;
|
|
48
57
|
get zoomToPositionSignal(): ISignal<this, string>;
|
|
49
|
-
set isIdentifying(isIdentifying: boolean);
|
|
50
|
-
get isIdentifying(): boolean;
|
|
51
58
|
set isTemporalControllerActive(isActive: boolean);
|
|
52
59
|
get isTemporalControllerActive(): boolean;
|
|
53
60
|
centerOnPosition(id: string): void;
|
|
@@ -154,6 +161,8 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
154
161
|
renameLayerGroup(groupName: string, newName: string): void;
|
|
155
162
|
removeLayerGroup(groupName: string): void;
|
|
156
163
|
toggleIdentify(): void;
|
|
164
|
+
get currentMode(): 'panning' | 'identifying';
|
|
165
|
+
set currentMode(value: 'panning' | 'identifying');
|
|
157
166
|
toggleTemporalController(): void;
|
|
158
167
|
private _getLayerTreeInfo;
|
|
159
168
|
private _onClientStateChanged;
|
|
@@ -169,6 +178,9 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
169
178
|
readonly annotationModel?: IAnnotationModel;
|
|
170
179
|
readonly settingRegistry?: ISettingRegistry;
|
|
171
180
|
private _settings;
|
|
181
|
+
private _settingsChanged;
|
|
182
|
+
private _jgisSettings;
|
|
183
|
+
private _currentMode;
|
|
172
184
|
private _sharedModel;
|
|
173
185
|
private _filePath;
|
|
174
186
|
private _contentsManager?;
|
|
@@ -187,7 +199,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
187
199
|
private _zoomToPositionSignal;
|
|
188
200
|
private _addFeatureAsMsSignal;
|
|
189
201
|
private _updateLayerSignal;
|
|
190
|
-
private _isIdentifying;
|
|
191
202
|
private _isTemporalControllerActive;
|
|
192
203
|
static worker: Worker;
|
|
193
204
|
private _geolocation;
|
package/lib/model.js
CHANGED
|
@@ -44,7 +44,6 @@ export class JupyterGISModel {
|
|
|
44
44
|
this._zoomToPositionSignal = new Signal(this);
|
|
45
45
|
this._addFeatureAsMsSignal = new Signal(this);
|
|
46
46
|
this._updateLayerSignal = new Signal(this);
|
|
47
|
-
this._isIdentifying = false;
|
|
48
47
|
this._isTemporalControllerActive = false;
|
|
49
48
|
this._geolocationChanged = new Signal(this);
|
|
50
49
|
this._tileFeatureCache = new Map();
|
|
@@ -61,21 +60,95 @@ export class JupyterGISModel {
|
|
|
61
60
|
this.annotationModel = annotationModel;
|
|
62
61
|
this.settingRegistry = settingRegistry;
|
|
63
62
|
this._pathChanged = new Signal(this);
|
|
63
|
+
this._settingsChanged = new Signal(this);
|
|
64
|
+
this._jgisSettings = {
|
|
65
|
+
proxyUrl: 'https://corsproxy.io',
|
|
66
|
+
leftPanelDisabled: false,
|
|
67
|
+
rightPanelDisabled: false,
|
|
68
|
+
layersDisabled: false,
|
|
69
|
+
stacBrowserDisabled: false,
|
|
70
|
+
filtersDisabled: false,
|
|
71
|
+
objectPropertiesDisabled: false,
|
|
72
|
+
annotationsDisabled: false,
|
|
73
|
+
identifyDisabled: false,
|
|
74
|
+
};
|
|
75
|
+
this.initSettings();
|
|
64
76
|
}
|
|
65
77
|
/**
|
|
66
78
|
* Initialize custom settings for JupyterLab.
|
|
67
79
|
*/
|
|
68
80
|
async initSettings() {
|
|
69
81
|
if (this.settingRegistry) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
try {
|
|
83
|
+
const setting = await this.settingRegistry.load(SETTINGS_ID);
|
|
84
|
+
this._settings = setting;
|
|
85
|
+
this._updateLocalSettings();
|
|
86
|
+
setting.changed.connect(() => {
|
|
87
|
+
const oldSettings = Object.assign({}, this._jgisSettings);
|
|
88
|
+
this._updateLocalSettings();
|
|
89
|
+
const newSettings = this._jgisSettings;
|
|
90
|
+
const keys = [
|
|
91
|
+
'proxyUrl',
|
|
92
|
+
'leftPanelDisabled',
|
|
93
|
+
'rightPanelDisabled',
|
|
94
|
+
'layersDisabled',
|
|
95
|
+
'stacBrowserDisabled',
|
|
96
|
+
'filtersDisabled',
|
|
97
|
+
'objectPropertiesDisabled',
|
|
98
|
+
'annotationsDisabled',
|
|
99
|
+
'identifyDisabled',
|
|
100
|
+
];
|
|
101
|
+
keys.forEach(key => {
|
|
102
|
+
if (oldSettings[key] !== newSettings[key]) {
|
|
103
|
+
this._settingsChanged.emit(key);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error(`Failed to load settings for ${SETTINGS_ID}:`, error);
|
|
110
|
+
this._jgisSettings = {
|
|
111
|
+
proxyUrl: 'https://corsproxy.io',
|
|
112
|
+
leftPanelDisabled: false,
|
|
113
|
+
rightPanelDisabled: false,
|
|
114
|
+
layersDisabled: false,
|
|
115
|
+
stacBrowserDisabled: false,
|
|
116
|
+
filtersDisabled: false,
|
|
117
|
+
objectPropertiesDisabled: false,
|
|
118
|
+
annotationsDisabled: false,
|
|
119
|
+
identifyDisabled: false,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
76
122
|
}
|
|
77
123
|
}
|
|
78
|
-
|
|
124
|
+
_updateLocalSettings() {
|
|
125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
|
+
const composite = this._settings.composite;
|
|
127
|
+
this._jgisSettings = {
|
|
128
|
+
proxyUrl: (_a = composite.proxyUrl) !== null && _a !== void 0 ? _a : 'https://corsproxy.io',
|
|
129
|
+
leftPanelDisabled: (_b = composite.leftPanelDisabled) !== null && _b !== void 0 ? _b : false,
|
|
130
|
+
rightPanelDisabled: (_c = composite.rightPanelDisabled) !== null && _c !== void 0 ? _c : false,
|
|
131
|
+
layersDisabled: (_d = composite.layersDisabled) !== null && _d !== void 0 ? _d : false,
|
|
132
|
+
stacBrowserDisabled: (_e = composite.stacBrowserDisabled) !== null && _e !== void 0 ? _e : false,
|
|
133
|
+
filtersDisabled: (_f = composite.filtersDisabled) !== null && _f !== void 0 ? _f : false,
|
|
134
|
+
objectPropertiesDisabled: (_g = composite.objectPropertiesDisabled) !== null && _g !== void 0 ? _g : false,
|
|
135
|
+
annotationsDisabled: (_h = composite.annotationsDisabled) !== null && _h !== void 0 ? _h : false,
|
|
136
|
+
identifyDisabled: (_j = composite.identifyDisabled) !== null && _j !== void 0 ? _j : false,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
get jgisSettings() {
|
|
140
|
+
return this._jgisSettings;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Expose the settingsChanged signal for external use.
|
|
144
|
+
*/
|
|
145
|
+
get settingsChanged() {
|
|
146
|
+
return this._settingsChanged;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Return stored settings.
|
|
150
|
+
*/
|
|
151
|
+
async getSettings() {
|
|
79
152
|
return this._settings;
|
|
80
153
|
}
|
|
81
154
|
getFeaturesForCurrentTile({ sourceId }) {
|
|
@@ -165,12 +238,6 @@ export class JupyterGISModel {
|
|
|
165
238
|
get zoomToPositionSignal() {
|
|
166
239
|
return this._zoomToPositionSignal;
|
|
167
240
|
}
|
|
168
|
-
set isIdentifying(isIdentifying) {
|
|
169
|
-
this._isIdentifying = isIdentifying;
|
|
170
|
-
}
|
|
171
|
-
get isIdentifying() {
|
|
172
|
-
return this._isIdentifying;
|
|
173
|
-
}
|
|
174
241
|
set isTemporalControllerActive(isActive) {
|
|
175
242
|
this._isTemporalControllerActive = isActive;
|
|
176
243
|
}
|
|
@@ -546,7 +613,18 @@ export class JupyterGISModel {
|
|
|
546
613
|
}
|
|
547
614
|
}
|
|
548
615
|
toggleIdentify() {
|
|
549
|
-
this.
|
|
616
|
+
if (this._currentMode === 'identifying') {
|
|
617
|
+
this._currentMode = 'panning';
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
this._currentMode = 'identifying';
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
get currentMode() {
|
|
624
|
+
return this._currentMode;
|
|
625
|
+
}
|
|
626
|
+
set currentMode(value) {
|
|
627
|
+
this._currentMode = value;
|
|
550
628
|
}
|
|
551
629
|
toggleTemporalController() {
|
|
552
630
|
this._isTemporalControllerActive = !this._isTemporalControllerActive;
|