rlayers
Version:
React Components for OpenLayers
18 lines • 615 B
JavaScript
import { ScaleLine } from 'ol/control';
import { default as RControlBase } from './RControlBase';
/**
* Scaleline control
*
* Requires an `RMap` context
*/
export default class RScaleLine extends RControlBase {
constructor(props) {
super(props);
this.ol = new ScaleLine(this.toOLProps(props));
}
toOLProps(props) {
var _a;
return Object.assign(Object.assign({}, super.toOLProps(props)), { minWidth: props.minWidth, bar: props.bar, text: props.text, units: (_a = props.units) !== null && _a !== void 0 ? _a : 'metric' });
}
}
//# sourceMappingURL=RScaleLine.js.map