Skip to content

Commit 886a827

Browse files
committed
Landmark -> Story Segment
1 parent 586cc6a commit 886a827

File tree

23 files changed

+134
-158
lines changed

23 files changed

+134
-158
lines changed

examples/story_map.jGIS

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"zoom": 14.080181481426658
5959
},
60-
"type": "LandmarkLayer",
60+
"type": "StorySegmentLayer",
6161
"visible": true
6262
},
6363
"8591b32f-11c0-4d70-a997-e94d258bb100": {
@@ -80,7 +80,7 @@
8080
},
8181
"zoom": 15.368058180489786
8282
},
83-
"type": "LandmarkLayer",
83+
"type": "StorySegmentLayer",
8484
"visible": true
8585
},
8686
"93080edc-815f-4364-a874-90fd53a60c35": {
@@ -127,18 +127,18 @@
127127
},
128128
"zoom": 15.230368389488868
129129
},
130-
"type": "LandmarkLayer",
130+
"type": "StorySegmentLayer",
131131
"visible": true
132132
}
133133
},
134134
"metadata": {},
135135
"options": {
136136
"bearing": 0.0,
137137
"extent": [
138-
255874.06496440643,
139-
6248688.604308756,
140-
260496.085575599,
141-
6252093.017728101
138+
256226.31587442243,
139+
6249293.335639824,
140+
260143.83466558298,
141+
6251488.286397033
142142
],
143143
"latitude": 48.855574302496535,
144144
"longitude": 2.319315992465925,
@@ -200,31 +200,8 @@
200200
},
201201
"stories": {
202202
"1b181980-a95a-4f23-8e5d-980c66ff93ea": {
203-
"landmarks": [
204-
"5f790e80-230b-4c00-8426-b3a9385937a5",
205-
"8591b32f-11c0-4d70-a997-e94d258bb100",
206-
"bcd22241-e404-44b4-873b-81e6a4ccad84"
207-
],
208203
"storyType": "guided",
209204
"title": "Famous Statues"
210-
},
211-
"3ee5537b-0cf6-4a23-b373-3d5c9cc29893": {
212-
"landmarks": [
213-
"5f790e80-230b-4c00-8426-b3a9385937a5",
214-
"8591b32f-11c0-4d70-a997-e94d258bb100",
215-
"bcd22241-e404-44b4-873b-81e6a4ccad84"
216-
],
217-
"storyType": "guided",
218-
"title": "New Story"
219-
},
220-
"a7522918-43ea-490b-a4f2-cdcfb33a13e3": {
221-
"landmarks": [
222-
"5f790e80-230b-4c00-8426-b3a9385937a5",
223-
"8591b32f-11c0-4d70-a997-e94d258bb100",
224-
"bcd22241-e404-44b4-873b-81e6a4ccad84"
225-
],
226-
"storyType": "guided",
227-
"title": "New Story"
228205
}
229206
}
230-
}
207+
}

packages/base/src/commands/BaseCommandIDs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ export const showAnnotationsTab = 'jupytergis:showAnnotationsTab';
6767
export const showIdentifyPanelTab = 'jupytergis:showIdentifyPanelTab';
6868

6969
// Story maps
70-
export const addLandmark = 'jupytergis:addLandmark';
70+
export const addStorySegment = 'jupytergis:addStorySegment';

packages/base/src/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ export function addCommands(
10541054
...icons.get(CommandIDs.addMarker),
10551055
});
10561056

