@jupytergis/base 0.5.0 → 0.6.1
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/annotations/components/Annotation.d.ts +2 -2
- package/lib/annotations/components/Annotation.js +3 -3
- package/lib/annotations/components/AnnotationFloater.d.ts +1 -1
- package/lib/annotations/components/AnnotationFloater.js +2 -2
- package/lib/annotations/components/Message.d.ts +2 -1
- package/lib/annotations/components/Message.js +3 -3
- package/lib/annotations/model.js +5 -5
- package/lib/commands/BaseCommandIDs.d.ts +32 -0
- package/lib/commands/BaseCommandIDs.js +43 -0
- package/lib/{commands.d.ts → commands/index.d.ts} +1 -1
- package/lib/{commands.js → commands/index.js} +59 -99
- package/lib/console/consoleview.d.ts +3 -3
- package/lib/console/consoleview.js +5 -5
- package/lib/constants.d.ts +2 -36
- package/lib/constants.js +5 -47
- package/lib/dialogs/ProcessingFormDialog.d.ts +4 -4
- package/lib/dialogs/ProcessingFormDialog.js +9 -11
- package/lib/dialogs/layerBrowserDialog.d.ts +1 -1
- package/lib/dialogs/layerBrowserDialog.js +7 -7
- package/lib/dialogs/layerCreationFormDialog.d.ts +4 -4
- package/lib/dialogs/layerCreationFormDialog.js +6 -6
- package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.js +3 -3
- package/lib/dialogs/symbology/components/color_ramp/ColorRamp.d.ts +3 -2
- package/lib/dialogs/symbology/components/color_ramp/ColorRamp.js +6 -7
- package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.js +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.js +1 -1
- package/lib/dialogs/symbology/components/color_stops/StopContainer.d.ts +2 -2
- package/lib/dialogs/symbology/components/color_stops/StopContainer.js +4 -4
- package/lib/dialogs/symbology/components/color_stops/StopRow.d.ts +3 -3
- package/lib/dialogs/symbology/components/color_stops/StopRow.js +2 -2
- package/lib/dialogs/symbology/hooks/useGetBandInfo.js +5 -5
- package/lib/dialogs/symbology/hooks/useGetProperties.d.ts +1 -1
- package/lib/dialogs/symbology/hooks/useGetProperties.js +4 -4
- package/lib/dialogs/symbology/symbologyDialog.d.ts +8 -0
- package/lib/dialogs/symbology/symbologyDialog.js +1 -1
- package/lib/dialogs/symbology/symbologyUtils.js +38 -31
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +2 -2
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +4 -4
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +30 -20
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +23 -21
- package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/VectorRendering.js +81 -39
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +1 -1
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +1 -1
- package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +4 -0
- package/lib/dialogs/symbology/vector_layer/types/Canonical.js +66 -0
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +142 -47
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +193 -99
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +7 -6
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +33 -30
- package/lib/formbuilder/creationform.js +3 -3
- package/lib/formbuilder/editform.js +3 -3
- package/lib/formbuilder/formselectors.d.ts +1 -1
- package/lib/formbuilder/formselectors.js +2 -2
- package/lib/formbuilder/objectform/baseform.d.ts +5 -4
- package/lib/formbuilder/objectform/baseform.js +16 -14
- package/lib/formbuilder/objectform/fileselectorwidget.d.ts +1 -1
- package/lib/formbuilder/objectform/fileselectorwidget.js +5 -5
- package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +2 -2
- package/lib/formbuilder/objectform/layer/hillshadeLayerForm.js +1 -1
- package/lib/formbuilder/objectform/layer/layerform.d.ts +1 -1
- package/lib/formbuilder/objectform/layer/layerform.js +3 -2
- package/lib/formbuilder/objectform/process/dissolveProcessForm.d.ts +1 -1
- package/lib/formbuilder/objectform/process/dissolveProcessForm.js +5 -5
- package/lib/formbuilder/objectform/source/geojsonsource.js +4 -4
- package/lib/formbuilder/objectform/source/geotiffsource.js +4 -4
- package/lib/formbuilder/objectform/source/pathbasedsource.js +6 -6
- package/lib/formbuilder/objectform/source/sourceform.d.ts +1 -1
- package/lib/formbuilder/objectform/source/sourceform.js +1 -1
- package/lib/formbuilder/objectform/source/tilesourceform.js +3 -3
- package/lib/gdal.js +2 -2
- package/lib/icons.js +29 -29
- package/lib/index.d.ts +4 -3
- package/lib/index.js +4 -3
- package/lib/mainview/CollaboratorPointers.d.ts +1 -1
- package/lib/mainview/CollaboratorPointers.js +5 -5
- package/lib/mainview/FollowIndicator.d.ts +2 -2
- package/lib/mainview/FollowIndicator.js +3 -3
- package/lib/mainview/TemporalSlider.d.ts +1 -1
- package/lib/mainview/TemporalSlider.js +7 -7
- package/lib/mainview/mainView.d.ts +4 -2
- package/lib/mainview/mainView.js +232 -137
- package/lib/menus.d.ts +1 -1
- package/lib/menus.js +7 -7
- package/lib/panelview/annotationPanel.d.ts +2 -2
- package/lib/panelview/annotationPanel.js +1 -1
- package/lib/panelview/components/filter-panel/Filter.d.ts +2 -2
- package/lib/panelview/components/filter-panel/Filter.js +5 -5
- package/lib/panelview/components/filter-panel/FilterRow.d.ts +2 -2
- package/lib/panelview/components/identify-panel/IdentifyPanel.d.ts +1 -1
- package/lib/panelview/components/identify-panel/IdentifyPanel.js +5 -5
- package/lib/panelview/components/layers.d.ts +1 -1
- package/lib/panelview/components/layers.js +12 -12
- package/lib/panelview/leftpanel.d.ts +4 -2
- package/lib/panelview/leftpanel.js +24 -6
- package/lib/panelview/model.d.ts +1 -1
- package/lib/panelview/objectproperties.d.ts +1 -1
- package/lib/panelview/objectproperties.js +3 -3
- package/lib/panelview/rightpanel.d.ts +2 -1
- package/lib/panelview/rightpanel.js +13 -5
- package/lib/{processing.d.ts → processing/index.d.ts} +4 -4
- package/lib/{processing.js → processing/index.js} +19 -24
- package/lib/processing/processingCommands.d.ts +6 -0
- package/lib/processing/processingCommands.js +47 -0
- package/lib/processing/processingFormToParam.d.ts +2 -0
- package/lib/processing/processingFormToParam.js +15 -0
- package/lib/shared/components/Badge.d.ts +7 -0
- package/lib/shared/components/Badge.js +20 -0
- package/lib/shared/components/Button.d.ts +9 -0
- package/lib/shared/components/Button.js +21 -0
- package/lib/shared/components/Calendar.d.ts +47 -0
- package/lib/shared/components/Calendar.js +184 -0
- package/lib/shared/components/Checkbox.d.ts +4 -0
- package/lib/shared/components/Checkbox.js +25 -0
- package/lib/shared/components/DropdownMenu.d.ts +27 -0
- package/lib/shared/components/DropdownMenu.js +92 -0
- package/lib/shared/components/Pagination.d.ts +25 -0
- package/lib/shared/components/Pagination.js +68 -0
- package/lib/shared/components/Popover.d.ts +7 -0
- package/lib/shared/components/Popover.js +32 -0
- package/lib/shared/components/Tabs.d.ts +7 -0
- package/lib/shared/components/Tabs.js +31 -0
- package/lib/shared/components/ToggleGroup.d.ts +12 -0
- package/lib/shared/components/ToggleGroup.js +52 -0
- package/lib/shared/components/loading.d.ts +12 -0
- package/lib/shared/components/loading.js +6 -0
- package/lib/shared/components/utils.d.ts +2 -0
- package/lib/shared/components/utils.js +4 -0
- package/lib/shared/hooks/useIsFirstRender.d.ts +2 -0
- package/lib/shared/hooks/useIsFirstRender.js +10 -0
- package/lib/stacBrowser/StacBrowser.d.ts +7 -0
- package/lib/stacBrowser/StacBrowser.js +16 -0
- package/lib/stacBrowser/StacPanel.d.ts +14 -0
- package/lib/stacBrowser/StacPanel.js +16 -0
- package/lib/stacBrowser/components/StacFilterSection.d.ts +23 -0
- package/lib/stacBrowser/components/StacFilterSection.js +59 -0
- package/lib/stacBrowser/components/StacPanelFilters.d.ts +14 -0
- package/lib/stacBrowser/components/StacPanelFilters.js +81 -0
- package/lib/stacBrowser/components/StacPanelResults.d.ts +13 -0
- package/lib/stacBrowser/components/StacPanelResults.js +48 -0
- package/lib/stacBrowser/components/StacPanelView.d.ts +7 -0
- package/lib/stacBrowser/components/StacPanelView.js +20 -0
- package/lib/stacBrowser/constants.d.ts +25 -0
- package/lib/stacBrowser/constants.js +197 -0
- package/lib/stacBrowser/hooks/useStacSearch.d.ts +30 -0
- package/lib/stacBrowser/hooks/useStacSearch.js +221 -0
- package/lib/stacBrowser/index.d.ts +1 -0
- package/lib/stacBrowser/index.js +1 -0
- package/lib/stacBrowser/types/types.d.ts +124 -0
- package/lib/stacBrowser/types/types.js +1 -0
- package/lib/statusbar/StatusBar.d.ts +1 -1
- package/lib/statusbar/StatusBar.js +3 -3
- package/lib/toolbar/index.d.ts +0 -1
- package/lib/toolbar/index.js +0 -1
- package/lib/toolbar/widget.d.ts +1 -0
- package/lib/toolbar/widget.js +37 -16
- package/lib/tools.d.ts +29 -4
- package/lib/tools.js +74 -69
- package/lib/types.d.ts +2 -0
- package/lib/widget.d.ts +1 -1
- package/lib/widget.js +5 -5
- package/package.json +22 -8
- package/style/base.css +26 -0
- package/style/layerBrowser.css +10 -0
- package/style/shared/badge.css +61 -0
- package/style/shared/button.css +169 -0
- package/style/shared/calendar.css +274 -0
- package/style/shared/checkbox.css +28 -0
- package/style/shared/dropdownMenu.css +240 -0
- package/style/shared/pagination.css +167 -0
- package/style/shared/popover.css +53 -0
- package/style/shared/tabs.css +57 -0
- package/style/shared/toggle.css +85 -0
- package/style/stacBrowser.css +91 -0
- package/style/symbologyDialog.css +0 -7
- package/lib/mainview/spinner.d.ts +0 -6
- package/lib/mainview/spinner.js +0 -5
- package/lib/toolbar/usertoolbaritem.d.ts +0 -19
- package/lib/toolbar/usertoolbaritem.js +0 -59
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IAnnotationModel } from '@jupytergis/schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IControlPanelModel } from
|
|
3
|
+
import { IControlPanelModel } from "../../types";
|
|
4
4
|
export interface IAnnotationProps {
|
|
5
5
|
itemId: string;
|
|
6
6
|
annotationModel: IAnnotationModel;
|
|
7
7
|
rightPanelModel?: IControlPanelModel;
|
|
8
8
|
children?: JSX.Element[] | JSX.Element;
|
|
9
9
|
}
|
|
10
|
-
declare const Annotation:
|
|
10
|
+
declare const Annotation: React.FC<IAnnotationProps>;
|
|
11
11
|
export default Annotation;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { faTrash, faPaperPlane, faArrowsToDot } from '@fortawesome/free-solid-svg-icons';
|
|
1
|
+
import { faTrash, faPaperPlane, faArrowsToDot, } from '@fortawesome/free-solid-svg-icons';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
3
|
import { showDialog, Dialog } from '@jupyterlab/apputils';
|
|
4
4
|
import { Button } from '@jupyterlab/ui-components';
|
|
5
5
|
import React, { useMemo, useState } from 'react';
|
|
6
6
|
import { Message } from './Message';
|
|
7
|
-
const Annotation = ({ itemId, annotationModel, rightPanelModel, children }) => {
|
|
7
|
+
const Annotation = ({ itemId, annotationModel, rightPanelModel, children, }) => {
|
|
8
8
|
const [messageContent, setMessageContent] = useState('');
|
|
9
9
|
const [jgisModel, setJgisModel] = useState(rightPanelModel === null || rightPanelModel === void 0 ? void 0 : rightPanelModel.jGISModel);
|
|
10
10
|
const annotation = annotationModel.getAnnotation(itemId);
|
|
@@ -29,7 +29,7 @@ const Annotation = ({ itemId, annotationModel, rightPanelModel, children }) => {
|
|
|
29
29
|
const result = await showDialog({
|
|
30
30
|
title: 'Delete Annotation',
|
|
31
31
|
body: 'Are you sure you want to delete this annotation?',
|
|
32
|
-
buttons: [Dialog.cancelButton(), Dialog.okButton({ label: 'Delete' })]
|
|
32
|
+
buttons: [Dialog.cancelButton(), Dialog.okButton({ label: 'Delete' })],
|
|
33
33
|
});
|
|
34
34
|
if (result.button.accept) {
|
|
35
35
|
annotationModel.removeAnnotation(itemId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IAnnotationProps } from './Annotation';
|
|
3
|
-
declare const AnnotationFloater:
|
|
3
|
+
declare const AnnotationFloater: React.FC<IAnnotationProps>;
|
|
4
4
|
export default AnnotationFloater;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
1
|
import { faWindowMinimize } from '@fortawesome/free-solid-svg-icons';
|
|
3
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import Annotation from './Annotation';
|
|
5
|
-
const AnnotationFloater = ({ itemId, annotationModel: model }) => {
|
|
5
|
+
const AnnotationFloater = ({ itemId, annotationModel: model, }) => {
|
|
6
6
|
const annotation = model.getAnnotation(itemId);
|
|
7
7
|
const [isOpen, setIsOpen] = useState(annotation === null || annotation === void 0 ? void 0 : annotation.open);
|
|
8
8
|
// Function that either
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { User } from '@jupyterlab/services';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IProps {
|
|
3
4
|
message: string;
|
|
4
5
|
self: boolean;
|
|
5
6
|
user?: User.IIdentity;
|
|
6
7
|
}
|
|
7
|
-
export declare const Message:
|
|
8
|
+
export declare const Message: React.FC<IProps>;
|
|
8
9
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export const Message =
|
|
2
|
+
export const Message = props => {
|
|
3
3
|
var _a, _b, _c;
|
|
4
4
|
const { self, message, user } = props;
|
|
5
5
|
const color = (_a = user === null || user === void 0 ? void 0 : user.color) !== null && _a !== void 0 ? _a : 'black';
|
|
6
6
|
const author = (_b = user === null || user === void 0 ? void 0 : user.display_name) !== null && _b !== void 0 ? _b : '';
|
|
7
7
|
const initials = (_c = user === null || user === void 0 ? void 0 : user.initials) !== null && _c !== void 0 ? _c : '';
|
|
8
8
|
return (React.createElement("div", { className: "jGIS-Annotation-Message", style: {
|
|
9
|
-
flexFlow: self ? 'row' : 'row-reverse'
|
|
9
|
+
flexFlow: self ? 'row' : 'row-reverse',
|
|
10
10
|
} },
|
|
11
11
|
React.createElement("div", { className: "jGIS-Annotation-User-Icon", style: {
|
|
12
|
-
backgroundColor: color
|
|
12
|
+
backgroundColor: color,
|
|
13
13
|
}, title: author },
|
|
14
14
|
React.createElement("span", { style: { width: 24, textAlign: 'center' } }, initials)),
|
|
15
15
|
React.createElement("div", { className: "jGIS-Annotation-Message-Content" },
|
package/lib/annotations/model.js
CHANGED
|
@@ -31,7 +31,7 @@ export class AnnotationModel {
|
|
|
31
31
|
var _a;
|
|
32
32
|
const rawData = (_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.getMetadata(id);
|
|
33
33
|
if (rawData) {
|
|
34
|
-
return
|
|
34
|
+
return rawData;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
getAnnotationIds() {
|
|
@@ -46,7 +46,7 @@ export class AnnotationModel {
|
|
|
46
46
|
}
|
|
47
47
|
addAnnotation(key, value) {
|
|
48
48
|
var _a;
|
|
49
|
-
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(`annotation_${key}`,
|
|
49
|
+
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(`annotation_${key}`, value);
|
|
50
50
|
}
|
|
51
51
|
updateAnnotation(id, updates) {
|
|
52
52
|
var _a;
|
|
@@ -54,7 +54,7 @@ export class AnnotationModel {
|
|
|
54
54
|
if (!existing) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(id,
|
|
57
|
+
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(id, Object.assign(Object.assign({}, existing), updates));
|
|
58
58
|
this._updateSignal.emit(null);
|
|
59
59
|
}
|
|
60
60
|
removeAnnotation(key) {
|
|
@@ -65,12 +65,12 @@ export class AnnotationModel {
|
|
|
65
65
|
var _a;
|
|
66
66
|
const newContent = {
|
|
67
67
|
value,
|
|
68
|
-
user: this._user
|
|
68
|
+
user: this._user,
|
|
69
69
|
};
|
|
70
70
|
const currentAnnotation = this.getAnnotation(id);
|
|
71
71
|
if (currentAnnotation) {
|
|
72
72
|
const newAnnotation = Object.assign(Object.assign({}, currentAnnotation), { contents: [...currentAnnotation.contents, newContent] });
|
|
73
|
-
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(id,
|
|
73
|
+
(_a = this._model) === null || _a === void 0 ? void 0 : _a.sharedModel.setMetadata(id, newAnnotation);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const createNew = "jupytergis:create-new-jGIS-file";
|
|
2
|
+
export declare const redo = "jupytergis:redo";
|
|
3
|
+
export declare const undo = "jupytergis:undo";
|
|
4
|
+
export declare const symbology = "jupytergis:symbology";
|
|
5
|
+
export declare const identify = "jupytergis:identify";
|
|
6
|
+
export declare const temporalController = "jupytergis:temporalController";
|
|
7
|
+
export declare const getGeolocation = "jupytergis:getGeolocation";
|
|
8
|
+
export declare const openLayerBrowser = "jupytergis:openLayerBrowser";
|
|
9
|
+
export declare const newRasterEntry = "jupytergis:newRasterEntry";
|
|
10
|
+
export declare const newVectorTileEntry = "jupytergis:newVectorTileEntry";
|
|
11
|
+
export declare const newShapefileEntry = "jupytergis:newShapefileEntry";
|
|
12
|
+
export declare const newGeoJSONEntry = "jupytergis:newGeoJSONEntry";
|
|
13
|
+
export declare const newHillshadeEntry = "jupytergis:newHillshadeEntry";
|
|
14
|
+
export declare const newImageEntry = "jupytergis:newImageEntry";
|
|
15
|
+
export declare const newVideoEntry = "jupytergis:newVideoEntry";
|
|
16
|
+
export declare const newGeoTiffEntry = "jupytergis:newGeoTiffEntry";
|
|
17
|
+
export declare const renameLayer = "jupytergis:renameLayer";
|
|
18
|
+
export declare const removeLayer = "jupytergis:removeLayer";
|
|
19
|
+
export declare const renameGroup = "jupytergis:renameGroup";
|
|
20
|
+
export declare const removeGroup = "jupytergis:removeGroup";
|
|
21
|
+
export declare const moveLayersToGroup = "jupytergis:moveLayersToGroup";
|
|
22
|
+
export declare const moveLayerToNewGroup = "jupytergis:moveLayerToNewGroup";
|
|
23
|
+
export declare const renameSource = "jupytergis:renameSource";
|
|
24
|
+
export declare const removeSource = "jupytergis:removeSource";
|
|
25
|
+
export declare const toggleConsole = "jupytergis:toggleConsole";
|
|
26
|
+
export declare const invokeCompleter = "jupytergis:invokeConsoleCompleter";
|
|
27
|
+
export declare const removeConsole = "jupytergis:removeConsole";
|
|
28
|
+
export declare const executeConsole = "jupytergis:executeConsole";
|
|
29
|
+
export declare const selectCompleter = "jupytergis:selectConsoleCompleter";
|
|
30
|
+
export declare const addAnnotation = "jupytergis:addAnnotation";
|
|
31
|
+
export declare const zoomToLayer = "jupytergis:zoomToLayer";
|
|
32
|
+
export declare const downloadGeoJSON = "jupytergis:downloadGeoJSON";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* This file is not an exhaustive list of commands.
|
|
2
|
+
*
|
|
3
|
+
* See the documentation for more details.
|
|
4
|
+
*/
|
|
5
|
+
export const createNew = 'jupytergis:create-new-jGIS-file';
|
|
6
|
+
export const redo = 'jupytergis:redo';
|
|
7
|
+
export const undo = 'jupytergis:undo';
|
|
8
|
+
export const symbology = 'jupytergis:symbology';
|
|
9
|
+
export const identify = 'jupytergis:identify';
|
|
10
|
+
export const temporalController = 'jupytergis:temporalController';
|
|
11
|
+
// geolocation
|
|
12
|
+
export const getGeolocation = 'jupytergis:getGeolocation';
|
|
13
|
+
// Layers and sources creation commands
|
|
14
|
+
export const openLayerBrowser = 'jupytergis:openLayerBrowser';
|
|
15
|
+
// Layer and source
|
|
16
|
+
export const newRasterEntry = 'jupytergis:newRasterEntry';
|
|
17
|
+
export const newVectorTileEntry = 'jupytergis:newVectorTileEntry';
|
|
18
|
+
export const newShapefileEntry = 'jupytergis:newShapefileEntry';
|
|
19
|
+
export const newGeoJSONEntry = 'jupytergis:newGeoJSONEntry';
|
|
20
|
+
export const newHillshadeEntry = 'jupytergis:newHillshadeEntry';
|
|
21
|
+
export const newImageEntry = 'jupytergis:newImageEntry';
|
|
22
|
+
export const newVideoEntry = 'jupytergis:newVideoEntry';
|
|
23
|
+
export const newGeoTiffEntry = 'jupytergis:newGeoTiffEntry';
|
|
24
|
+
// Layer and group actions
|
|
25
|
+
export const renameLayer = 'jupytergis:renameLayer';
|
|
26
|
+
export const removeLayer = 'jupytergis:removeLayer';
|
|
27
|
+
export const renameGroup = 'jupytergis:renameGroup';
|
|
28
|
+
export const removeGroup = 'jupytergis:removeGroup';
|
|
29
|
+
export const moveLayersToGroup = 'jupytergis:moveLayersToGroup';
|
|
30
|
+
export const moveLayerToNewGroup = 'jupytergis:moveLayerToNewGroup';
|
|
31
|
+
// Source actions
|
|
32
|
+
export const renameSource = 'jupytergis:renameSource';
|
|
33
|
+
export const removeSource = 'jupytergis:removeSource';
|
|
34
|
+
// Console commands
|
|
35
|
+
export const toggleConsole = 'jupytergis:toggleConsole';
|
|
36
|
+
export const invokeCompleter = 'jupytergis:invokeConsoleCompleter';
|
|
37
|
+
export const removeConsole = 'jupytergis:removeConsole';
|
|
38
|
+
export const executeConsole = 'jupytergis:executeConsole';
|
|
39
|
+
export const selectCompleter = 'jupytergis:selectConsoleCompleter';
|
|
40
|
+
// Map Commands
|
|
41
|
+
export const addAnnotation = 'jupytergis:addAnnotation';
|
|
42
|
+
export const zoomToLayer = 'jupytergis:zoomToLayer';
|
|
43
|
+
export const downloadGeoJSON = 'jupytergis:downloadGeoJSON';
|
|
@@ -3,7 +3,7 @@ import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
|
3
3
|
import { ICompletionProviderManager } from '@jupyterlab/completer';
|
|
4
4
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
5
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { JupyterGISTracker } from '
|
|
6
|
+
import { JupyterGISTracker } from '../types';
|
|
7
7
|
/**
|
|
8
8
|
* Add the commands to the application's command registry.
|
|
9
9
|
*/
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
2
|
-
import { CommandIDs, icons } from './constants';
|
|
3
|
-
import { LayerCreationFormDialog } from './dialogs/layerCreationFormDialog';
|
|
4
|
-
import { LayerBrowserWidget } from './dialogs/layerBrowserDialog';
|
|
5
|
-
import { SymbologyWidget } from './dialogs/symbology/symbologyDialog';
|
|
6
|
-
import keybindings from './keybindings.json';
|
|
7
|
-
import { JupyterGISDocumentWidget } from './widget';
|
|
8
|
-
import { getGeoJSONDataFromLayerSource, downloadFile } from './tools';
|
|
9
|
-
import { ProcessingFormDialog } from './dialogs/ProcessingFormDialog';
|
|
10
|
-
import { getSingleSelectedLayer, selectedLayerIsOfType, processSelectedLayer } from './processing';
|
|
11
2
|
import { fromLonLat } from 'ol/proj';
|
|
12
|
-
import {
|
|
3
|
+
import { CommandIDs, icons } from '../constants';
|
|
4
|
+
import { ProcessingFormDialog } from '../dialogs/ProcessingFormDialog';
|
|
5
|
+
import { LayerBrowserWidget } from '../dialogs/layerBrowserDialog';
|
|
6
|
+
import { LayerCreationFormDialog } from '../dialogs/layerCreationFormDialog';
|
|
7
|
+
import { SymbologyWidget } from '../dialogs/symbology/symbologyDialog';
|
|
8
|
+
import { targetWithCenterIcon } from '../icons';
|
|
9
|
+
import keybindings from '../keybindings.json';
|
|
10
|
+
import { getSingleSelectedLayer } from '../processing/index';
|
|
11
|
+
import { addProcessingCommands } from '../processing/processingCommands';
|
|
12
|
+
import { getGeoJSONDataFromLayerSource, downloadFile } from '../tools';
|
|
13
|
+
import { JupyterGISDocumentWidget } from '../widget';
|
|
13
14
|
function loadKeybindings(commands, keybindings) {
|
|
14
15
|
keybindings.forEach(binding => {
|
|
15
16
|
commands.addKeyBinding({
|
|
16
17
|
command: binding.command,
|
|
17
18
|
keys: binding.keys,
|
|
18
|
-
selector: binding.selector
|
|
19
|
+
selector: binding.selector,
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -47,7 +48,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
47
48
|
'VectorLayer',
|
|
48
49
|
'VectorTileLayer',
|
|
49
50
|
'WebGlLayer',
|
|
50
|
-
'HeatmapLayer'
|
|
51
|
+
'HeatmapLayer',
|
|
51
52
|
].includes(layer.type);
|
|
52
53
|
return isValidLayer;
|
|
53
54
|
}, execute: Private.createSymbologyDialog(tracker, state) }, icons.get(CommandIDs.symbology)));
|
|
@@ -83,7 +84,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
83
84
|
const canIdentify = [
|
|
84
85
|
'VectorLayer',
|
|
85
86
|
'ShapefileLayer',
|
|
86
|
-
'WebGlLayer'
|
|
87
|
+
'WebGlLayer',
|
|
87
88
|
].includes(selectedLayer.type);
|
|
88
89
|
const isIdentifying = current.model.isIdentifying;
|
|
89
90
|
if (isIdentifying && !canIdentify) {
|
|
@@ -176,11 +177,11 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
176
177
|
createSource: true,
|
|
177
178
|
sourceData: {
|
|
178
179
|
minZoom: 0,
|
|
179
|
-
maxZoom: 24
|
|
180
|
+
maxZoom: 24,
|
|
180
181
|
},
|
|
181
182
|
layerData: { name: 'Custom Raster Tile Layer' },
|
|
182
183
|
sourceType: 'RasterSource',
|
|
183
|
-
layerType: 'RasterLayer'
|
|
184
|
+
layerType: 'RasterLayer',
|
|
184
185
|
}) }, icons.get(CommandIDs.newRasterEntry)));
|
|
185
186
|
commands.addCommand(CommandIDs.newVectorTileEntry, Object.assign({ label: trans.__('New Vector Tile Layer'), isEnabled: () => {
|
|
186
187
|
return tracker.currentWidget
|
|
@@ -195,53 +196,8 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
195
196
|
sourceData: { minZoom: 0, maxZoom: 24 },
|
|
196
197
|
layerData: { name: 'Custom Vector Tile Layer' },
|
|
197
198
|
sourceType: 'VectorTileSource',
|
|
198
|
-
layerType: 'VectorTileLayer'
|
|
199
|
+
layerType: 'VectorTileLayer',
|
|
199
200
|
}) }, icons.get(CommandIDs.newVectorTileEntry)));
|
|
200
|
-
commands.addCommand(CommandIDs.buffer, {
|
|
201
|
-
label: trans.__('Buffer'),
|
|
202
|
-
isEnabled: () => selectedLayerIsOfType(['VectorLayer'], tracker),
|
|
203
|
-
execute: async () => {
|
|
204
|
-
await processSelectedLayer(tracker, formSchemaRegistry, 'Buffer', {
|
|
205
|
-
sqlQueryFn: (layerName, bufferDistance) => `
|
|
206
|
-
SELECT ST_Union(ST_Buffer(geometry, ${bufferDistance})) AS geometry, *
|
|
207
|
-
FROM "${layerName}"
|
|
208
|
-
`,
|
|
209
|
-
gdalFunction: 'ogr2ogr',
|
|
210
|
-
options: (sqlQuery) => [
|
|
211
|
-
'-f',
|
|
212
|
-
'GeoJSON',
|
|
213
|
-
'-dialect',
|
|
214
|
-
'SQLITE',
|
|
215
|
-
'-sql',
|
|
216
|
-
sqlQuery,
|
|
217
|
-
'output.geojson'
|
|
218
|
-
]
|
|
219
|
-
}, app);
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
commands.addCommand(CommandIDs.dissolve, {
|
|
223
|
-
label: trans.__('Dissolve'),
|
|
224
|
-
isEnabled: () => selectedLayerIsOfType(['VectorLayer'], tracker),
|
|
225
|
-
execute: async () => {
|
|
226
|
-
await processSelectedLayer(tracker, formSchemaRegistry, 'Dissolve', {
|
|
227
|
-
sqlQueryFn: (layerName, dissolveField) => `
|
|
228
|
-
SELECT ST_Union(geometry) AS geometry, ${dissolveField}
|
|
229
|
-
FROM "${layerName}"
|
|
230
|
-
GROUP BY ${dissolveField}
|
|
231
|
-
`,
|
|
232
|
-
gdalFunction: 'ogr2ogr',
|
|
233
|
-
options: (sqlQuery) => [
|
|
234
|
-
'-f',
|
|
235
|
-
'GeoJSON',
|
|
236
|
-
'-dialect',
|
|
237
|
-
'SQLITE',
|
|
238
|
-
'-sql',
|
|
239
|
-
sqlQuery,
|
|
240
|
-
'output.geojson'
|
|
241
|
-
]
|
|
242
|
-
}, app);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
201
|
commands.addCommand(CommandIDs.newGeoJSONEntry, Object.assign({ label: trans.__('New GeoJSON layer'), isEnabled: () => {
|
|
246
202
|
return tracker.currentWidget
|
|
247
203
|
? tracker.currentWidget.model.sharedModel.editable
|
|
@@ -254,8 +210,10 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
254
210
|
createSource: true,
|
|
255
211
|
layerData: { name: 'Custom GeoJSON Layer' },
|
|
256
212
|
sourceType: 'GeoJSONSource',
|
|
257
|
-
layerType: 'VectorLayer'
|
|
213
|
+
layerType: 'VectorLayer',
|
|
258
214
|
}) }, icons.get(CommandIDs.newGeoJSONEntry)));
|
|
215
|
+
//Add processing commands
|
|
216
|
+
addProcessingCommands(app, commands, tracker, trans, formSchemaRegistry);
|
|
259
217
|
commands.addCommand(CommandIDs.newHillshadeEntry, Object.assign({ label: trans.__('New Hillshade layer'), isEnabled: () => {
|
|
260
218
|
return tracker.currentWidget
|
|
261
219
|
? tracker.currentWidget.model.sharedModel.editable
|
|
@@ -268,7 +226,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
268
226
|
createSource: true,
|
|
269
227
|
layerData: { name: 'Custom Hillshade Layer' },
|
|
270
228
|
sourceType: 'RasterDemSource',
|
|
271
|
-
layerType: 'HillshadeLayer'
|
|
229
|
+
layerType: 'HillshadeLayer',
|
|
272
230
|
}) }, icons.get(CommandIDs.newHillshadeEntry)));
|
|
273
231
|
commands.addCommand(CommandIDs.newImageEntry, Object.assign({ label: trans.__('New Image layer'), isEnabled: () => {
|
|
274
232
|
return tracker.currentWidget
|
|
@@ -287,12 +245,12 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
287
245
|
[-80.425, 46.437],
|
|
288
246
|
[-71.516, 46.437],
|
|
289
247
|
[-71.516, 37.936],
|
|
290
|
-
[-80.425, 37.936]
|
|
291
|
-
]
|
|
248
|
+
[-80.425, 37.936],
|
|
249
|
+
],
|
|
292
250
|
},
|
|
293
251
|
layerData: { name: 'Custom Image Layer' },
|
|
294
252
|
sourceType: 'ImageSource',
|
|
295
|
-
layerType: 'ImageLayer'
|
|
253
|
+
layerType: 'ImageLayer',
|
|
296
254
|
}) }, icons.get(CommandIDs.newImageEntry)));
|
|
297
255
|
commands.addCommand(CommandIDs.newVideoEntry, Object.assign({ label: trans.__('New Video layer'), isEnabled: () => {
|
|
298
256
|
return tracker.currentWidget
|
|
@@ -308,18 +266,18 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
308
266
|
name: 'Custom Video Source',
|
|
309
267
|
urls: [
|
|
310
268
|
'https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4',
|
|
311
|
-
'https://static-assets.mapbox.com/mapbox-gl-js/drone.webm'
|
|
269
|
+
'https://static-assets.mapbox.com/mapbox-gl-js/drone.webm',
|
|
312
270
|
],
|
|
313
271
|
coordinates: [
|
|
314
272
|
[-122.51596391201019, 37.56238816766053],
|
|
315
273
|
[-122.51467645168304, 37.56410183312965],
|
|
316
274
|
[-122.51309394836426, 37.563391708549425],
|
|
317
|
-
[-122.51423120498657, 37.56161849366671]
|
|
318
|
-
]
|
|
275
|
+
[-122.51423120498657, 37.56161849366671],
|
|
276
|
+
],
|
|
319
277
|
},
|
|
320
278
|
layerData: { name: 'Custom Video Layer' },
|
|
321
279
|
sourceType: 'VideoSource',
|
|
322
|
-
layerType: 'RasterLayer'
|
|
280
|
+
layerType: 'RasterLayer',
|
|
323
281
|
}) }, icons.get(CommandIDs.newVideoEntry)));
|
|
324
282
|
commands.addCommand(CommandIDs.newGeoTiffEntry, Object.assign({ label: trans.__('New GeoTiff layer'), isEnabled: () => {
|
|
325
283
|
return tracker.currentWidget
|
|
@@ -333,11 +291,11 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
333
291
|
createSource: true,
|
|
334
292
|
sourceData: {
|
|
335
293
|
name: 'Custom GeoTiff Source',
|
|
336
|
-
urls: [{}]
|
|
294
|
+
urls: [{}],
|
|
337
295
|
},
|
|
338
296
|
layerData: { name: 'Custom GeoTiff Layer' },
|
|
339
297
|
sourceType: 'GeoTiffSource',
|
|
340
|
-
layerType: 'WebGlLayer'
|
|
298
|
+
layerType: 'WebGlLayer',
|
|
341
299
|
}) }, icons.get(CommandIDs.newGeoTiffEntry)));
|
|
342
300
|
commands.addCommand(CommandIDs.newShapefileEntry, Object.assign({ label: trans.__('New Shapefile Layer'), isEnabled: () => {
|
|
343
301
|
return tracker.currentWidget
|
|
@@ -352,7 +310,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
352
310
|
sourceData: { name: 'Custom Shapefile Source' },
|
|
353
311
|
layerData: { name: 'Custom Shapefile Layer' },
|
|
354
312
|
sourceType: 'ShapefileSource',
|
|
355
|
-
layerType: 'VectorLayer'
|
|
313
|
+
layerType: 'VectorLayer',
|
|
356
314
|
}) }, icons.get(CommandIDs.newShapefileEntry)));
|
|
357
315
|
/**
|
|
358
316
|
* LAYERS and LAYER GROUP actions.
|
|
@@ -369,7 +327,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
369
327
|
model === null || model === void 0 ? void 0 : model.sharedModel.updateLayer(layerId, layer);
|
|
370
328
|
}
|
|
371
329
|
});
|
|
372
|
-
}
|
|
330
|
+
},
|
|
373
331
|
});
|
|
374
332
|
commands.addCommand(CommandIDs.removeLayer, {
|
|
375
333
|
label: trans.__('Remove Layer'),
|
|
@@ -379,7 +337,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
379
337
|
Private.removeSelectedItems(model, 'layer', selection => {
|
|
380
338
|
model === null || model === void 0 ? void 0 : model.removeLayer(selection);
|
|
381
339
|
});
|
|
382
|
-
}
|
|
340
|
+
},
|
|
383
341
|
});
|
|
384
342
|
commands.addCommand(CommandIDs.renameGroup, {
|
|
385
343
|
label: trans.__('Rename Group'),
|
|
@@ -389,7 +347,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
389
347
|
await Private.renameSelectedItem(model, 'group', (groupName, newName) => {
|
|
390
348
|
model === null || model === void 0 ? void 0 : model.renameLayerGroup(groupName, newName);
|
|
391
349
|
});
|
|
392
|
-
}
|
|
350
|
+
},
|
|
393
351
|
});
|
|
394
352
|
commands.addCommand(CommandIDs.removeGroup, {
|
|
395
353
|
label: trans.__('Remove Group'),
|
|
@@ -399,7 +357,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
399
357
|
Private.removeSelectedItems(model, 'group', selection => {
|
|
400
358
|
model === null || model === void 0 ? void 0 : model.removeLayerGroup(selection);
|
|
401
359
|
});
|
|
402
|
-
}
|
|
360
|
+
},
|
|
403
361
|
});
|
|
404
362
|
commands.addCommand(CommandIDs.moveLayersToGroup, {
|
|
405
363
|
label: args => args['label'] ? args['label'] : trans.__('Move to Root'),
|
|
@@ -412,7 +370,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
412
370
|
return;
|
|
413
371
|
}
|
|
414
372
|
model.moveItemsToGroup(Object.keys(selectedLayers), groupName);
|
|
415
|
-
}
|
|
373
|
+
},
|
|
416
374
|
});
|
|
417
375
|
commands.addCommand(CommandIDs.moveLayerToNewGroup, {
|
|
418
376
|
label: trans.__('Move Selected Layers to New Group'),
|
|
@@ -463,10 +421,10 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
463
421
|
});
|
|
464
422
|
const newLayerGroup = {
|
|
465
423
|
name: newName,
|
|
466
|
-
layers: layers
|
|
424
|
+
layers: layers,
|
|
467
425
|
};
|
|
468
426
|
model.addNewLayerGroup(selectedLayers, newLayerGroup);
|
|
469
|
-
}
|
|
427
|
+
},
|
|
470
428
|
});
|
|
471
429
|
/**
|
|
472
430
|
* Source actions
|
|
@@ -483,7 +441,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
483
441
|
model === null || model === void 0 ? void 0 : model.sharedModel.updateSource(sourceId, source);
|
|
484
442
|
}
|
|
485
443
|
});
|
|
486
|
-
}
|
|
444
|
+
},
|
|
487
445
|
});
|
|
488
446
|
commands.addCommand(CommandIDs.removeSource, {
|
|
489
447
|
label: trans.__('Remove Source'),
|
|
@@ -499,7 +457,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
499
457
|
showErrorMessage('Remove source error', 'The source is used by a layer.');
|
|
500
458
|
}
|
|
501
459
|
});
|
|
502
|
-
}
|
|
460
|
+
},
|
|
503
461
|
});
|
|
504
462
|
// Console commands
|
|
505
463
|
commands.addCommand(CommandIDs.toggleConsole, {
|
|
@@ -522,7 +480,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
522
480
|
execute: async () => {
|
|
523
481
|
await Private.toggleConsole(tracker);
|
|
524
482
|
commands.notifyCommandChanged(CommandIDs.toggleConsole);
|
|
525
|
-
}
|
|
483
|
+
},
|
|
526
484
|
});
|
|
527
485
|
commands.addCommand(CommandIDs.executeConsole, {
|
|
528
486
|
label: trans.__('Execute console'),
|
|
@@ -532,7 +490,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
532
490
|
? tracker.currentWidget.model.sharedModel.editable
|
|
533
491
|
: false;
|
|
534
492
|
},
|
|
535
|
-
execute: () => Private.executeConsole(tracker)
|
|
493
|
+
execute: () => Private.executeConsole(tracker),
|
|
536
494
|
});
|
|
537
495
|
commands.addCommand(CommandIDs.removeConsole, {
|
|
538
496
|
label: trans.__('Remove console'),
|
|
@@ -542,7 +500,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
542
500
|
? tracker.currentWidget.model.sharedModel.editable
|
|
543
501
|
: false;
|
|
544
502
|
},
|
|
545
|
-
execute: () => Private.removeConsole(tracker)
|
|
503
|
+
execute: () => Private.removeConsole(tracker),
|
|
546
504
|
});
|
|
547
505
|
commands.addCommand(CommandIDs.invokeCompleter, {
|
|
548
506
|
label: trans.__('Display the completion helper.'),
|
|
@@ -559,7 +517,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
559
517
|
if (id) {
|
|
560
518
|
return completionProviderManager.invoke(id);
|
|
561
519
|
}
|
|
562
|
-
}
|
|
520
|
+
},
|
|
563
521
|
});
|
|
564
522
|
commands.addCommand(CommandIDs.selectCompleter, {
|
|
565
523
|
label: trans.__('Select the completion suggestion.'),
|
|
@@ -576,7 +534,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
576
534
|
if (id) {
|
|
577
535
|
return completionProviderManager.select(id);
|
|
578
536
|
}
|
|
579
|
-
}
|
|
537
|
+
},
|
|
580
538
|
});
|
|
581
539
|
commands.addCommand(CommandIDs.zoomToLayer, {
|
|
582
540
|
label: trans.__('Zoom to Layer'),
|
|
@@ -594,7 +552,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
594
552
|
}
|
|
595
553
|
const layerId = Object.keys(selectedItems)[0];
|
|
596
554
|
model.centerOnPosition(layerId);
|
|
597
|
-
}
|
|
555
|
+
},
|
|
598
556
|
});
|
|
599
557
|
commands.addCommand(CommandIDs.downloadGeoJSON, {
|
|
600
558
|
label: trans.__('Download as GeoJSON'),
|
|
@@ -612,7 +570,9 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
612
570
|
}
|
|
613
571
|
const model = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model;
|
|
614
572
|
const sources = (_b = model.sharedModel.sources) !== null && _b !== void 0 ? _b : {};
|
|
615
|
-
const exportSchema = Object.assign({}, formSchemaRegistry
|
|
573
|
+
const exportSchema = Object.assign({}, formSchemaRegistry
|
|
574
|
+
.getSchemas()
|
|
575
|
+
.get('ExportGeoJSONSchema'));
|
|
616
576
|
const formValues = await new Promise(resolve => {
|
|
617
577
|
const dialog = new ProcessingFormDialog({
|
|
618
578
|
title: 'Download GeoJSON',
|
|
@@ -624,7 +584,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
624
584
|
syncData: (props) => {
|
|
625
585
|
resolve(props);
|
|
626
586
|
dialog.dispose();
|
|
627
|
-
}
|
|
587
|
+
},
|
|
628
588
|
});
|
|
629
589
|
dialog.launch();
|
|
630
590
|
});
|
|
@@ -639,7 +599,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
639
599
|
return;
|
|
640
600
|
}
|
|
641
601
|
downloadFile(geojsonString, `${exportFileName}.geojson`, 'application/geo+json');
|
|
642
|
-
}
|
|
602
|
+
},
|
|
643
603
|
});
|
|
644
604
|
commands.addCommand(CommandIDs.getGeolocation, {
|
|
645
605
|
label: trans.__('Center on Geolocation'),
|
|
@@ -649,16 +609,16 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
649
609
|
const options = {
|
|
650
610
|
enableHighAccuracy: true,
|
|
651
611
|
timeout: 5000,
|
|
652
|
-
maximumAge: 0
|
|
612
|
+
maximumAge: 0,
|
|
653
613
|
};
|
|
654
614
|
const success = (pos) => {
|
|
655
615
|
const location = fromLonLat([
|
|
656
616
|
pos.coords.longitude,
|
|
657
|
-
pos.coords.latitude
|
|
617
|
+
pos.coords.latitude,
|
|
658
618
|
]);
|
|
659
619
|
const Jgislocation = {
|
|
660
620
|
x: location[0],
|
|
661
|
-
y: location[1]
|
|
621
|
+
y: location[1],
|
|
662
622
|
};
|
|
663
623
|
if (viewModel) {
|
|
664
624
|
viewModel.geolocationChanged.emit(Jgislocation);
|
|
@@ -669,7 +629,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
669
629
|
};
|
|
670
630
|
navigator.geolocation.getCurrentPosition(success, error, options);
|
|
671
631
|
},
|
|
672
|
-
icon: targetWithCenterIcon
|
|
632
|
+
icon: targetWithCenterIcon,
|
|
673
633
|
});
|
|
674
634
|
loadKeybindings(commands, keybindings);
|
|
675
635
|
}
|
|
@@ -684,7 +644,7 @@ var Private;
|
|
|
684
644
|
const dialog = new LayerBrowserWidget({
|
|
685
645
|
model: current.model,
|
|
686
646
|
registry: layerBrowserRegistry.getRegistryLayers(),
|
|
687
|
-
formSchemaRegistry
|
|
647
|
+
formSchemaRegistry,
|
|
688
648
|
});
|
|
689
649
|
await dialog.launch();
|
|
690
650
|
};
|
|
@@ -698,13 +658,13 @@ var Private;
|
|
|
698
658
|
}
|
|
699
659
|
const dialog = new SymbologyWidget({
|
|
700
660
|
model: current.model,
|
|
701
|
-
state
|
|
661
|
+
state,
|
|
702
662
|
});
|
|
703
663
|
await dialog.launch();
|
|
704
664
|
};
|
|
705
665
|
}
|
|
706
666
|
Private.createSymbologyDialog = createSymbologyDialog;
|
|
707
|
-
function createEntry({ tracker, formSchemaRegistry, title, createLayer, createSource, sourceData, layerData, sourceType, layerType }) {
|
|
667
|
+
function createEntry({ tracker, formSchemaRegistry, title, createLayer, createSource, sourceData, layerData, sourceType, layerType, }) {
|
|
708
668
|
return async () => {
|
|
709
669
|
const current = tracker.currentWidget;
|
|
710
670
|
if (!current) {
|
|
@@ -719,7 +679,7 @@ var Private;
|
|
|
719
679
|
sourceType,
|
|
720
680
|
layerData,
|
|
721
681
|
layerType,
|
|
722
|
-
formSchemaRegistry
|
|
682
|
+
formSchemaRegistry,
|
|
723
683
|
});
|
|
724
684
|
await dialog.launch();
|
|
725
685
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
|
|
1
2
|
import { ConsolePanel } from '@jupyterlab/console';
|
|
2
|
-
import { ServiceManager } from '@jupyterlab/services';
|
|
3
|
-
import { BoxPanel, Widget } from '@lumino/widgets';
|
|
4
3
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
5
|
-
import {
|
|
4
|
+
import { ServiceManager } from '@jupyterlab/services';
|
|
6
5
|
import { CommandRegistry } from '@lumino/commands';
|
|
6
|
+
import { BoxPanel, Widget } from '@lumino/widgets';
|
|
7
7
|
export declare class ConsoleView extends BoxPanel {
|
|
8
8
|
constructor(options: ConsoleView.IOptions);
|
|
9
9
|
get consolePanel(): ConsolePanel;
|