mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
feat(studio): a book map can be of a country, a day or one stop, framed by hand
Book schema revision 12 adds five optional fields to the map element: view (a hand-framed box, east up to 540 for the antimeridian), stop, country, dayDate and coastDetail. Absent means a map saved before them, null means not narrowed that way. routeFor, isStale and refreshPatch honour every scope and never widen a narrowed map to the whole journey. Country maps from the travel looks and the entry-page map of the auto layout carried tripId null like a journey map, so refreshing one from the inspector turned it into the whole route; maps saved before revision 12 are now read off what they hold and refresh writes their scope down. The looks and the auto layout write the scope from now on, so the parity digests of those pages move. The book engine's add takes a country, a date or an entry as the map's scope, style takes view and coastDetail, and describe-spread says what a map is of. Pasting a style never copies a map's view.
This commit is contained in:
@@ -273,9 +273,11 @@ function MapContent({ el, set, t, stats, journeyPath }: MapPropsInput) {
|
||||
* nothing. The roads go with the old legs, since entry i is the
|
||||
* way from stop i to stop i + 1 of the route that is gone.
|
||||
*/
|
||||
// Picking a trip or the whole journey is what the map is of from now on: no country, day or stop left over.
|
||||
const scope = { tripId, country: null, dayDate: null, stop: null }
|
||||
set({
|
||||
...refreshPatch({ ...el, tripId }, stats),
|
||||
tripId,
|
||||
...refreshPatch({ ...el, ...scope }, stats),
|
||||
...scope,
|
||||
path: tripId == null
|
||||
? journeyPath.slice(0, MAX_PATH_SEGMENTS).map(seg => seg.slice(0, MAX_PATH_POINTS))
|
||||
: [],
|
||||
|
||||
Reference in New Issue
Block a user