Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTextOnFeature = (feat, onModalOkCbk) => {
const {
maxLabelLineLength
} = this.props;
const {
textLabel
} = this.state;
let label = textLabel;
if (maxLabelLineLength) {
label = StringUtil.stringDivider(
textLabel, maxLabelLineLength, '\n'
);
}
feat.set('label', label);
this.setState({
textLabel: ''
}, () => {
if (_isFunction(onModalOkCbk)) {
onModalOkCbk(feat, label);
}
});
}