summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/map/layers/MapLayerComponent.js
blob: 96e6867c6e7ac345bcd62fb78f09434a3de07339 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import PropTypes from 'prop-types'
import React from 'react'
import { Group, Layer } from 'react-konva'
import TopologyContainer from '../../../../containers/app/map/TopologyContainer'
import Backdrop from '../elements/Backdrop'
import GridGroup from '../groups/GridGroup'

const MapLayerComponent = ({ mapPosition, mapScale }) => (
    <Layer>
        <Group x={mapPosition.x} y={mapPosition.y} scaleX={mapScale} scaleY={mapScale}>
            <Backdrop />
            <TopologyContainer />
            <GridGroup />
        </Group>
    </Layer>
)

MapLayerComponent.propTypes = {
    mapPosition: PropTypes.shape({
        x: PropTypes.number,
        y: PropTypes.number,
    }),
    mapScale: PropTypes.number,
}

export default MapLayerComponent