Do not use internal and actual values anymore (Fixes #42)
This commit is contained in:
parent
b40f4a774e
commit
c0117fa7d6
13 changed files with 421 additions and 393 deletions
|
|
@ -3,8 +3,6 @@ import React from "react";
|
|||
import { Map, ImageOverlay, Marker, LayersControl } from "react-leaflet";
|
||||
import { CRS, point, divIcon } from "leaflet";
|
||||
import map from "lodash/map";
|
||||
import mapValues from "lodash/mapValues";
|
||||
import { toRawIcon } from "config/icon";
|
||||
|
||||
import type { Controls, Control } from "config/flowtypes";
|
||||
|
||||
|
|
@ -50,7 +48,7 @@ export default class ControlMap extends React.PureComponent<ControlMapProps> {
|
|||
}
|
||||
|
||||
createLeafletIcon(control: Control) {
|
||||
const icon = toRawIcon(control.icon, this.props.state);
|
||||
const icon = control.icon(this.props.state);
|
||||
const iconClass = `${icon} mdi-36px`;
|
||||
return divIcon({
|
||||
iconSize: point(36, 36),
|
||||
|
|
@ -61,10 +59,8 @@ export default class ControlMap extends React.PureComponent<ControlMapProps> {
|
|||
}
|
||||
|
||||
iconColor(control: Control): string {
|
||||
const ints = mapValues(this.props.state, (x) => x.internal || x.actual);
|
||||
const acts = mapValues(this.props.state, (x) => x.actual);
|
||||
if (control.iconColor != null) {
|
||||
return control.iconColor(ints, acts, this.props.state);
|
||||
return control.iconColor(this.props.state);
|
||||
}
|
||||
return "#000";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue