summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/map/controls/ScaleIndicator.js
blob: 11c2f2d35ce5e2087b190898d9e458a918a3ecdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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'

const ScaleIndicator = ({ scale }) => (
    <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