Skip to content

Commit

Permalink
fix: make print preview not crash when drag and dropped layer present…
Browse files Browse the repository at this point in the history
…; show theirs and other missing titles in legend (#1469)
  • Loading branch information
Grammostola authored Feb 18, 2022
1 parent 4bf49d3 commit 82d6c53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/controls/print/print-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ const LayerRow = function LayerRow(options) {
const style = viewer.getStyle(layer.get('styleName'));
if (style && style[0]) {
content = getStyleContent(title, style);
} else if (!layer.get('type').includes('AGS')) {
} else if ((!layer.get('type')) || (layer.get('type').includes('AGS'))) {
content = getTitleWithIcon(title, '');
} else {
content = await getJSONContent(title);
}
return `
Expand Down
2 changes: 1 addition & 1 deletion src/controls/print/print-resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export default function PrintResize(options = {}) {
// Remove styles instead?
const styles = feature.getStyle();
const scale = 1;
if (styles) {
if (Array.isArray(styles)) {
styles.forEach(style => {
const image = style.getImage();
if (image) {
Expand Down

0 comments on commit 82d6c53

Please sign in to comment.