1057-
commands.addCommand(CommandIDs.addLandmark, {
1057+
commands.addCommand(CommandIDs.addStorySegment, {
10581058
label: trans.__('Add Story Segment'),
10591059
isEnabled: () => {
10601060
return tracker.currentWidget
@@ -1068,7 +1068,7 @@ export function addCommands(
10681068
}
10691069
current.model.addStorySegment();
10701070
},
1071-
...icons.get(CommandIDs.addLandmark),
1071+
...icons.get(CommandIDs.addStorySegment),
10721072
});
10731073

10741074
loadKeybindings(commands, keybindings);

packages/base/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const iconObject = {
5858
[CommandIDs.identify]: { icon: infoIcon },
5959
[CommandIDs.temporalController]: { icon: clockIcon },
6060
[CommandIDs.addMarker]: { icon: markerIcon },
61-
[CommandIDs.addLandmark]: { iconClass: 'fa fa-link' },
61+
[CommandIDs.addStorySegment]: { iconClass: 'fa fa-link' },
6262
};
6363

6464
/**

packages/base/src/formbuilder/formselectors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { LayerType, SourceType } from '@jupytergis/schema';
33
import {
44
HeatmapLayerPropertiesForm,
55
HillshadeLayerPropertiesForm,
6-
LandmarkLayerPropertiesForm,
6+
StorySegmentLayerPropertiesForm,
77
LayerPropertiesForm,
88
VectorLayerPropertiesForm,
99
WebGlLayerPropertiesForm,
@@ -35,8 +35,8 @@ export function getLayerTypeForm(
3535
case 'HeatmapLayer':
3636
LayerForm = HeatmapLayerPropertiesForm;
3737
break;
38-
case 'LandmarkLayer':
39-
LayerForm = LandmarkLayerPropertiesForm;
38+
case 'StorySegmentLayer':
39+
LayerForm = StorySegmentLayerPropertiesForm;
4040
break;
4141

4242
// ADD MORE FORM TYPES HERE

packages/base/src/formbuilder/objectform/StoryEditorForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export class StoryEditorPropertiesForm extends BaseForm {
1212
uiSchema: IDict,
1313
) {
1414
super.processSchema(data, schema, uiSchema);
15-
this.removeFormEntry('landmarks', data, schema, uiSchema);
15+
this.removeFormEntry('storySegments', data, schema, uiSchema);
1616
}
1717
}

packages/base/src/formbuilder/objectform/components/LandmarkReset.tsx renamed to packages/base/src/formbuilder/objectform/components/StorySegmentReset.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import React from 'react';
55
import { targetWithCenterIcon } from '@/src/icons';
66
import { Button } from '@/src/shared/components/Button';
77

8-
interface ILandmarkResetProps {
8+
interface IStorySegmentResetProps {
99
model?: IJupyterGISModel;
1010
layerId?: string;
1111
}
1212

13-
function LandmarkReset({ model, layerId }: ILandmarkResetProps) {
14-
const handleSetLandmarkToCurrentView = () => {
13+
function StorySegmentReset({ model, layerId }: IStorySegmentResetProps) {
14+
const handleSetStorySegmentToCurrentView = () => {
1515
if (!model || !layerId) {
1616
return;
1717
}
@@ -35,18 +35,18 @@ function LandmarkReset({ model, layerId }: ILandmarkResetProps) {
3535
return (
3636
<div>
3737
<Button
38-
title="Set landmark to current viewport"
39-
onClick={handleSetLandmarkToCurrentView}
38+
title="Set story segment to current viewport"
39+
onClick={handleSetStorySegmentToCurrentView}
4040
>
4141
<LabIcon.resolveReact
4242
icon={targetWithCenterIcon}
4343
className="jp-gis-layerIcon"
4444
tag="span"
4545
/>
46-
Set Landmark Extent
46+
Set Story Segment Extent
4747
</Button>
4848
</div>
4949
);
5050
}
5151

52-
export default LandmarkReset;
52+
export default StorySegmentReset;

packages/base/src/formbuilder/objectform/layer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export * from './hillshadeLayerForm';
33
export * from './layerform';
44
export * from './vectorlayerform';
55
export * from './webGlLayerForm';
6-
export * from './landmarkLayerForm';
6+
export * from './storySegmentLayerForm';

packages/base/src/formbuilder/objectform/layer/landmarkLayerForm.ts renamed to packages/base/src/formbuilder/objectform/layer/storySegmentLayerForm.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { FieldProps } from '@rjsf/core';
33
import * as React from 'react';
44

55
import { LayerPropertiesForm } from './layerform';
6-
import LandmarkReset from '../components/LandmarkReset';
6+
import StorySegmentReset from '../components/StorySegmentReset';
77

8-
export class LandmarkLayerPropertiesForm extends LayerPropertiesForm {
8+
export class StorySegmentLayerPropertiesForm extends LayerPropertiesForm {
99
protected processSchema(
1010
data: IDict<any> | undefined,
1111
schema: IDict,
@@ -20,20 +20,19 @@ export class LandmarkLayerPropertiesForm extends LayerPropertiesForm {
2020
let layerId: string | undefined = undefined;
2121
const selectedKeys = Object.keys(this.props.model.selected);
2222

23-
// Find the first selected landmark
24-
// TODO ! we still need to handle selections better, like there should at least be a getFirstSelected
25-
// ! just do that
23+
// Find the first selected story segment
24+
// ! TODO we still need to handle selections better, like there should at least be a getFirstSelected
2625
for (const key of selectedKeys) {
2726
const layer = this.props.model.getLayer(key);
28-
if (layer && layer.type === 'LandmarkLayer') {
27+
if (layer && layer.type === 'StorySegmentLayer') {
2928
layerId = key;
3029
break;
3130
}
3231
}
3332

3433
uiSchema['extent'] = {
3534
'ui:field': (props: FieldProps) =>
36-
React.createElement(LandmarkReset, {
35+
React.createElement(StorySegmentReset, {
3736
...props,
3837
model: this.props.model,
3938
layerId,

packages/base/src/mainview/mainView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
JgisCoordinates,
3434
JupyterGISModel,
3535
IMarkerSource,
36-
ILandmarkLayer,
36+
IStorySegmentLayer,
3737
} from '@jupytergis/schema';
3838
import { showErrorMessage } from '@jupyterlab/apputils';
3939
import { IObservableMap, ObservableMap } from '@jupyterlab/observables';
@@ -998,7 +998,7 @@ export class MainView extends React.Component<IProps, IStates> {
998998
let source: IJGISSource | undefined;
999999

10001000
// Sourceless layers
1001-
if (!['StacLayer', 'LandmarkLayer'].includes(layer.type)) {
1001+
if (!['StacLayer', 'StorySegmentLayer'].includes(layer.type)) {
10021002
sourceId = layer.parameters?.source;
10031003
if (!sourceId) {
10041004
return;
@@ -1123,7 +1123,7 @@ export class MainView extends React.Component<IProps, IStates> {
11231123
break;
11241124
}
11251125

1126-
case 'LandmarkLayer': {
1126+
case 'StorySegmentLayer': {
11271127
// Special layer not for this
11281128
return;
11291129
}
@@ -1348,7 +1348,7 @@ export class MainView extends React.Component<IProps, IStates> {
13481348
mapLayer: Layer,
13491349
oldLayer?: IDict,
13501350
): Promise<void> {
1351-
layer.type !== 'LandmarkLayer' && mapLayer.setVisible(layer.visible);
1351+
layer.type !== 'StorySegmentLayer' && mapLayer.setVisible(layer.visible);
13521352

13531353
switch (layer.type) {
13541354
case 'RasterLayer': {
@@ -2045,11 +2045,11 @@ export class MainView extends React.Component<IProps, IStates> {
20452045
const layer = this.getLayer(id);
20462046
const source = layer?.getSource();
20472047

2048-
// TODO: Landmark layers don't have an associated OL layer
2048+
// TODO: Story segment layers don't have an associated OL layer
20492049
// This could be better
20502050
if (!layer) {
20512051
const jgisLayer = this._model.getLayer(id);
2052-
const layerParams = jgisLayer?.parameters as ILandmarkLayer;
2052+
const layerParams = jgisLayer?.parameters as IStorySegmentLayer;
20532053
const coords = getCenter(layerParams.extent);
20542054

20552055
// TODO: Should pass args through signal??

0 commit comments

Comments
 (0)