-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: group all infra object layers in a single component
Signed-off-by: Clara Ni <[email protected]>
- Loading branch information
Showing
5 changed files
with
116 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import colors from 'common/Map/Consts/colors'; | ||
import { LAYER_GROUPS_ORDER, LAYERS } from 'config/layerOrder'; | ||
|
||
import BufferStops from './BufferStops'; | ||
import Detectors from './Detectors'; | ||
import Electrifications from './Electrifications'; | ||
import NeutralSections from './extensions/SNCF/NeutralSections'; | ||
import SNCF_PSL from './extensions/SNCF/PSL'; | ||
import OperationalPoints from './OperationalPoints'; | ||
import Routes from './Routes'; | ||
import Signals from './Signals'; | ||
import SpeedLimits from './SpeedLimits'; | ||
import Switches from './Switches'; | ||
import TracksGeographic from './TracksGeographic'; | ||
|
||
type InfraObjectLayersProps = { | ||
infraId: number; | ||
mapStyle: 'normal' | 'dark' | 'blueprint' | 'minimal'; | ||
hoveredOperationalPointId?: string; | ||
}; | ||
|
||
const InfraObjectLayers = ({ | ||
infraId, | ||
mapStyle, | ||
hoveredOperationalPointId, | ||
}: InfraObjectLayersProps) => ( | ||
<> | ||
<TracksGeographic | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.TRACKS_GEOGRAPHIC.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<Routes | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.ROUTES.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<OperationalPoints | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.OPERATIONAL_POINTS.GROUP]} | ||
operationnalPointId={hoveredOperationalPointId} | ||
infraID={infraId} | ||
/> | ||
|
||
<Electrifications | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.ELECTRIFICATIONS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<NeutralSections | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.DEAD_SECTIONS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<BufferStops | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.BUFFER_STOPS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<Detectors | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.DETECTORS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<Switches | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.SWITCHES.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<SpeedLimits | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.SPEED_LIMITS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<SNCF_PSL | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.SPEED_LIMITS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
|
||
<Signals | ||
sourceTable="signals" | ||
colors={colors[mapStyle]} | ||
layerOrder={LAYER_GROUPS_ORDER[LAYERS.SIGNALS.GROUP]} | ||
infraID={infraId} | ||
/> | ||
</> | ||
); | ||
|
||
export default InfraObjectLayers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.