Skip to content

Commit

Permalink
fix scale bar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sjyangkevin committed Oct 25, 2021
1 parent 91aba95 commit eb4aa68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/map/FooterTools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ class FooterTools extends Component {
}

onMapLoad() {
const initScale = helpers.getMapScale();

this.setState({
scale: initScale.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
});

window.map.on("moveend", () => {
const scale = helpers.getMapScale();

this.setState({
scale: scale.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
currentScale: scale,
// currentScale: scale,
});
});
}
Expand Down

0 comments on commit eb4aa68

Please sign in to comment.