Skip to content

Commit

Permalink
fixed measure panel and tooltip translations
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Feb 15, 2017
1 parent c999ddb commit e62a337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions web/client/components/map/leaflet/MeasurementSupport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ const MeasurementSupport = React.createClass({
};
},
componentWillReceiveProps(newProps) {
var drawingStrings = this.props.messages || (this.context.messages) ? this.context.messages.drawLocal : false;
if (drawingStrings) {
L.drawLocal = drawingStrings;
}

if (newProps.measurement.geomType && newProps.measurement.geomType !== this.props.measurement.geomType ) {
this.addDrawInteraction(newProps);
}
Expand Down Expand Up @@ -66,6 +61,12 @@ const MeasurementSupport = React.createClass({
}
},
render() {
// moved here the translations because when language changes it is forced a render of this component. (see connect of measure plugin)
var drawingStrings = this.props.messages || (this.context.messages) ? this.context.messages.drawLocal : false;
if (drawingStrings) {
L.drawLocal = drawingStrings;
}

return null;
},
updateMeasurementResults() {
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/Measure.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const MeasurePlugin = connect((state) => {
};
}, {
toggleMeasure: changeMeasurement
})(MeasureComponent);
}, null, {pure: false})(MeasureComponent);

module.exports = {
MeasurePlugin: assign(MeasurePlugin, {
Expand Down

0 comments on commit e62a337

Please sign in to comment.