Closed nickdos closed 2 years ago
Branch created for issue: https://github.com/ARGA-Genomes/arga-web/tree/issue-19
Got a working version on the branch but have run into a blocker, where the leaflet.draw shape is added to the same map.layerContainer (from map context) as the data layer (polygons from SOLR heatmap). This causes a problem when the user pans or zooms, as the heatmap layer is re-rendered and are then drawn ontop of the draw
shape layer. This results in onClick events triggering the popups for the grids and not the shape layer, as intended.
This is due to the way the react-leaflet-draw
code adds the shape layer to the map, which is via the map context.
Chris G suggests trying the leaflet-geoman plugin instead, which has a react wrapper as well.
Fixed it by attaching the SOLR heatmap data layer into its own pane
, which no longer conflicts with the overlay pane used by the draw tool.
Done. Deployed to test site .
https://www.npmjs.com/package/react-leaflet-draw
Similar to how biocache allows this on both https://biocache.ala.org.au/search#tab_spatialSearch and on map tab or results page.