@jupytergis/schema 0.13.2 → 0.14.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/_interface/forms.json +17 -18
- package/lib/_interface/project/layers/storySegmentLayer.d.ts +6 -0
- package/lib/_interface/project/sources/geoJsonSource.d.ts +1 -5
- package/lib/_interface/project/sources/rasterSource.d.ts +10 -7
- package/lib/doc.d.ts +14 -0
- package/lib/doc.js +45 -0
- package/lib/interfaces.d.ts +6 -2
- package/lib/model.d.ts +5 -8
- package/lib/model.js +15 -17
- package/lib/schema/project/layers/storySegmentLayer.json +5 -0
- package/lib/schema/project/layers/vectorLayer.json +1 -3
- package/lib/schema/project/layers/webGlLayer.json +2 -2
- package/lib/schema/project/sources/geoJsonSource.json +2 -9
- package/lib/schema/project/sources/rasterSource.json +3 -2
- package/lib/schema/project/sources/vectorTileSource.json +1 -2
- package/package.json +1 -1
|
@@ -413,6 +413,11 @@
|
|
|
413
413
|
"type": "object",
|
|
414
414
|
"description": "The color/style override",
|
|
415
415
|
"default": {}
|
|
416
|
+
},
|
|
417
|
+
"sourceProperties": {
|
|
418
|
+
"type": "object",
|
|
419
|
+
"description": "The symbology source override",
|
|
420
|
+
"default": {}
|
|
416
421
|
}
|
|
417
422
|
}
|
|
418
423
|
},
|
|
@@ -461,8 +466,7 @@
|
|
|
461
466
|
"default": "Single Symbol"
|
|
462
467
|
},
|
|
463
468
|
"value": {
|
|
464
|
-
"type": "string"
|
|
465
|
-
"default": ""
|
|
469
|
+
"type": "string"
|
|
466
470
|
},
|
|
467
471
|
"method": {
|
|
468
472
|
"type": "string",
|
|
@@ -499,7 +503,6 @@
|
|
|
499
503
|
"additionalProperties": false,
|
|
500
504
|
"default": {
|
|
501
505
|
"renderType": "Single Symbol",
|
|
502
|
-
"value": "",
|
|
503
506
|
"method": "color",
|
|
504
507
|
"colorRamp": "viridis",
|
|
505
508
|
"nClasses": "9",
|
|
@@ -663,7 +666,7 @@
|
|
|
663
666
|
"properties": {
|
|
664
667
|
"renderType": {
|
|
665
668
|
"type": "string",
|
|
666
|
-
"default": "
|
|
669
|
+
"default": "Singleband Pseudocolor"
|
|
667
670
|
},
|
|
668
671
|
"band": {
|
|
669
672
|
"type": "number",
|
|
@@ -714,7 +717,7 @@
|
|
|
714
717
|
},
|
|
715
718
|
"additionalProperties": false,
|
|
716
719
|
"default": {
|
|
717
|
-
"renderType": "
|
|
720
|
+
"renderType": "Singleband Pseudocolor",
|
|
718
721
|
"band": 1,
|
|
719
722
|
"redBand": 1,
|
|
720
723
|
"greenBand": 2,
|
|
@@ -921,8 +924,7 @@
|
|
|
921
924
|
"properties": {
|
|
922
925
|
"url": {
|
|
923
926
|
"type": "string",
|
|
924
|
-
"description": "The url to the tile provider"
|
|
925
|
-
"default": ""
|
|
927
|
+
"description": "The url to the tile provider"
|
|
926
928
|
},
|
|
927
929
|
"minZoom": {
|
|
928
930
|
"type": "number",
|
|
@@ -972,6 +974,7 @@
|
|
|
972
974
|
},
|
|
973
975
|
"urlParameters": {
|
|
974
976
|
"type": "object",
|
|
977
|
+
"title": "URL parameters",
|
|
975
978
|
"additionalProperties": {
|
|
976
979
|
"type": "string"
|
|
977
980
|
},
|
|
@@ -979,6 +982,7 @@
|
|
|
979
982
|
},
|
|
980
983
|
"interpolate": {
|
|
981
984
|
"type": "boolean",
|
|
985
|
+
"title": "Interpolate",
|
|
982
986
|
"description": "Interpolate between grid cells when overzooming?",
|
|
983
987
|
"default": false
|
|
984
988
|
}
|
|
@@ -1033,8 +1037,7 @@
|
|
|
1033
1037
|
"properties": {
|
|
1034
1038
|
"url": {
|
|
1035
1039
|
"type": "string",
|
|
1036
|
-
"description": "The url to the tile provider"
|
|
1037
|
-
"default": ""
|
|
1040
|
+
"description": "The url to the tile provider"
|
|
1038
1041
|
},
|
|
1039
1042
|
"minZoom": {
|
|
1040
1043
|
"type": "number",
|
|
@@ -1110,9 +1113,11 @@
|
|
|
1110
1113
|
"additionalProperties": false,
|
|
1111
1114
|
"properties": {
|
|
1112
1115
|
"path": {
|
|
1113
|
-
"type":
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
+
"type": [
|
|
1117
|
+
"string",
|
|
1118
|
+
"null"
|
|
1119
|
+
],
|
|
1120
|
+
"description": "The local path to a GeoJSON file"
|
|
1116
1121
|
},
|
|
1117
1122
|
"data": {
|
|
1118
1123
|
"type": "object",
|
|
@@ -2606,12 +2611,6 @@
|
|
|
2606
2611
|
}
|
|
2607
2612
|
}
|
|
2608
2613
|
]
|
|
2609
|
-
},
|
|
2610
|
-
"valid": {
|
|
2611
|
-
"type": "boolean",
|
|
2612
|
-
"description": "Whether the data are valid or not",
|
|
2613
|
-
"readOnly": true,
|
|
2614
|
-
"default": false
|
|
2615
2614
|
}
|
|
2616
2615
|
}
|
|
2617
2616
|
}
|
|
@@ -26,12 +26,8 @@ export interface IGeoJSONSource {
|
|
|
26
26
|
/**
|
|
27
27
|
* The local path to a GeoJSON file
|
|
28
28
|
*/
|
|
29
|
-
path?: string;
|
|
29
|
+
path?: string | null;
|
|
30
30
|
data?: GeoJSON;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the data are valid or not
|
|
33
|
-
*/
|
|
34
|
-
valid?: boolean;
|
|
35
31
|
}
|
|
36
32
|
export interface GeoJSONPoint {
|
|
37
33
|
type: "Point";
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* and run json-schema-to-typescript to regenerate this file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Interpolate between grid cells when overzooming?
|
|
10
|
+
*/
|
|
11
|
+
export type Interpolate = boolean;
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* RasterSource
|
|
10
15
|
*/
|
|
@@ -37,11 +42,9 @@ export interface IRasterSource {
|
|
|
37
42
|
* The bounds of the source
|
|
38
43
|
*/
|
|
39
44
|
bounds?: number[][];
|
|
40
|
-
urlParameters?:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
interpolate?: boolean;
|
|
45
|
+
urlParameters?: URLParameters;
|
|
46
|
+
interpolate?: Interpolate;
|
|
47
|
+
}
|
|
48
|
+
export interface URLParameters {
|
|
49
|
+
[k: string]: string;
|
|
47
50
|
}
|
package/lib/doc.d.ts
CHANGED
|
@@ -3,8 +3,12 @@ import { JSONObject } from '@lumino/coreutils';
|
|
|
3
3
|
import { ISignal } from '@lumino/signaling';
|
|
4
4
|
import { IJGISLayer, IJGISLayerItem, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources, IJGISStoryMap } from './_interface/project/jgis';
|
|
5
5
|
import { IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJGISStoryMapDocChange, IJGISStoryMaps, IJupyterGISDoc, IJupyterGISDocChange } from './interfaces';
|
|
6
|
+
/** Default JSON content for a new JupyterGIS document. */
|
|
7
|
+
export declare const DEFAULT_JGIS_DOCUMENT_CONTENT = "{\n\t\"schemaVersion\": \"0.5.0\",\n\t\"layers\": {},\n\t\"sources\": {},\n\t\"options\": {\"latitude\": 0, \"longitude\": 0, \"zoom\": 0, \"bearing\": 0, \"pitch\": 0, \"projection\": \"EPSG:3857\", \"storyMapPresentationMode\": false},\n\t\"layerTree\": [],\n\t\"metadata\": {}\n}";
|
|
6
8
|
export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> implements IJupyterGISDoc {
|
|
7
9
|
constructor();
|
|
10
|
+
get initialSyncReady(): Promise<void>;
|
|
11
|
+
private _onOptionsObserverFired;
|
|
8
12
|
getSource(): JSONObject;
|
|
9
13
|
setSource(value: JSONObject | string): void;
|
|
10
14
|
dispose(): void;
|
|
@@ -19,6 +23,13 @@ export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> imple
|
|
|
19
23
|
set layerTree(layerTree: IJGISLayerTree);
|
|
20
24
|
getLayer(id: string): IJGISLayer | undefined;
|
|
21
25
|
getLayerSource(id: string): IJGISSource | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Get the list of layers using a source.
|
|
28
|
+
*
|
|
29
|
+
* @param id - the source id.
|
|
30
|
+
* @returns a list of layer ids that use the source.
|
|
31
|
+
*/
|
|
32
|
+
getLayersBySource(id: string): string[];
|
|
22
33
|
set options(options: IJGISOptions);
|
|
23
34
|
get options(): IJGISOptions;
|
|
24
35
|
get layersChanged(): ISignal<IJupyterGISDoc, IJGISLayerDocChange>;
|
|
@@ -74,4 +85,7 @@ export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> imple
|
|
|
74
85
|
private _sourcesChanged;
|
|
75
86
|
private _storyMapsChanged;
|
|
76
87
|
private _metadataChanged;
|
|
88
|
+
private _initialSyncReadyPromise;
|
|
89
|
+
private _initialSyncReadyResolve;
|
|
90
|
+
private _initialSyncResolved;
|
|
77
91
|
}
|
package/lib/doc.js
CHANGED
|
@@ -2,6 +2,15 @@ import { YDocument } from '@jupyter/ydoc';
|
|
|
2
2
|
import { JSONExt } from '@lumino/coreutils';
|
|
3
3
|
import { Signal } from '@lumino/signaling';
|
|
4
4
|
import { SCHEMA_VERSION } from './_interface/version';
|
|
5
|
+
/** Default JSON content for a new JupyterGIS document. */
|
|
6
|
+
export const DEFAULT_JGIS_DOCUMENT_CONTENT = `{
|
|
7
|
+
"schemaVersion": "${SCHEMA_VERSION}",
|
|
8
|
+
"layers": {},
|
|
9
|
+
"sources": {},
|
|
10
|
+
"options": {"latitude": 0, "longitude": 0, "zoom": 0, "bearing": 0, "pitch": 0, "projection": "EPSG:3857", "storyMapPresentationMode": false},
|
|
11
|
+
"layerTree": [],
|
|
12
|
+
"metadata": {}
|
|
13
|
+
}`;
|
|
5
14
|
export class JupyterGISDoc extends YDocument {
|
|
6
15
|
constructor() {
|
|
7
16
|
super();
|
|
@@ -16,6 +25,7 @@ export class JupyterGISDoc extends YDocument {
|
|
|
16
25
|
});
|
|
17
26
|
});
|
|
18
27
|
this._optionsChanged.emit(changes);
|
|
28
|
+
this._onOptionsObserverFired();
|
|
19
29
|
};
|
|
20
30
|
this._metaObserver = (event) => {
|
|
21
31
|
const changes = new Map();
|
|
@@ -34,6 +44,7 @@ export class JupyterGISDoc extends YDocument {
|
|
|
34
44
|
this._sourcesChanged = new Signal(this);
|
|
35
45
|
this._storyMapsChanged = new Signal(this);
|
|
36
46
|
this._metadataChanged = new Signal(this);
|
|
47
|
+
this._initialSyncResolved = false;
|
|
37
48
|
this._options = this.ydoc.getMap('options');
|
|
38
49
|
this._layers = this.ydoc.getMap('layers');
|
|
39
50
|
this._layerTree = this.ydoc.getArray('layerTree');
|
|
@@ -44,6 +55,9 @@ export class JupyterGISDoc extends YDocument {
|
|
|
44
55
|
this.undoManager.addToScope(this._sources);
|
|
45
56
|
this.undoManager.addToScope(this._stories);
|
|
46
57
|
this.undoManager.addToScope(this._layerTree);
|
|
58
|
+
this._initialSyncReadyPromise = new Promise(resolve => {
|
|
59
|
+
this._initialSyncReadyResolve = resolve;
|
|
60
|
+
});
|
|
47
61
|
this._layers.observeDeep(this._layersObserver.bind(this));
|
|
48
62
|
this._layerTree.observe(this._layerTreeObserver.bind(this));
|
|
49
63
|
this._sources.observeDeep(this._sourcesObserver.bind(this));
|
|
@@ -51,6 +65,16 @@ export class JupyterGISDoc extends YDocument {
|
|
|
51
65
|
this._options.observe(this._optionsObserver.bind(this));
|
|
52
66
|
this._metadata.observe(this._metaObserver.bind(this));
|
|
53
67
|
}
|
|
68
|
+
get initialSyncReady() {
|
|
69
|
+
return this._initialSyncReadyPromise;
|
|
70
|
+
}
|
|
71
|
+
_onOptionsObserverFired() {
|
|
72
|
+
if (this._initialSyncResolved) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this._initialSyncResolved = true;
|
|
76
|
+
this._initialSyncReadyResolve();
|
|
77
|
+
}
|
|
54
78
|
getSource() {
|
|
55
79
|
const layers = this._layers.toJSON();
|
|
56
80
|
const layerTree = this._layerTree.toJSON();
|
|
@@ -143,6 +167,22 @@ export class JupyterGISDoc extends YDocument {
|
|
|
143
167
|
}
|
|
144
168
|
return JSONExt.deepCopy(this._sources.get(id));
|
|
145
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Get the list of layers using a source.
|
|
172
|
+
*
|
|
173
|
+
* @param id - the source id.
|
|
174
|
+
* @returns a list of layer ids that use the source.
|
|
175
|
+
*/
|
|
176
|
+
getLayersBySource(id) {
|
|
177
|
+
const usingLayers = [];
|
|
178
|
+
Object.entries(this.layers || {}).forEach(([layerId, layer]) => {
|
|
179
|
+
var _a;
|
|
180
|
+
if (((_a = layer.parameters) === null || _a === void 0 ? void 0 : _a.source) === id) {
|
|
181
|
+
usingLayers.push(layerId);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return usingLayers;
|
|
185
|
+
}
|
|
146
186
|
set options(options) {
|
|
147
187
|
this.transact(() => {
|
|
148
188
|
for (const [key, value] of Object.entries(options)) {
|
|
@@ -225,6 +265,11 @@ export class JupyterGISDoc extends YDocument {
|
|
|
225
265
|
return Boolean(this._getSourceAsYMap(id));
|
|
226
266
|
}
|
|
227
267
|
removeSource(id) {
|
|
268
|
+
const layersUsingSource = this.getLayersBySource(id);
|
|
269
|
+
if (layersUsingSource.length > 0) {
|
|
270
|
+
console.debug(`Skipping source removal: source ${id} still used by layers: ${layersUsingSource.join(', ')}`);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
228
273
|
this.transact(() => {
|
|
229
274
|
this._sources.delete(id);
|
|
230
275
|
});
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
|
|
|
106
106
|
updateLayer(id: string, value: IJGISLayer): void;
|
|
107
107
|
sourceExists(id: string): boolean;
|
|
108
108
|
getLayerSource(id: string): IJGISSource | undefined;
|
|
109
|
+
getLayersBySource(id: string): string[];
|
|
109
110
|
removeSource(id: string): void;
|
|
110
111
|
addSource(id: string, value: IJGISSource): void;
|
|
111
112
|
updateSource(id: string, value: IJGISSource): void;
|
|
@@ -128,6 +129,7 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
|
|
|
128
129
|
storyMapsChanged: ISignal<IJupyterGISDoc, IJGISStoryMapDocChange>;
|
|
129
130
|
layerTreeChanged: ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
|
|
130
131
|
metadataChanged: ISignal<IJupyterGISDoc, MapChange>;
|
|
132
|
+
initialSyncReady: Promise<void>;
|
|
131
133
|
}
|
|
132
134
|
export interface IJupyterGISDocChange extends DocumentChange {
|
|
133
135
|
contextChange?: MapChange;
|
|
@@ -179,15 +181,16 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
179
181
|
getContent(): IJGISContent;
|
|
180
182
|
getLayers(): IJGISLayers;
|
|
181
183
|
getLayer(id: string): IJGISLayer | undefined;
|
|
184
|
+
getLayerOrSource(id: string): IJGISLayer | IJGISSource | undefined;
|
|
182
185
|
getSources(): IJGISSources;
|
|
183
186
|
getSource(id: string): IJGISSource | undefined;
|
|
184
187
|
getSourcesByType(type: SourceType): {
|
|
185
188
|
[key: string]: string;
|
|
186
189
|
};
|
|
187
|
-
getLayersBySource(id: string): string[];
|
|
188
190
|
getLayerTree(): IJGISLayerTree;
|
|
189
191
|
addLayer(id: string, layer: IJGISLayer, groupName?: string, position?: number): void;
|
|
190
192
|
removeLayer(id: string): void;
|
|
193
|
+
removeSource(id: string): void;
|
|
191
194
|
getOptions(): IJGISOptions;
|
|
192
195
|
setOptions(value: IJGISOptions): void;
|
|
193
196
|
removeLayerGroup(groupName: string): void;
|
|
@@ -225,7 +228,7 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
225
228
|
isTemporalControllerActive: boolean;
|
|
226
229
|
toggleTemporalController(): void;
|
|
227
230
|
addFeatureAsMs(id: string, selectedFeature: string): void;
|
|
228
|
-
triggerLayerUpdate(layerId: string,
|
|
231
|
+
triggerLayerUpdate(layerId: string, layerOrSource: IJGISLayer | IJGISSource): void;
|
|
229
232
|
disposed: ISignal<any, void>;
|
|
230
233
|
getSelectedStory(): {
|
|
231
234
|
storyId: string;
|
|
@@ -233,6 +236,7 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
233
236
|
};
|
|
234
237
|
getCurrentSegmentIndex(): number;
|
|
235
238
|
setCurrentSegmentIndex(index: number): void;
|
|
239
|
+
currentSegmentIndexChanged: ISignal<IJupyterGISModel, number>;
|
|
236
240
|
addStorySegment(): {
|
|
237
241
|
storySegmentId: string;
|
|
238
242
|
storyId: string;
|
package/lib/model.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
94
94
|
getSources(): IJGISSources;
|
|
95
95
|
getLayerTree(): IJGISLayerTree;
|
|
96
96
|
getLayer(id: string): IJGISLayer | undefined;
|
|
97
|
+
getLayerOrSource(id: string): IJGISLayer | IJGISSource | undefined;
|
|
97
98
|
getSource(id: string): IJGISSource | undefined;
|
|
98
99
|
/**
|
|
99
100
|
* Get a {[key: id]: name} dictionary of sources for a given source type
|
|
@@ -102,13 +103,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
102
103
|
getSourcesByType(type: string): {
|
|
103
104
|
[key: string]: string;
|
|
104
105
|
};
|
|
105
|
-
/**
|
|
106
|
-
* Get the list of layers using a source.
|
|
107
|
-
*
|
|
108
|
-
* @param id - the source id.
|
|
109
|
-
* @returns a list of layer ids that use the source.
|
|
110
|
-
*/
|
|
111
|
-
getLayersBySource(id: string): string[];
|
|
112
106
|
/**
|
|
113
107
|
* Add a layer group in the layer tree.
|
|
114
108
|
*
|
|
@@ -131,6 +125,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
131
125
|
*/
|
|
132
126
|
addLayer(id: string, layer: IJGISLayer, groupName?: string, position?: number): void;
|
|
133
127
|
removeLayer(layer_id: string): void;
|
|
128
|
+
removeSource(sourceId: string): void;
|
|
134
129
|
setOptions(value: IJGISOptions): void;
|
|
135
130
|
getOptions(): IJGISOptions;
|
|
136
131
|
syncViewport(viewport?: IViewPortState, emitter?: string): void;
|
|
@@ -180,6 +175,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
180
175
|
* Set current slide index for the selected story.
|
|
181
176
|
*/
|
|
182
177
|
setCurrentSegmentIndex(index: number): void;
|
|
178
|
+
get currentSegmentIndexChanged(): ISignal<this, number>;
|
|
183
179
|
/**
|
|
184
180
|
* Adds a story segment from the current map view
|
|
185
181
|
* @returns Object with storySegmentId and storyMapId, or null if no extent/zoom found
|
|
@@ -226,7 +222,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
226
222
|
addFeatureAsMs: (id: string, selectedFeature: string) => void;
|
|
227
223
|
get addFeatureAsMsSignal(): Signal<this, string>;
|
|
228
224
|
get updateLayerSignal(): Signal<this, string>;
|
|
229
|
-
triggerLayerUpdate: (layerId: string, layer: IJGISLayer) => void;
|
|
225
|
+
triggerLayerUpdate: (layerId: string, layer: IJGISLayer | IJGISSource) => void;
|
|
230
226
|
get geolocation(): JgisCoordinates;
|
|
231
227
|
set geolocation(geolocation: JgisCoordinates);
|
|
232
228
|
get geolocationChanged(): Signal<this, JgisCoordinates>;
|
|
@@ -265,6 +261,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
265
261
|
private _geolocationChanged;
|
|
266
262
|
private _tileFeatureCache;
|
|
267
263
|
private _currentSegmentIndex;
|
|
264
|
+
private _currentSegmentIndexChanged;
|
|
268
265
|
stories: Map<string, IJGISStoryMap>;
|
|
269
266
|
}
|
|
270
267
|
export declare namespace JupyterGISModel {
|
package/lib/model.js
CHANGED
|
@@ -64,6 +64,7 @@ export class JupyterGISModel {
|
|
|
64
64
|
this._editingChanged = new Signal(this);
|
|
65
65
|
this._geolocationChanged = new Signal(this);
|
|
66
66
|
this._tileFeatureCache = new Map();
|
|
67
|
+
this._currentSegmentIndexChanged = new Signal(this);
|
|
67
68
|
this.stories = new Map();
|
|
68
69
|
const { annotationModel, sharedModel, settingRegistry } = options;
|
|
69
70
|
if (sharedModel) {
|
|
@@ -339,6 +340,10 @@ export class JupyterGISModel {
|
|
|
339
340
|
getLayer(id) {
|
|
340
341
|
return this.sharedModel.getLayer(id);
|
|
341
342
|
}
|
|
343
|
+
getLayerOrSource(id) {
|
|
344
|
+
var _a;
|
|
345
|
+
return (_a = this.sharedModel.getLayer(id)) !== null && _a !== void 0 ? _a : this.sharedModel.getLayerSource(id);
|
|
346
|
+
}
|
|
342
347
|
getSource(id) {
|
|
343
348
|
return this.sharedModel.getLayerSource(id);
|
|
344
349
|
}
|
|
@@ -356,22 +361,6 @@ export class JupyterGISModel {
|
|
|
356
361
|
}
|
|
357
362
|
return sources;
|
|
358
363
|
}
|
|
359
|
-
/**
|
|
360
|
-
* Get the list of layers using a source.
|
|
361
|
-
*
|
|
362
|
-
* @param id - the source id.
|
|
363
|
-
* @returns a list of layer ids that use the source.
|
|
364
|
-
*/
|
|
365
|
-
getLayersBySource(id) {
|
|
366
|
-
const usingLayers = [];
|
|
367
|
-
Object.entries(this.getLayers() || {}).forEach(([layerId, layer]) => {
|
|
368
|
-
var _a;
|
|
369
|
-
if (((_a = layer.parameters) === null || _a === void 0 ? void 0 : _a.source) === id) {
|
|
370
|
-
usingLayers.push(layerId);
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
return usingLayers;
|
|
374
|
-
}
|
|
375
364
|
/**
|
|
376
365
|
* Add a layer group in the layer tree.
|
|
377
366
|
*
|
|
@@ -427,9 +416,14 @@ export class JupyterGISModel {
|
|
|
427
416
|
});
|
|
428
417
|
}
|
|
429
418
|
else {
|
|
430
|
-
|
|
419
|
+
if (source_id) {
|
|
420
|
+
this.removeSource(source_id);
|
|
421
|
+
}
|
|
431
422
|
}
|
|
432
423
|
}
|
|
424
|
+
removeSource(sourceId) {
|
|
425
|
+
this.sharedModel.removeSource(sourceId);
|
|
426
|
+
}
|
|
433
427
|
setOptions(value) {
|
|
434
428
|
this._sharedModel.options = value;
|
|
435
429
|
}
|
|
@@ -525,6 +519,10 @@ export class JupyterGISModel {
|
|
|
525
519
|
*/
|
|
526
520
|
setCurrentSegmentIndex(index) {
|
|
527
521
|
this._currentSegmentIndex = index;
|
|
522
|
+
this._currentSegmentIndexChanged.emit(index);
|
|
523
|
+
}
|
|
524
|
+
get currentSegmentIndexChanged() {
|
|
525
|
+
return this._currentSegmentIndexChanged;
|
|
528
526
|
}
|
|
529
527
|
/**
|
|
530
528
|
* Adds a story segment from the current map view
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"default": "Single Symbol"
|
|
34
34
|
},
|
|
35
35
|
"value": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
"default": ""
|
|
36
|
+
"type": "string"
|
|
38
37
|
},
|
|
39
38
|
"method": {
|
|
40
39
|
"type": "string",
|
|
@@ -68,7 +67,6 @@
|
|
|
68
67
|
"additionalProperties": false,
|
|
69
68
|
"default": {
|
|
70
69
|
"renderType": "Single Symbol",
|
|
71
|
-
"value": "",
|
|
72
70
|
"method": "color",
|
|
73
71
|
"colorRamp": "viridis",
|
|
74
72
|
"nClasses": "9",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"properties": {
|
|
56
56
|
"renderType": {
|
|
57
57
|
"type": "string",
|
|
58
|
-
"default": "
|
|
58
|
+
"default": "Singleband Pseudocolor"
|
|
59
59
|
},
|
|
60
60
|
"band": {
|
|
61
61
|
"type": "number",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
"additionalProperties": false,
|
|
100
100
|
"default": {
|
|
101
|
-
"renderType": "
|
|
101
|
+
"renderType": "Singleband Pseudocolor",
|
|
102
102
|
"band": 1,
|
|
103
103
|
"redBand": 1,
|
|
104
104
|
"greenBand": 2,
|
|
@@ -6,20 +6,13 @@
|
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"properties": {
|
|
8
8
|
"path": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "The local path to a GeoJSON file"
|
|
11
|
-
"default": ""
|
|
9
|
+
"type": ["string", "null"],
|
|
10
|
+
"description": "The local path to a GeoJSON file"
|
|
12
11
|
},
|
|
13
12
|
"data": {
|
|
14
13
|
"type": "object",
|
|
15
14
|
"description": "The GeoJSON data",
|
|
16
15
|
"$ref": "./geojson.json"
|
|
17
|
-
},
|
|
18
|
-
"valid": {
|
|
19
|
-
"type": "boolean",
|
|
20
|
-
"description": "Whether the data are valid or not",
|
|
21
|
-
"readOnly": true,
|
|
22
|
-
"default": false
|
|
23
16
|
}
|
|
24
17
|
}
|
|
25
18
|
}
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
"properties": {
|
|
8
8
|
"url": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The url to the tile provider"
|
|
11
|
-
"default": ""
|
|
10
|
+
"description": "The url to the tile provider"
|
|
12
11
|
},
|
|
13
12
|
"minZoom": {
|
|
14
13
|
"type": "number",
|
|
@@ -58,6 +57,7 @@
|
|
|
58
57
|
},
|
|
59
58
|
"urlParameters": {
|
|
60
59
|
"type": "object",
|
|
60
|
+
"title": "URL parameters",
|
|
61
61
|
"additionalProperties": {
|
|
62
62
|
"type": "string"
|
|
63
63
|
},
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"interpolate": {
|
|
67
67
|
"type": "boolean",
|
|
68
|
+
"title": "Interpolate",
|
|
68
69
|
"description": "Interpolate between grid cells when overzooming?",
|
|
69
70
|
"default": false
|
|
70
71
|
}
|