Closed dragGH102 closed 7 years ago
I just had the same issue! Sigh
Me too!
Solved it by downgrading leaflet
and react-leaflet
to:
supported versions
- "react-leaflet": "^1.0.1"
- "leaflet": "^1.0.2"
@sjchmiela fixed it for me as well +1
I ran into the same problem and looked into it a bit.
The problem seems to be that when removing the map leaflet removes the _controlCorners
property of the map before it removes the layers. So when onRemove gets called it can't access map._controlCorners.bottomright
.
This should be an easy fix. Since in this case the whole map gets removed anyways it doesn't really matter if the position for the bottom right control corner gets reset so we can just add a check if it is there or not.
I'll make a PR for that.
There is a similar problem in line: https://github.com/Charmatzis/react-leaflet-google/blob/00bc05fe34c5bca5253aee0f00ade356363a8361/src/leaflet.google.js#L91
The same fix should be applied: https://github.com/Charmatzis/react-leaflet-google/blob/00bc05fe34c5bca5253aee0f00ade356363a8361/src/leaflet.google.js#L109
HOW TO REPRODUCE
(example code below)
MAP
Marker
ERROR: