@jupytergis/schema 0.12.0 → 0.12.2
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/project/jgis.d.ts +2 -2
- package/lib/interfaces.d.ts +20 -12
- package/lib/model.d.ts +14 -0
- package/lib/model.js +25 -0
- package/lib/schema/project/jgis.json +2 -2
- package/package.json +1 -1
|
@@ -172,7 +172,7 @@ export interface IJGISStoryMap {
|
|
|
172
172
|
* Array of story segments for the story map
|
|
173
173
|
*/
|
|
174
174
|
storySegments?: string[];
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
presentationBgColor?: PresentationBackgroundColor;
|
|
176
|
+
presentationTextColor?: PresentationTextColor;
|
|
177
177
|
[k: string]: any;
|
|
178
178
|
}
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -9,9 +9,8 @@ import { JSONObject } from '@lumino/coreutils';
|
|
|
9
9
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
10
10
|
import { SplitPanel } from '@lumino/widgets';
|
|
11
11
|
import { FeatureLike } from 'ol/Feature';
|
|
12
|
-
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, IJGISStoryMap, SourceType } from './_interface/project/jgis';
|
|
13
|
-
import { IRasterSource } from './
|
|
14
|
-
import { Modes } from './types';
|
|
12
|
+
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, IJGISStoryMap, LayerType, SourceType } from './_interface/project/jgis';
|
|
13
|
+
import { IGeoJSONSource, IGeoParquetSource, IGeoTiffSource, IHeatmapLayer, IHillshadeLayer, IImageLayer, IImageSource, IMarkerSource, IRasterDemSource, IRasterLayer, IRasterSource, IShapefileSource, IStacLayer, IStorySegmentLayer, IVectorLayer, IVectorTileLayer, IVectorTileSource, IVideoSource, IWebGlLayer, Modes } from './types';
|
|
15
14
|
export { IGeoJSONSource } from './_interface/project/sources/geoJsonSource';
|
|
16
15
|
export interface IJGISStoryMaps {
|
|
17
16
|
[k: string]: IJGISStoryMap;
|
|
@@ -232,10 +231,16 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
232
231
|
storyId: string;
|
|
233
232
|
story: IJGISStoryMap | undefined;
|
|
234
233
|
};
|
|
234
|
+
getCurrentSegmentIndex(): number;
|
|
235
|
+
setCurrentSegmentIndex(index: number): void;
|
|
235
236
|
addStorySegment(): {
|
|
236
237
|
storySegmentId: string;
|
|
237
238
|
storyId: string;
|
|
238
239
|
} | null;
|
|
240
|
+
segmentAdded: ISignal<IJupyterGISModel, {
|
|
241
|
+
storySegmentId: string;
|
|
242
|
+
storyId: string;
|
|
243
|
+
}>;
|
|
239
244
|
isSpectaMode(): boolean;
|
|
240
245
|
}
|
|
241
246
|
export interface IUserData {
|
|
@@ -286,20 +291,23 @@ export interface IJGISExternalCommandRegistry {
|
|
|
286
291
|
registerCommand(command: IJGISExternalCommand): void;
|
|
287
292
|
}
|
|
288
293
|
/**
|
|
289
|
-
* Defines the structure for entries in a
|
|
290
|
-
* Each entry consists of a name, a thumbnail URL, and source information.
|
|
291
|
-
* The source information is expected to conform to the IRasterSource interface.
|
|
294
|
+
* Defines the structure for entries in a layer gallery.
|
|
292
295
|
*
|
|
293
|
-
* @interface
|
|
296
|
+
* @interface ILayerGalleryEntry
|
|
294
297
|
*/
|
|
295
|
-
export
|
|
298
|
+
export type ILayerGalleryEntry = {
|
|
296
299
|
name: string;
|
|
297
300
|
thumbnail: string;
|
|
298
|
-
|
|
299
|
-
|
|
301
|
+
layerType: LayerType;
|
|
302
|
+
layerParameters: IHeatmapLayer | IHillshadeLayer | IImageLayer | IRasterLayer | IStacLayer | IStorySegmentLayer | IVectorLayer | IVectorTileLayer | IWebGlLayer;
|
|
303
|
+
sourceType: SourceType;
|
|
304
|
+
sourceParameters: IGeoJSONSource | IGeoParquetSource | IGeoTiffSource | IImageSource | IMarkerSource | IRasterDemSource | IRasterSource | IShapefileSource | IVectorTileSource | IVideoSource;
|
|
305
|
+
provider: string;
|
|
306
|
+
description: string;
|
|
307
|
+
};
|
|
300
308
|
export interface IJGISLayerBrowserRegistry {
|
|
301
|
-
getRegistryLayers():
|
|
302
|
-
addRegistryLayer(data:
|
|
309
|
+
getRegistryLayers(): ILayerGalleryEntry[];
|
|
310
|
+
addRegistryLayer(data: ILayerGalleryEntry): void;
|
|
303
311
|
removeRegistryLayer(name: string): void;
|
|
304
312
|
clearRegistry(): void;
|
|
305
313
|
}
|
package/lib/model.d.ts
CHANGED
|
@@ -172,6 +172,14 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
172
172
|
storyId: string;
|
|
173
173
|
story: IJGISStoryMap | undefined;
|
|
174
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* Current slide index for the selected story (0-based).
|
|
177
|
+
*/
|
|
178
|
+
getCurrentSegmentIndex(): number;
|
|
179
|
+
/**
|
|
180
|
+
* Set current slide index for the selected story.
|
|
181
|
+
*/
|
|
182
|
+
setCurrentSegmentIndex(index: number): void;
|
|
175
183
|
/**
|
|
176
184
|
* Adds a story segment from the current map view
|
|
177
185
|
* @returns Object with storySegmentId and storyMapId, or null if no extent/zoom found
|
|
@@ -180,6 +188,10 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
180
188
|
storySegmentId: string;
|
|
181
189
|
storyId: string;
|
|
182
190
|
} | null;
|
|
191
|
+
get segmentAdded(): ISignal<this, {
|
|
192
|
+
storySegmentId: string;
|
|
193
|
+
storyId: string;
|
|
194
|
+
}>;
|
|
183
195
|
/**
|
|
184
196
|
* Add an item in the layer tree.
|
|
185
197
|
*
|
|
@@ -243,6 +255,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
243
255
|
private _sharedMetadataChanged;
|
|
244
256
|
private _zoomToPositionSignal;
|
|
245
257
|
private _addFeatureAsMsSignal;
|
|
258
|
+
private _segmentAdded;
|
|
246
259
|
private _updateLayerSignal;
|
|
247
260
|
private _isTemporalControllerActive;
|
|
248
261
|
private _editing;
|
|
@@ -251,6 +264,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
251
264
|
private _geolocation;
|
|
252
265
|
private _geolocationChanged;
|
|
253
266
|
private _tileFeatureCache;
|
|
267
|
+
private _currentSegmentIndex;
|
|
254
268
|
stories: Map<string, IJGISStoryMap>;
|
|
255
269
|
}
|
|
256
270
|
export declare namespace JupyterGISModel {
|
package/lib/model.js
CHANGED
|
@@ -57,6 +57,7 @@ export class JupyterGISModel {
|
|
|
57
57
|
this._sharedMetadataChanged = new Signal(this);
|
|
58
58
|
this._zoomToPositionSignal = new Signal(this);
|
|
59
59
|
this._addFeatureAsMsSignal = new Signal(this);
|
|
60
|
+
this._segmentAdded = new Signal(this);
|
|
60
61
|
this._updateLayerSignal = new Signal(this);
|
|
61
62
|
this._isTemporalControllerActive = false;
|
|
62
63
|
this._editing = null;
|
|
@@ -407,6 +408,7 @@ export class JupyterGISModel {
|
|
|
407
408
|
this.sharedModel.addLayer(id, layer);
|
|
408
409
|
}
|
|
409
410
|
this._addLayerTreeItem(id, groupName, position);
|
|
411
|
+
this.syncSelected({ [id]: { type: 'layer' } }, this.getClientId().toString());
|
|
410
412
|
}
|
|
411
413
|
removeLayer(layer_id) {
|
|
412
414
|
var _a;
|
|
@@ -512,6 +514,18 @@ export class JupyterGISModel {
|
|
|
512
514
|
story: this.sharedModel.getStoryMap(storyId),
|
|
513
515
|
};
|
|
514
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Current slide index for the selected story (0-based).
|
|
519
|
+
*/
|
|
520
|
+
getCurrentSegmentIndex() {
|
|
521
|
+
return this._currentSegmentIndex;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Set current slide index for the selected story.
|
|
525
|
+
*/
|
|
526
|
+
setCurrentSegmentIndex(index) {
|
|
527
|
+
this._currentSegmentIndex = index;
|
|
528
|
+
}
|
|
515
529
|
/**
|
|
516
530
|
* Adds a story segment from the current map view
|
|
517
531
|
* @returns Object with storySegmentId and storyMapId, or null if no extent/zoom found
|
|
@@ -545,6 +559,10 @@ export class JupyterGISModel {
|
|
|
545
559
|
const storySegments = [newStorySegmentId];
|
|
546
560
|
const storyMap = { title, storyType, storySegments };
|
|
547
561
|
this.sharedModel.addStoryMap(storyId, storyMap);
|
|
562
|
+
this._segmentAdded.emit({
|
|
563
|
+
storySegmentId: newStorySegmentId,
|
|
564
|
+
storyId,
|
|
565
|
+
});
|
|
548
566
|
return { storySegmentId: newStorySegmentId, storyId };
|
|
549
567
|
}
|
|
550
568
|
else {
|
|
@@ -556,9 +574,16 @@ export class JupyterGISModel {
|
|
|
556
574
|
}
|
|
557
575
|
const newStory = Object.assign(Object.assign({}, story), { storySegments: [...((_a = story.storySegments) !== null && _a !== void 0 ? _a : []), newStorySegmentId] });
|
|
558
576
|
this.sharedModel.updateStoryMap(storyId, newStory);
|
|
577
|
+
this._segmentAdded.emit({
|
|
578
|
+
storySegmentId: newStorySegmentId,
|
|
579
|
+
storyId,
|
|
580
|
+
});
|
|
559
581
|
return { storySegmentId: newStorySegmentId, storyId };
|
|
560
582
|
}
|
|
561
583
|
}
|
|
584
|
+
get segmentAdded() {
|
|
585
|
+
return this._segmentAdded;
|
|
586
|
+
}
|
|
562
587
|
/**
|
|
563
588
|
* Add an item in the layer tree.
|
|
564
589
|
*
|
|
@@ -164,12 +164,12 @@
|
|
|
164
164
|
"type": "string"
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
|
-
"
|
|
167
|
+
"presentationBgColor": {
|
|
168
168
|
"type": "string",
|
|
169
169
|
"title": "Presentation Background Color",
|
|
170
170
|
"description": "The background color of the story map"
|
|
171
171
|
},
|
|
172
|
-
"
|
|
172
|
+
"presentationTextColor": {
|
|
173
173
|
"type": "string",
|
|
174
174
|
"title": "Presentation Text Color",
|
|
175
175
|
"description": "The text color of the story map"
|