@jupytergis/base 0.4.4 → 0.5.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.
Files changed (38) hide show
  1. package/lib/annotations/components/AnnotationFloater.d.ts +1 -4
  2. package/lib/annotations/components/AnnotationFloater.js +11 -6
  3. package/lib/annotations/model.d.ts +1 -0
  4. package/lib/annotations/model.js +9 -0
  5. package/lib/commands.js +50 -221
  6. package/lib/constants.d.ts +2 -16
  7. package/lib/constants.js +9 -24
  8. package/lib/icons.d.ts +8 -0
  9. package/lib/icons.js +40 -0
  10. package/lib/index.d.ts +1 -0
  11. package/lib/index.js +1 -0
  12. package/lib/mainview/mainView.d.ts +6 -1
  13. package/lib/mainview/mainView.js +127 -11
  14. package/lib/menus.d.ts +4 -0
  15. package/lib/menus.js +45 -0
  16. package/lib/panelview/annotationPanel.js +2 -2
  17. package/lib/panelview/components/identify-panel/IdentifyPanel.js +29 -7
  18. package/lib/panelview/components/layers.js +1 -0
  19. package/lib/panelview/leftpanel.js +0 -8
  20. package/lib/panelview/rightpanel.js +1 -0
  21. package/lib/toolbar/widget.js +44 -57
  22. package/lib/tools.d.ts +1 -1
  23. package/lib/tools.js +15 -7
  24. package/lib/widget.d.ts +1 -0
  25. package/lib/widget.js +3 -0
  26. package/package.json +2 -2
  27. package/style/icons/book_open.svg +19 -0
  28. package/style/icons/clock-solid.svg +17 -0
  29. package/style/icons/geolocation.svg +15 -0
  30. package/style/icons/info-solid.svg +20 -0
  31. package/style/icons/raster.svg +3 -2
  32. package/style/icons/target_with_center.svg +9 -0
  33. package/style/icons/target_without_center.svg +17 -0
  34. package/style/icons/terminal_toolbar.svg +12 -0
  35. package/style/icons/vector_square.svg +21 -0
  36. package/style/leftPanel.css +0 -1
  37. package/lib/panelview/components/sources.d.ts +0 -10
  38. package/lib/panelview/components/sources.js +0 -147
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import { IAnnotationProps } from './Annotation';
3
- interface IAnnotationFloaterProps extends IAnnotationProps {
4
- open: boolean;
5
- }
6
- declare const AnnotationFloater: ({ itemId, annotationModel: model, open }: IAnnotationFloaterProps) => React.JSX.Element;
3
+ declare const AnnotationFloater: ({ itemId, annotationModel: model }: IAnnotationProps) => React.JSX.Element;
7
4
  export default AnnotationFloater;
@@ -2,21 +2,26 @@ import React, { useState } from 'react';
2
2
  import { faWindowMinimize } from '@fortawesome/free-solid-svg-icons';
3
3
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
4
  import Annotation from './Annotation';
