UNPKG

rlayers

Version:

React Components for OpenLayers

23 lines 885 B
import { Attribution } from 'ol/control'; import { default as RControlBase } from './RControlBase'; /** * An attributions control (the small **i** in the bottom right corner) * * Requires an `RMap` context */ export default class RAttribution extends RControlBase { constructor(props) { super(props); this.ol = new Attribution(this.toOLProps(props)); } refresh(prevProps) { super.refresh(prevProps); if ((prevProps === null || prevProps === void 0 ? void 0 : prevProps.collapsed) !== this.props.collapsed) this.ol.setCollapsed(this.props.collapsed); } toOLProps(props) { var _a; return Object.assign(Object.assign({}, super.toOLProps(props)), { collapsible: (_a = props.collapsible) !== null && _a !== void 0 ? _a : true, collapsed: props.collapsed }); } } //# sourceMappingURL=RAttribution.js.map