diff --git a/crates/assistant/skills/print-layout/SKILL.md b/crates/assistant/skills/print-layout/SKILL.md index f0b62327f3..dc333973c8 100644 --- a/crates/assistant/skills/print-layout/SKILL.md +++ b/crates/assistant/skills/print-layout/SKILL.md @@ -27,7 +27,7 @@ description: Make a printable page layout — map frame, title, legend, north ar labels' size) and `"fit"` (`"adjustDivisionValue"`, `"adjustDivision"`, `"adjustWidth"`). A `"legend"` can take `"columns"` (1–6), `"fit"` (`"manual"`, `"adjustSize"`, `"adjustColumns"`, `"adjustColumnsAndSize"`: shrink its text or add columns to fit its box), `"subtitle"` (one line under its title), `"sizes": "nested"` (a point layer's marker sizes one inside another on a common base), `"showCounts": true` (each class row ends in its number of features; none for a layer read from a database, over the web or a view at a time from other files), - `"showLayerNames": false`, `"layerOrder": [""]` (those layers first, the map unchanged) and `"classLabels"` (`{"": {"": ""}}`: its own text for a + `"showLayerNames": false`, `"layerOrder": [""]` (those layers first, the map unchanged), `"columnBreaks": [""]` (each starts a column; no `"columns"` above 1 beside them) and `"classLabels"` (`{"": {"": ""}}`: its own text for a class, the layer keeping its label). A `"picture"` takes a `"path"` (a PNG or JPEG file; it remembers the file) or an `"image"` (base64); `layout.update` with `"path"` reads it again. A `"text"` or `"dynamicText"` can take diff --git a/crates/engine/command-surface.txt b/crates/engine/command-surface.txt index fc45fd4648..ef0d908570 100644 --- a/crates/engine/command-surface.txt +++ b/crates/engine/command-surface.txt @@ -284,7 +284,7 @@ layer.transparency layer? value layer.visibility layer? visible? layer.zoomTo layer? layout.activate name layout -layout.addElement layout? kind frame? of? text? size? color? bold? italic? align? letterSpacing? rotation? wrap? valign? lineSpacing? case? font? fallback? title? subtitle? allClasses? hideOther? showNoData? exclude? layerOrder? columns? textSize? classLabels? sizes? showCounts? showLayerNames? orientation? ticks? tickSide? reverse? fill? width? radius? dash? dir? head? angle? length? image? path? layer? field? label? group? statistic? order? bars? other? stack? values? decimals? barColor? classes? labelAlign? mirror? max? hideLabels? barOutline? rows? fields? header? step? type? crs? short? mgrs? labels? style? tickLength? format? hemisphere? edges? labelOrientation? labelSize? off? name? direction? at? section? band? side? gap? thickness? unit? lineColor? lineWidth? min? guides? outline? units? divisions? subdivisions? divisionsBeforeZero? labelPosition? unitLabel? unitLabelPosition? fit? x? y? w? h? background? +layout.addElement layout? kind frame? of? text? size? color? bold? italic? align? letterSpacing? rotation? wrap? valign? lineSpacing? case? font? fallback? title? subtitle? allClasses? hideOther? showNoData? exclude? layerOrder? columnBreaks? columns? textSize? classLabels? sizes? showCounts? showLayerNames? orientation? ticks? tickSide? reverse? fill? width? radius? dash? dir? head? angle? length? image? path? layer? field? label? group? statistic? order? bars? other? stack? values? decimals? barColor? classes? labelAlign? mirror? max? hideLabels? barOutline? rows? fields? header? step? type? crs? short? mgrs? labels? style? tickLength? format? hemisphere? edges? labelOrientation? labelSize? off? name? direction? at? section? band? side? gap? thickness? unit? lineColor? lineWidth? min? guides? outline? units? divisions? subdivisions? divisionsBeforeZero? labelPosition? unitLabel? unitLabelPosition? fit? x? y? w? h? background? layout.addFrame layout? shape? points? map? x? y? w? h? layout.arrange layout? element to layout.arrangement favourite? save? arrangement? remove? @@ -306,7 +306,7 @@ layout.save layout? path layout.series layout? layer nameField? frame? margin? off? layout.seriesPage layout? page layout.seriesRefresh layout? -layout.update layout? element x? y? w? h? name? visible? locked? text? size? color? bold? italic? align? letterSpacing? rotation? wrap? valign? lineSpacing? case? font? fallback? title? subtitle? allClasses? hideOther? showNoData? exclude? layerOrder? labels? classLabels? columns? textSize? showLayerNames? sizes? showCounts? orientation? ticks? tickSide? reverse? style? fill? outline? radius? width? dash? dir? head? angle? length? units? divisions? subdivisions? divisionsBeforeZero? labelPosition? unitLabel? unitLabelPosition? fit? map? scale? center? bearing? pitch? grid? extentIndicator? border? section? layer? field? label? group? statistic? order? bars? other? stack? values? decimals? barColor? classes? labelAlign? mirror? max? band? side? gap? thickness? unit? lineColor? lineWidth? min? guides? barOutline? hideLabels? rows? fields? header? image? path? background? +layout.update layout? element x? y? w? h? name? visible? locked? text? size? color? bold? italic? align? letterSpacing? rotation? wrap? valign? lineSpacing? case? font? fallback? title? subtitle? allClasses? hideOther? showNoData? exclude? layerOrder? columnBreaks? labels? classLabels? columns? textSize? showLayerNames? sizes? showCounts? orientation? ticks? tickSide? reverse? style? fill? outline? radius? width? dash? dir? head? angle? length? units? divisions? subdivisions? divisionsBeforeZero? labelPosition? unitLabel? unitLabelPosition? fit? map? scale? center? bearing? pitch? grid? extentIndicator? border? section? layer? field? label? group? statistic? order? bars? other? stack? values? decimals? barColor? classes? labelAlign? mirror? max? band? side? gap? thickness? unit? lineColor? lineWidth? min? guides? barOutline? hideLabels? rows? fields? header? image? path? background? locator.find locator? text limit? zoom? map.activate name map.addTiles url kind? name? bounds? attribution? minZoom? maxZoom? tileSize? singleImage? tms? subdomains? layers? styleLayers? opacity? blend? resampling? overlay? top? replace? id? view? start? end? unit? interval? dates? legend? connection? anonymous? diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index e5eeb2ba08..12fad7430c 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -7439,7 +7439,8 @@ pub(crate) fn legends_follow_layer(s: &mut Session, old: &str, new: Option<&str> .map(|e| e.id) .collect(); for e in &mut layout.elements { - if let rustgis_map::layout::ElementKind::Legend { frame, exclude, layer_order, labels, class_labels, .. } = &mut e.kind + if let rustgis_map::layout::ElementKind::Legend { frame, exclude, layer_order, column_breaks, labels, class_labels, .. } = + &mut e.kind && frames.contains(frame) { // Its label (#1654), taken off the old name; onto the new one unless another layer @@ -7474,11 +7475,14 @@ pub(crate) fn legends_follow_layer(s: &mut Session, old: &str, new: Option<&str> Some(n) => rename_listed(exclude, old, n), None => exclude.retain(|x| !x.eq_ignore_ascii_case(old)), } - // Its place in the legend's order (#3279) goes with it; onto a name already - // there, the layers sharing it go together at the first of the two. - match new { - Some(n) => rename_listed(layer_order, old, n), - None => layer_order.retain(|x| !x.eq_ignore_ascii_case(old)), + // Its place in the legend's order (#3279) goes with it, and the column it starts + // (#3445); onto a name already there, the list keeps one entry, where the first + // of the two was. + for list in [layer_order, column_breaks] { + match new { + Some(n) => rename_listed(list, old, n), + None => list.retain(|x| !x.eq_ignore_ascii_case(old)), + } } } } diff --git a/crates/engine/src/cmd/layout.rs b/crates/engine/src/cmd/layout.rs index fcf3484f75..41d9d83521 100644 --- a/crates/engine/src/cmd/layout.rs +++ b/crates/engine/src/cmd/layout.rs @@ -217,6 +217,7 @@ pub fn commands() -> Vec { r##""showNoData"?: bool (legend: include Graduated Colors’ missing-value symbol; default false), "##, r##""exclude"?: [layer names] (legend: layers it leaves out though the map draws them), "##, r##""layerOrder"?: [layer names] (legend: these layers first, in this order, the others after them as the map draws them; the map is not changed), "##, + r##""columnBreaks"?: [layer names] (legend: each of these layers starts a column, 5 at most, so "columns" above 1 and the fits that add columns are refused beside them), "##, r##""columns"?: 1..6 (legend: the columns its rows are laid in; default 1; with a fit that adds columns, the fewest it starts from), "##, r##""textSize"?: points, 4 to 100 (legend: its layers' names and classes' labels, its title, rows, swatches and gaps following in proportion and a point symbol keeping the size the map draws it at; default 9; scaleBar: its labels, the room over the bar and between them following, the bar keeping its size; default 8; table: its text, its rows and columns following; default 8; refused outside that range, and for other kinds unless null, as showNoData is), "##, r##""classLabels"?: {"": {"": ""}} (legend: its own text for a class, by the label the layer shows for it, up to 200 characters; the layer keeps its label; a layer or class it can't find is refused), "##, @@ -333,6 +334,7 @@ pub fn commands() -> Vec { r##""showNoData"?: bool (legend; default false), "##, r##""exclude"?: [layer names] (legend; [] lists every layer again), "##, r##""layerOrder"?: [layer names] (legend, as in layout.addElement; [] returns to the map's order), "##, + r##""columnBreaks"?: [layer names] (legend, as in layout.addElement; [] takes them off), "##, r##""labels"?: {"": "