rlayers
Version:
React Components for OpenLayers
16 lines • 614 B
JavaScript
import { default as Translate } from 'ol/interaction/Translate';
import { default as RPointer } from './RPointer';
/**
* A feature translation interaction
*/
class RTranslate extends RPointer {
createOL(props) {
this.classProps = RTranslate.classProps;
return new Translate(Object.keys(props)
.filter((p) => this.classProps.includes(p))
.reduce((ac, p) => (Object.assign(Object.assign({}, ac), { [p]: props[p] })), {}));
}
}
RTranslate.classProps = ['features', 'layers', 'filter', 'hitTolerance'];
export default RTranslate;
//# sourceMappingURL=RTranslate.js.map