5
- const AnnotationFloater = ({ itemId, annotationModel: model, open }) => {
6
- const [isOpen, setIsOpen] = useState(open);
5
+ const AnnotationFloater = ({ itemId, annotationModel: model }) => {
6
+ const annotation = model.getAnnotation(itemId);
7
+ const [isOpen, setIsOpen] = useState(annotation === null || annotation === void 0 ? void 0 : annotation.open);
7
8
  // Function that either
8
9
  // - opens the annotation if `open`
9
10
  // - removes the annotation if `!open` and the annotation is empty
10
11
  // - closes the annotation if `!open` and the annotation is not empty
11
12
  const setOpenOrDelete = (open) => {
12
- var _a;
13
13
  if (open) {
14
+ model.updateAnnotation(itemId, { open: true });
14
15
  return setIsOpen(true);
15
16
  }
16
- if (!((_a = model.getAnnotation(itemId)) === null || _a === void 0 ? void 0 : _a.contents.length)) {
17
- return model.removeAnnotation(itemId);
17
+ const current = model.getAnnotation(itemId);
18
+ if (!(current === null || current === void 0 ? void 0 : current.contents.length)) {
19
+ model.removeAnnotation(itemId);
20
+ }
21
+ else {
22
+ model.updateAnnotation(itemId, { open: false });
23
+ setIsOpen(false);
18
24
  }
19
- setIsOpen(false);
20
25
  };
21
26
  return (React.createElement(React.Fragment, null,
22
27
  React.createElement("div", { className: "jGIS-Annotation-Handler", onClick: () => setOpenOrDelete(!isOpen) }),
@@ -12,6 +12,7 @@ export declare class AnnotationModel implements IAnnotationModel {
12
12
  getAnnotation(id: string): IAnnotation | undefined;
13
13
  getAnnotationIds(): string[];
14
14
  addAnnotation(key: string, value: IAnnotation): void;
15
+ updateAnnotation(id: string, updates: Partial<IAnnotation>): void;
15
16
  removeAnnotation(key: string): void;
16
17
  addContent(id: string, value: string): void;
17
18
  private _model;
@@ -48,6 +48,15 @@ export class AnnotationModel {
48
48
  var _a;
49
49
  (_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(`annotation_${key}`, JSON.stringify(value));
50
50
  }
51
+ updateAnnotation(id, updates) {
52
+ var _a;
53
+ const existing = this.getAnnotation(id);
54
+ if (!existing) {
55
+ return;
56
+ }
57
+ (_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(id, JSON.stringify(Object.assign(Object.assign({}, existing), updates)));
58
+ this._updateSignal.emit(null);
59
+ }
51
60
  removeAnnotation(key) {
52
61
  var _a;
53
62
  (_a = this._model) === null || _a === void 0 ? void 0 : _a.removeMetadata(key);
package/lib/commands.js CHANGED
@@ -8,6 +8,8 @@ import { JupyterGISDocumentWidget } from './widget';
8
8
  import { getGeoJSONDataFromLayerSource, downloadFile } from './tools';
9
9
  import { ProcessingFormDialog } from './dialogs/ProcessingFormDialog';
10
10
  import { getSingleSelectedLayer, selectedLayerIsOfType, processSelectedLayer } from './processing';
11
+ import { fromLonLat } from 'ol/proj';
12
+ import { targetWithCenterIcon } from './icons';
11
13
  function loadKeybindings(commands, keybindings) {
12
14
  keybindings.forEach(binding => {
13
15
  commands.addKeyBinding({
@@ -162,21 +164,21 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
162
164
  /**
163
165
  * Source and layers
164
166
  */
165
- commands.addCommand(CommandIDs.newRasterEntry, Object.assign({ label: trans.__('New Raster Layer'), isEnabled: () => {
167
+ commands.addCommand(CommandIDs.newRasterEntry, Object.assign({ label: trans.__('New Raster Tile Layer'), isEnabled: () => {
166
168
  return tracker.currentWidget
167
169
  ? tracker.currentWidget.model.sharedModel.editable
168
170
  : false;
169
171
  }, execute: Private.createEntry({
170
172
  tracker,
171
173
  formSchemaRegistry,
172
- title: 'Create Raster Layer',
174
+ title: 'Create Raster Tile Layer',
173
175
  createLayer: true,
174
176
  createSource: true,
175
177
  sourceData: {
176
178
  minZoom: 0,
177
179
  maxZoom: 24
178
180
  },
179
- layerData: { name: 'Custom Raster Layer' },
181
+ layerData: { name: 'Custom Raster Tile Layer' },
180
182
  sourceType: 'RasterSource',
181
183
  layerType: 'RasterLayer'
182
184
  }) }, icons.get(CommandIDs.newRasterEntry)));
@@ -319,21 +321,6 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
319
321
  sourceType: 'VideoSource',
320
322
  layerType: 'RasterLayer'
321
323
  }) }, icons.get(CommandIDs.newVideoEntry)));
322
- commands.addCommand(CommandIDs.newShapefileSource, Object.assign({ label: args => args.from === 'contextMenu'
323
- ? trans.__('Shapefile')
324
- : trans.__('Add Shapefile Source'), isEnabled: () => {
325
- return tracker.currentWidget
326
- ? tracker.currentWidget.model.sharedModel.editable
327
- : false;
328
- }, execute: Private.createEntry({
329
- tracker,
330
- formSchemaRegistry,
331
- title: 'Create Shapefile Source',
332
- createLayer: false,
333
- createSource: true,
334
- sourceData: { name: 'Custom Shapefile Source' },
335
- sourceType: 'ShapefileSource'
336
- }) }, icons.get(CommandIDs.newShapefileSource)));
337
324
  commands.addCommand(CommandIDs.newGeoTiffEntry, Object.assign({ label: trans.__('New GeoTiff layer'), isEnabled: () => {
338
325
  return tracker.currentWidget
339
326
  ? tracker.currentWidget.model.sharedModel.editable
@@ -352,191 +339,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
352
339
  sourceType: 'GeoTiffSource',
353
340
  layerType: 'WebGlLayer'
354
341
  }) }, icons.get(CommandIDs.newGeoTiffEntry)));
355
- /**
356
- * SOURCES only commands.
357
- */
358
- commands.addCommand(CommandIDs.newRasterSource, Object.assign({ label: args => args.from === 'contextMenu'
359
- ? trans.__('Raster')
360
- : trans.__('New Raster Source'), isEnabled: () => {
361
- return tracker.currentWidget
362
- ? tracker.currentWidget.model.sharedModel.editable
363
- : false;
364
- }, execute: Private.createEntry({
365
- tracker,
366
- formSchemaRegistry,
367
- title: 'Create Raster Source',
368
- createLayer: false,
369
- createSource: true,
370
- sourceData: { name: 'Custom Raster Source', minZoom: 0, maxZoom: 24 },
371
- sourceType: 'RasterSource'
372
- }) }, icons.get(CommandIDs.newRasterSource)));
373
- commands.addCommand(CommandIDs.newRasterDemSource, Object.assign({ label: args => args.from === 'contextMenu'
374
- ? trans.__('Raster DEM')
375
- : trans.__('New Raster DEM Source'), isEnabled: () => {
376
- return tracker.currentWidget
377
- ? tracker.currentWidget.model.sharedModel.editable
378
- : false;
379
- }, execute: Private.createEntry({
380
- tracker,
381
- formSchemaRegistry,
382
- title: 'Create Raster Dem Source',
383
- createLayer: false,
384
- createSource: true,
385
- sourceData: { name: 'Custom Raster DEM Source' },
386
- sourceType: 'RasterDemSource'
387
- }) }, icons.get(CommandIDs.newRasterDemSource)));
388
- commands.addCommand(CommandIDs.newVectorSource, Object.assign({ label: args => args.from === 'contextMenu'
389
- ? trans.__('Vector')
390
- : trans.__('New Vector Source'), isEnabled: () => {
391
- return tracker.currentWidget
392
- ? tracker.currentWidget.model.sharedModel.editable
393
- : false;
394
- }, execute: Private.createEntry({
395
- tracker,
396
- formSchemaRegistry,
397
- title: 'Create Vector Source',
398
- createLayer: false,
399
- createSource: true,
400
- sourceData: { name: 'Custom Vector Source', minZoom: 0, maxZoom: 24 },
401
- sourceType: 'VectorTileSource'
402
- }) }, icons.get(CommandIDs.newVectorSource)));
403
- commands.addCommand(CommandIDs.newGeoJSONSource, Object.assign({ label: args => args.from === 'contextMenu'
404
- ? trans.__('GeoJSON')
405
- : trans.__('Add GeoJSON data from file'), isEnabled: () => {
406
- return tracker.currentWidget
407
- ? tracker.currentWidget.model.sharedModel.editable
408
- : false;
409
- }, execute: Private.createEntry({
410
- tracker,
411
- formSchemaRegistry,
412
- title: 'Create GeoJson Source',
413
- createLayer: false,
414
- createSource: true,
415
- sourceData: { name: 'Custom GeoJSON Source' },
416
- sourceType: 'GeoJSONSource'
417
- }) }, icons.get(CommandIDs.newGeoJSONSource)));
418
- commands.addCommand(CommandIDs.newImageSource, Object.assign({ label: args => args.from === 'contextMenu'
419
- ? trans.__('Image')
420
- : trans.__('Add Image Source'), isEnabled: () => {
421
- return tracker.currentWidget
422
- ? tracker.currentWidget.model.sharedModel.editable
423
- : false;
424
- }, execute: Private.createEntry({
425
- tracker,
426
- formSchemaRegistry,
427
- title: 'Create Image Source',
428
- createLayer: false,
429
- createSource: true,
430
- sourceData: { name: 'Custom Image Source' },
431
- sourceType: 'ImageSource'
432
- }) }, icons.get(CommandIDs.newImageSource)));
433
- commands.addCommand(CommandIDs.newVideoSource, Object.assign({ label: args => args.from === 'contextMenu'
434
- ? trans.__('Video')
435
- : trans.__('Add Video Source'), isEnabled: () => {
436
- return tracker.currentWidget
437
- ? tracker.currentWidget.model.sharedModel.editable
438
- : false;
439
- }, execute: Private.createEntry({
440
- tracker,
441
- formSchemaRegistry,
442
- title: 'Create Video Source',
443
- createLayer: false,
444
- createSource: true,
445
- sourceData: { name: 'Custom Video Source' },
446
- sourceType: 'VideoSource'
447
- }) }, icons.get(CommandIDs.newVideoSource)));
448
- // Layers only
449
- commands.addCommand(CommandIDs.newRasterLayer, Object.assign({ label: args => args.from === 'contextMenu'
450
- ? trans.__('Raster')
451
- : trans.__('Add Raster layer'), isEnabled: () => {
452
- return tracker.currentWidget
453
- ? tracker.currentWidget.model.sharedModel.editable
454
- : false;
455
- }, execute: Private.createEntry({
456
- tracker,
457
- formSchemaRegistry,
458
- title: 'Create Raster Layer',
459
- createLayer: true,
460
- createSource: false,
461
- layerData: {
462
- name: 'Custom Raster Layer'
463
- },
464
- sourceType: 'RasterSource',
465
- layerType: 'RasterLayer'
466
- }) }, icons.get(CommandIDs.newVectorLayer)));
467
- commands.addCommand(CommandIDs.newVectorLayer, Object.assign({ label: args => args.from === 'contextMenu'
468
- ? trans.__('Vector')
469
- : trans.__('Add New Vector layer'), isEnabled: () => {
470
- return tracker.currentWidget
471
- ? tracker.currentWidget.model.sharedModel.editable
472
- : false;
473
- }, execute: Private.createEntry({
474
- tracker,
475
- formSchemaRegistry,
476
- title: 'Create Vector Layer',
477
- createLayer: true,
478
- createSource: false,
479
- layerData: {
480
- name: 'Custom Vector Layer'
481
- },
482
- sourceType: 'VectorTileSource',
483
- layerType: 'VectorTileLayer'
484
- }) }, icons.get(CommandIDs.newVectorLayer)));
485
- commands.addCommand(CommandIDs.newHillshadeLayer, Object.assign({ label: args => args.from === 'contextMenu'
486
- ? trans.__('Hillshade')
487
- : trans.__('Add Hillshade layer'), isEnabled: () => {
488
- return tracker.currentWidget
489
- ? tracker.currentWidget.model.sharedModel.editable
490
- : false;
491
- }, execute: Private.createEntry({
492
- tracker,
493
- formSchemaRegistry,
494
- title: 'Create Hillshade Layer',
495
- createLayer: true,
496
- createSource: false,
497
- layerData: {
498
- name: 'Custom Hillshade Layer'
499
- },
500
- sourceType: 'RasterDemSource',
501
- layerType: 'HillshadeLayer'
502
- }) }, icons.get(CommandIDs.newHillshadeLayer)));
503
- commands.addCommand(CommandIDs.newImageLayer, Object.assign({ label: args => args.from === 'contextMenu'
504
- ? trans.__('Image')
505
- : trans.__('Add Image layer'), isEnabled: () => {
506
- return tracker.currentWidget
507
- ? tracker.currentWidget.model.sharedModel.editable
508
- : false;
509
- }, execute: Private.createEntry({
510
- tracker,
511
- formSchemaRegistry,
512
- title: 'Create Image Layer',
513
- createLayer: true,
514
- createSource: false,
515
- layerData: {
516
- name: 'Custom Image Layer'
517
- },
518
- sourceType: 'ImageSource',
519
- layerType: 'RasterLayer'
520
- }) }, icons.get(CommandIDs.newImageLayer)));
521
- commands.addCommand(CommandIDs.newVideoLayer, Object.assign({ label: args => args.from === 'contextMenu'
522
- ? trans.__('Video')
523
- : trans.__('Add Video layer'), isEnabled: () => {
524
- return tracker.currentWidget
525
- ? tracker.currentWidget.model.sharedModel.editable
526
- : false;
527
- }, execute: Private.createEntry({
528
- tracker,
529
- formSchemaRegistry,
530
- title: 'Create Video Layer',
531
- createLayer: true,
532
- createSource: false,
533
- layerData: {
534
- name: 'Custom Video Layer'
535
- },
536
- sourceType: 'VideoSource',
537
- layerType: 'RasterLayer'
538
- }) }, icons.get(CommandIDs.newVideoLayer)));
539
- commands.addCommand(CommandIDs.newShapefileLayer, Object.assign({ label: trans.__('New Shapefile Layer'), isEnabled: () => {
342
+ commands.addCommand(CommandIDs.newShapefileEntry, Object.assign({ label: trans.__('New Shapefile Layer'), isEnabled: () => {
540
343
  return tracker.currentWidget
541
344
  ? tracker.currentWidget.model.sharedModel.editable
542
345
  : false;
@@ -550,23 +353,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
550
353
  layerData: { name: 'Custom Shapefile Layer' },
551
354
  sourceType: 'ShapefileSource',
552
355
  layerType: 'VectorLayer'
553
- }) }, icons.get(CommandIDs.newShapefileLayer)));
554
- commands.addCommand(CommandIDs.newHeatmapLayer, Object.assign({ label: args => args.from === 'contextMenu'
555
- ? trans.__('Heatmap')
556
- : trans.__('Add HeatmapLayer'), isEnabled: () => {
557
- return tracker.currentWidget
558
- ? tracker.currentWidget.model.sharedModel.editable
559
- : false;
560
- }, execute: Private.createEntry({
561
- tracker,
562
- formSchemaRegistry,
563
- title: 'Create Heatmap Layer',
564
- createLayer: true,
565
- createSource: false,
566
- layerData: { name: 'Custom Heatmap Layer' },
567
- sourceType: 'GeoJSONSource',
568
- layerType: 'HeatmapLayer'
569
- }) }, icons.get(CommandIDs.newHeatmapLayer)));
356
+ }) }, icons.get(CommandIDs.newShapefileEntry)));
570
357
  /**
571
358
  * LAYERS and LAYER GROUP actions.
572
359
  */
@@ -723,7 +510,19 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
723
510
  ? tracker.currentWidget.model.sharedModel.editable
724
511
  : false;
725
512
  },
726
- execute: async () => await Private.toggleConsole(tracker)
513
+ isToggled: () => {
514
+ var _a;
515
+ if (tracker.currentWidget instanceof JupyterGISDocumentWidget) {
516
+ return ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.consoleOpened) === true;
517
+ }
518
+ else {
519
+ return false;
520
+ }
521
+ },
522
+ execute: async () => {
523
+ await Private.toggleConsole(tracker);
524
+ commands.notifyCommandChanged(CommandIDs.toggleConsole);
525
+ }
727
526
  });
728
527
  commands.addCommand(CommandIDs.executeConsole, {
729
528
  label: trans.__('Execute console'),
@@ -842,6 +641,36 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
842
641
  downloadFile(geojsonString, `${exportFileName}.geojson`, 'application/geo+json');
843
642
  }
844
643
  });
644
+ commands.addCommand(CommandIDs.getGeolocation, {
645
+ label: trans.__('Center on Geolocation'),
646
+ execute: async () => {
647
+ var _a;
648
+ const viewModel = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model;
649
+ const options = {
650
+ enableHighAccuracy: true,
651
+ timeout: 5000,
652
+ maximumAge: 0
653
+ };
654
+ const success = (pos) => {
655
+ const location = fromLonLat([
656
+ pos.coords.longitude,
657
+ pos.coords.latitude
658
+ ]);
659
+ const Jgislocation = {
660
+ x: location[0],
661
+ y: location[1]
662
+ };
663
+ if (viewModel) {
664
+ viewModel.geolocationChanged.emit(Jgislocation);
665
+ }
666
+ };
667
+ const error = (err) => {
668
+ console.warn(`ERROR(${err.code}): ${err.message}`);
669
+ };
670
+ navigator.geolocation.getCurrentPosition(success, error, options);
671
+ },
672
+ icon: targetWithCenterIcon
673
+ });
845
674
  loadKeybindings(commands, keybindings);
846
675
  }
847
676
  var Private;
@@ -9,9 +9,11 @@ export declare namespace CommandIDs {
9
9
  const symbology = "jupytergis:symbology";
10
10
  const identify = "jupytergis:identify";
11
11
  const temporalController = "jupytergis:temporalController";
12
+ const getGeolocation = "jupytergis:getGeolocation";
12
13
  const openLayerBrowser = "jupytergis:openLayerBrowser";
13
14
  const newRasterEntry = "jupytergis:newRasterEntry";
14
15
  const newVectorTileEntry = "jupytergis:newVectorTileEntry";
16
+ const newShapefileEntry = "jupytergis:newShapefileEntry";
15
17
  const newGeoJSONEntry = "jupytergis:newGeoJSONEntry";
16
18
  const newHillshadeEntry = "jupytergis:newHillshadeEntry";
17
19
  const newImageEntry = "jupytergis:newImageEntry";
@@ -19,22 +21,6 @@ export declare namespace CommandIDs {
19
21
  const newGeoTiffEntry = "jupytergis:newGeoTiffEntry";
20
22
  const buffer = "jupytergis:buffer";
21
23
  const dissolve = "jupytergis:dissolve";
22
- const newRasterSource = "jupytergis:newRasterSource";
23
- const newRasterDemSource = "jupytergis:newRasterDemSource";
24
- const newVectorSource = "jupytergis:newVectorSource";
25
- const newGeoJSONSource = "jupytergis:newGeoJSONSource";
26
- const newImageSource = "jupytergis:imageSource";
27
- const newVideoSource = "jupytergis:videoSource";
28
- const newShapefileSource = "jupytergis:shapefileSource";
29
- const newGeoTiffSource = "jupytergis:newGeoTiffSource";
30
- const newRasterLayer = "jupytergis:newRasterLayer";
31
- const newVectorLayer = "jupytergis:newVectorLayer";
32
- const newHillshadeLayer = "jupytergis:newHillshadeLayer";
33
- const newImageLayer = "jupytergis:newImageLayer";
34
- const newVideoLayer = "jupytergis:newVideoLayer";
35
- const newShapefileLayer = "jupytergis:newShapefileLayer";
36
- const newWebGlTileLayer = "jupytergis:newWebGlTileLayer";
37
- const newHeatmapLayer = "jupytergis:newHeatmapLayer";
38
24
  const renameLayer = "jupytergis:renameLayer";
39
25
  const removeLayer = "jupytergis:removeLayer";
40
26
  const renameGroup = "jupytergis:renameGroup";
package/lib/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { redoIcon, undoIcon } from '@jupyterlab/ui-components';
2
- import { geoJSONIcon, moundIcon, rasterIcon } from './icons';
2
+ import { bookOpenIcon, clockIcon, geoJSONIcon, infoIcon, moundIcon, rasterIcon, vectorSquareIcon } from './icons';
3
3
  /**
4
4
  * The command IDs.
5
5
  */
@@ -11,11 +11,14 @@ export var CommandIDs;
11
11
  CommandIDs.symbology = 'jupytergis:symbology';
12
12
  CommandIDs.identify = 'jupytergis:identify';
13
13
  CommandIDs.temporalController = 'jupytergis:temporalController';
14
+ // geolocation
15
+ CommandIDs.getGeolocation = 'jupytergis:getGeolocation';
14
16
  // Layers and sources creation commands
15
17
  CommandIDs.openLayerBrowser = 'jupytergis:openLayerBrowser';
16
18
  // Layer and source
17
19
  CommandIDs.newRasterEntry = 'jupytergis:newRasterEntry';
18
20
  CommandIDs.newVectorTileEntry = 'jupytergis:newVectorTileEntry';
21
+ CommandIDs.newShapefileEntry = 'jupytergis:newShapefileEntry';
19
22
  CommandIDs.newGeoJSONEntry = 'jupytergis:newGeoJSONEntry';
20
23
  CommandIDs.newHillshadeEntry = 'jupytergis:newHillshadeEntry';
21
24
  CommandIDs.newImageEntry = 'jupytergis:newImageEntry';
@@ -24,24 +27,6 @@ export var CommandIDs;
24
27
  // Processing commands
25
28
  CommandIDs.buffer = 'jupytergis:buffer';
26
29
  CommandIDs.dissolve = 'jupytergis:dissolve';
27
- // Sources only commands
28
- CommandIDs.newRasterSource = 'jupytergis:newRasterSource';
29
- CommandIDs.newRasterDemSource = 'jupytergis:newRasterDemSource';
30
- CommandIDs.newVectorSource = 'jupytergis:newVectorSource';
31
- CommandIDs.newGeoJSONSource = 'jupytergis:newGeoJSONSource';
32
- CommandIDs.newImageSource = 'jupytergis:imageSource';
33
- CommandIDs.newVideoSource = 'jupytergis:videoSource';
34
- CommandIDs.newShapefileSource = 'jupytergis:shapefileSource';
35
- CommandIDs.newGeoTiffSource = 'jupytergis:newGeoTiffSource';
36
- // Layers only commands
37
- CommandIDs.newRasterLayer = 'jupytergis:newRasterLayer';
38
- CommandIDs.newVectorLayer = 'jupytergis:newVectorLayer';
39
- CommandIDs.newHillshadeLayer = 'jupytergis:newHillshadeLayer';
40
- CommandIDs.newImageLayer = 'jupytergis:newImageLayer';
41
- CommandIDs.newVideoLayer = 'jupytergis:newVideoLayer';
42
- CommandIDs.newShapefileLayer = 'jupytergis:newShapefileLayer';
43
- CommandIDs.newWebGlTileLayer = 'jupytergis:newWebGlTileLayer';
44
- CommandIDs.newHeatmapLayer = 'jupytergis:newHeatmapLayer';
45
30
  // Layer and group actions
46
31
  CommandIDs.renameLayer = 'jupytergis:renameLayer';
47
32
  CommandIDs.removeLayer = 'jupytergis:removeLayer';
@@ -78,18 +63,18 @@ const iconObject = {
78
63
  VideoLayer: { iconClass: 'fa fa-video' },
79
64
  [CommandIDs.redo]: { icon: redoIcon },
80
65
  [CommandIDs.undo]: { icon: undoIcon },
81
- [CommandIDs.openLayerBrowser]: { iconClass: 'fa fa-book-open' },
66
+ [CommandIDs.openLayerBrowser]: { icon: bookOpenIcon },
82
67
  [CommandIDs.newRasterEntry]: { icon: rasterIcon },
83
- [CommandIDs.newVectorTileEntry]: { iconClass: 'fa fa-vector-square' },
68
+ [CommandIDs.newVectorTileEntry]: { icon: vectorSquareIcon },
84
69
  [CommandIDs.newGeoJSONEntry]: { icon: geoJSONIcon },
85
70
  [CommandIDs.newHillshadeEntry]: { icon: moundIcon },
86
71
  [CommandIDs.newImageEntry]: { iconClass: 'fa fa-image' },
87
72
  [CommandIDs.newVideoEntry]: { iconClass: 'fa fa-video' },
88
- [CommandIDs.newShapefileLayer]: { iconClass: 'fa fa-file' },
73
+ [CommandIDs.newShapefileEntry]: { iconClass: 'fa fa-file' },
89
74
  [CommandIDs.newGeoTiffEntry]: { iconClass: 'fa fa-image' },
90
75
  [CommandIDs.symbology]: { iconClass: 'fa fa-brush' },
91
- [CommandIDs.identify]: { iconClass: 'fa fa-info' },
92
- [CommandIDs.temporalController]: { iconClass: 'fa fa-clock' }
76
+ [CommandIDs.identify]: { icon: infoIcon },
77
+ [CommandIDs.temporalController]: { icon: clockIcon }
93
78
  };
94
79
  /**
95
80
  * The registered icons
package/lib/icons.d.ts CHANGED
@@ -8,3 +8,11 @@ export declare const nonVisibilityIcon: LabIcon;
8
8
  export declare const geoJSONIcon: LabIcon;
9
9
  export declare const moundIcon: LabIcon;
10
10
  export declare const logoMiniIconQGZ: LabIcon;
11
+ export declare const bookOpenIcon: LabIcon;
12
+ export declare const vectorSquareIcon: LabIcon;
13
+ export declare const infoIcon: LabIcon;
14
+ export declare const clockIcon: LabIcon;
15
+ export declare const terminalToolbarIcon: LabIcon;
16
+ export declare const geolocationIcon: LabIcon;
17
+ export declare const targetWithoutCenterIcon: LabIcon;
18
+ export declare const targetWithCenterIcon: LabIcon;
package/lib/icons.js CHANGED
@@ -13,6 +13,14 @@ import nonVisibilitySvgStr from '../style/icons/nonvisibility.svg';
13
13
  import geoJsonSvgStr from '../style/icons/geojson.svg';
14
14
  import moundSvgStr from '../style/icons/mound.svg';
15
15
  import logoMiniQGZ from '../style/icons/logo_mini_qgz.svg';
16
+ import bookOpenSvgStr from '../style/icons/book_open.svg';
17
+ import vectorSquareSvgStr from '../style/icons/vector_square.svg';
18
+ import infoSvgStr from '../style/icons/info-solid.svg';
19
+ import clockSvgStr from '../style/icons/clock-solid.svg';
20
+ import terminalToolbarSvgStr from '../style/icons/terminal_toolbar.svg';
21
+ import geolocationSvgStr from '../style/icons/geolocation.svg';
22
+ import targetWithoutCenterSvgStr from '../style/icons/target_without_center.svg';
23
+ import targetWithCenterSvgStr from '../style/icons/target_with_center.svg';
16
24
  export const logoIcon = new LabIcon({
17
25
  name: 'jupytergis::logo',
18
26
  svgstr: logoSvgStr
@@ -49,3 +57,35 @@ export const logoMiniIconQGZ = new LabIcon({
49
57
  name: 'jupytergis::logoQGZ',
50
58
  svgstr: logoMiniQGZ
51
59
  });
60
+ export const bookOpenIcon = new LabIcon({
61
+ name: 'jupytergis::bookOpen',
62
+ svgstr: bookOpenSvgStr
63
+ });
64
+ export const vectorSquareIcon = new LabIcon({
65
+ name: 'jupytergis::vectorSquare',
66
+ svgstr: vectorSquareSvgStr
67
+ });
68
+ export const infoIcon = new LabIcon({
69
+ name: 'jupytergis::info',
70
+ svgstr: infoSvgStr
71
+ });
72
+ export const clockIcon = new LabIcon({
73
+ name: 'jupytergis::clock',
74
+ svgstr: clockSvgStr
75
+ });
76
+ export const terminalToolbarIcon = new LabIcon({
77
+ name: 'jupytergis::terminalToolbar',
78
+ svgstr: terminalToolbarSvgStr
79
+ });
80
+ export const geolocationIcon = new LabIcon({
81
+ name: 'jupytergis::geolocation',
82
+ svgstr: geolocationSvgStr
83
+ });
84
+ export const targetWithoutCenterIcon = new LabIcon({
85
+ name: 'jupytergis::targetWithCenter',
86
+ svgstr: targetWithCenterSvgStr
87
+ });
88
+ export const targetWithCenterIcon = new LabIcon({
89
+ name: 'jupytergis::targetWithoutCenter',
90
+ svgstr: targetWithoutCenterSvgStr
91
+ });
package/lib/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from './tools';
12
12
  export * from './types';
13
13
  export * from './widget';
14
14
  export * from './annotations';
15
+ export * from './menus';
package/lib/index.js CHANGED
@@ -12,3 +12,4 @@ export * from './tools';
12
12
  export * from './types';
13
13
  export * from './widget';
14
14
  export * from './annotations';
15
+ export * from './menus';
@@ -33,7 +33,7 @@ export declare class MainView extends React.Component<IProps, IStates> {
33
33
  constructor(props: IProps);
34
34
  componentDidMount(): Promise<void>;
35
35
  componentWillUnmount(): void;
36
- generateScene(): Promise<void>;
36
+ generateScene(center: number[], zoom: number): Promise<void>;
37
37
  createSelectInteraction: () => void;
38
38
  addContextMenu: () => void;
39
39
  /**
@@ -110,6 +110,8 @@ export declare class MainView extends React.Component<IProps, IStates> {
110
110
  * to work with the temporal controller
111
111
  */
112
112
  handleTemporalController: (id: string, layer: IJGISLayer) => void;
113
+ private flyToGeometry;
114
+ private highlightFeatureOnMap;
113
115
  /**
114
116
  * Wait for all layers to be loaded.
115
117
  */
@@ -165,11 +167,13 @@ export declare class MainView extends React.Component<IProps, IStates> {
165
167
  private _updateAnnotation;
166
168
  private _onZoomToPosition;
167
169
  private _moveToPosition;
170
+ private _flyToPosition;
168
171
  private _onPointerMove;
169
172
  private _syncPointer;
170
173
  private _identifyFeature;
171
174
  private _triggerLayerUpdate;
172
175
  private _convertFeatureToMs;
176
+ private _handleGeolocationChanged;
173
177
  private _handleThemeChange;
174
178
  private _handleWindowResize;
175
179
  render(): JSX.Element;
@@ -187,5 +191,6 @@ export declare class MainView extends React.Component<IProps, IStates> {
187
191
  private _contextMenu;
188
192
  private _loadingLayers;
189
193
  private _originalFeatures;
194
+ private _highlightLayer;
190
195
  }
191
196
  export {};