summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js
blob: 58d2ccc9d1858849c8b3f4dd9531aa1e5328bc46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import PropTypes from 'prop-types'
import React from 'react'
import { TILE_SIZE_IN_METERS, TILE_SIZE_IN_PIXELS } from '../MapConstants'
import { scaleIndicator } from './ScaleIndicator.module.scss'

function ScaleIndicator({ scale }) {
    return (
        <div className={scaleIndicator} style={{ width: TILE_SIZE_IN_PIXELS * scale }}>
            {TILE_SIZE_IN_METERS}m
        </div>
    )
}

ScaleIndicator.propTypes = {
    scale: PropTypes.number.isRequired,
}

export default ScaleIndicator