voluntadpear / vue-choropleth

Choropleth Map component for Vue.js
MIT License
117 stars 57 forks source link

Bug in ReferenceChart before destroy #10

Closed fchabouis closed 5 years ago

fchabouis commented 5 years ago

Hello, In the beforeDestroy function of ReferenceChart and InfoControl, you wrote :

beforeDestroy() {
    if (this.parent) {
      this.parent.removeLayer(this.mapObject)
    }
 }

But the correct function to use to remove controls is actually :

      this.parent.removeControl(this.mapObject)

Because of this, those two components are still present on the map when the parent choropleth component is destroyed.

justice47 commented 5 years ago

I've got Error in beforeDestroy hook with 'removeLayer'. Issue: https://github.com/voluntadpear/vue-choropleth/issues/11 I think my issue are close to your bug. Tried to change that function in both files, but error is still here.

voluntadpear commented 5 years ago

Thanks for reporting this bug @fchabouis. I've been busy lately and I'll try to take a look as soon as I have a little time. In the meanwhile, you could open a PR with your change if you are interested and I can review it.