Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
callmedanieldaniel committed Jun 4, 2019
1 parent 45333e5 commit 09cd179
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-bmap",
"version": "1.0.94",
"version": "1.0.95",
"description": "react-bmap",
"main": "lib/index.js",
"contributors": [
Expand Down
7 changes: 5 additions & 2 deletions src/components/traffic-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ export default class App extends Component {
}

componentWillUnmount() {
this.props.map.removeTileLayer(this.tileLayer);
this.tileLayer = null;
let map = this.props.map;
if (map && map.removeTileLayer && map.removeTileLayer instanceof Function && this.tileLayer) {
map.removeTileLayer(this.tileLayer);
this.tileLayer = null;
}
}

initialize() {
Expand Down

0 comments on commit 09cd179

Please sign in to comment.