summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js
blob: 3ec893fb095deeccfad3976d22a19188754d572d (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.css'

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