Closed pellucidhims closed 4 years ago
I got it working. For anyone that might face this issue here is what solved my issue.
During installation of react-simple-maps(RSM), RSM also installs other d3 libraries like d3-zoom etc. Make sure that those dependent libraries are not manually installed before installing RSM. If there are any entries for such libraries in your package.json then uninstall those libraries first and then install RSM.
I have installed RSM (v2.1.2) and set-up the project as mentioned in the documentation.
Issue is that whenever I try to zoom into the map using touch-pad or mouse wheel scroll, I get the error - Cannot read property 'deltaY' of null (zoom.js:37). Somehow the zoom function is not receiving event and thus the error. I am not sure as to why the event is null.
Similarly, whenever I try to click on the map I get the error - Cannot read property 'view' of null (zoom.js:239)
I tried many possible solutions but I am not sure where I am going wrong. Below is my implementation of RSM which I am calling in other component wrapped inside div.
RSM version - 2.1.2
It would be helpful if anyone can help with this.