Added initial expression work and UI errors.

This commit is contained in:
orangemug
2020-01-29 08:22:03 +00:00
parent 63ed8c1de3
commit 725b752e35
25 changed files with 360 additions and 53 deletions

View File

@@ -8,8 +8,23 @@ class MessagePanel extends React.Component {
}
render() {
const errors = this.props.errors.map((m, i) => {
return <p key={"error-"+i} className="maputnik-message-panel-error">{m}</p>
const errors = this.props.errors.map((error, idx) => {
let content;
if (error.parsed && error.parsed.type === "layer") {
const {parsed} = error;
const {mapStyle} = this.props;
content = (
<>
Layer <span>'{mapStyle.layers[parsed.data.index].id}'</span>: {parsed.data.message}
</>
);
}
else {
content = error.message;
}
return <p key={"error-"+idx} className="maputnik-message-panel-error">
{content}
</p>
})
const infos = this.props.infos.map((m, i) => {