Skip to content

Commit fe3849b

Browse files
committed
Move transition settings to landmark
1 parent 9578411 commit fe3849b

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

packages/base/src/commands/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,11 @@ export function addCommands(
10791079
return;
10801080
}
10811081

1082-
const layerParams: ILandmarkLayer = { extent, zoom };
1082+
const layerParams: ILandmarkLayer = {
1083+
extent,
1084+
zoom,
1085+
transition: { type: 'linear', time: 1 },
1086+
};
10831087
const layerModel: IJGISLayer = {
10841088
type: 'LandmarkLayer',
10851089
visible: true,

packages/base/src/mainview/mainView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,13 +2053,13 @@ export class MainView extends React.Component<IProps, IStates> {
20532053
const coords = getCenter(layerParams.extent);
20542054

20552055
// TODO: Should pass args through signal??
2056-
const { story } = this._model.getSelectedStory();
2056+
// const { story } = this._model.getSelectedStory();
20572057

20582058
this._flyToPosition(
20592059
{ x: coords[0], y: coords[1] },
20602060
layerParams.zoom,
2061-
(story?.transition?.time ?? 1) * 1000, // second -> ms
2062-
story?.transition?.type,
2061+
(layerParams.transition.time ?? 1) * 1000, // seconds -> ms
2062+
layerParams.transition.type,
20632063
);
20642064

20652065
return;

packages/schema/src/schema/project/jgis.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,6 @@
151151
"enum": ["guided", "unguided"],
152152
"description": "The type of story map"
153153
},
154-
"transition": {
155-
"type": "object",
156-
"description": "Transition configuration between landmarks",
157-
"properties": {
158-
"type": {
159-
"type": "string",
160-
"enum": ["linear", "immediate", "smooth"],
161-
"description": "Transition animation style"
162-
},
163-
"time": {
164-
"type": "number",
165-
"description": "The time in seconds for the transition"
166-
}
167-
},
168-
"required": ["type", "time"]
169-
},
170154
"landmarks": {
171155
"type": "array",
172156
"default": [],

packages/schema/src/schema/project/layers/landmarkLayer.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "LandmarkLayer",
44
"title": "ILandmarkLayer",
55
"additionalProperties": false,
6-
"required": ["zoom", "extent"],
6+
"required": ["zoom", "extent", "transition"],
77
"properties": {
88
"content": {
99
"type": "object",
@@ -32,6 +32,24 @@
3232
"items": {
3333
"type": "number"
3434
}
35+
},
36+
"transition": {
37+
"type": "object",
38+
"description": "Transition configuration between to this landmark",
39+
"properties": {
40+
"type": {
41+
"type": "string",
42+
"enum": ["linear", "immediate", "smooth"],
43+
"description": "Transition animation style",
44+
"default": "linear"
45+
},
46+
"time": {
47+
"type": "number",
48+
"description": "The time in seconds for the transition",
49+
"default": 1
50+
}
51+
},
52+
"required": ["type", "time"]
3553
}
3654
}
3755
}

0 commit comments

Comments
 (0)