Improved firesmap
This commit is contained in:
parent
4c5aef6e4f
commit
56a7468ae3
7 changed files with 214 additions and 132 deletions
|
|
@ -11,15 +11,17 @@ export default function FireList(props) {
|
|||
const {
|
||||
fires, scale, useMarkers, nasa
|
||||
} = props;
|
||||
const items = fires.map(({ _id, ...otherProps }) => {
|
||||
if (useMarkers && scale) {
|
||||
return (<FireIconMark key={_id} nasa={nasa} {...otherProps} />);
|
||||
}
|
||||
if (!nasa && !scale) {
|
||||
return (<FirePixel key={_id} nasa={nasa} {...otherProps} />);
|
||||
}
|
||||
return (<FireCircleMark key={_id} nasa={nasa} {...otherProps} />);
|
||||
});
|
||||
const useMarks = useMarkers && scale;
|
||||
const usePixel = !nasa || !scale;
|
||||
/* console.log(`Using marks: ${useMarks}, using pixels: ${usePixel}`); */
|
||||
let items;
|
||||
if (useMarks) {
|
||||
items = fires.map(({ _id, ...otherProps }) => (<FireIconMark key={_id} nasa={nasa} {...otherProps} />));
|
||||
} else if (usePixel) {
|
||||
items = fires.map(({ _id, ...otherProps }) => (<FirePixel key={_id} nasa={nasa} {...otherProps} />));
|
||||
} else {
|
||||
items = fires.map(({ _id, ...otherProps }) => (<FireCircleMark key={_id} nasa={nasa} {...otherProps} />));
|
||||
}
|
||||
return (<div style={{ display: 'none' }}>{items}</div>);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue