UNPKG

@stangres/react-leaflet

Version:
25 lines (19 loc) 607 B
// @flow import { Control } from 'leaflet' import { withLeaflet } from './context' import MapControl from './MapControl' import type { MapControlProps } from './types' type LeafletElement = Control.Scale type Props = { imperial?: boolean, maxWidth?: number, metric?: boolean, updateWhenIdle?: boolean, } & MapControlProps class ScaleControl extends MapControl<LeafletElement, Props> { createLeafletElement(props: Props): LeafletElement { return new Control.Scale(props) } } export { ScaleControl as ExtendableScaleControl } export default withLeaflet<Props, ScaleControl>(ScaleControl)