Open samjam48 opened 4 years ago
So it seems we are doing something freaky with too much use effects and things going on in the leaflet maps js file. I didn't write any of it so a bit unsure what is useful or not...
also this code
useEffect(() => {
layerRef.current.clearLayers();
markersData.pop();
markersData.forEach(marker => {
L.marker(marker.latLng, { title: marker.title })
.addTo(layerRef.current)
.bindPopup(marker.title);
});
}, [markersData]);
Why the line markersData.pop();
. It just seems bonkers that we are removing the last result from the list of markers to show. We are still showing the last result in the cards so why have we decided to remove it from the markers? It doesn't seem to cause any problems removing this line and showing all the markers but I feel this is so wierd there must be a reason for it...
Answer to your last comment is that this was just a quick fix. Through air table we get one result that is empty but for some reason has the long lat of the actual last marker (did not write that piece of code). This means it overlays that marker and does not show a valid title. Console log all markers and you will understand.
Wow, weird! Yea it looked like it was fine in the console and matched the results array but apparently not. But yea I don't want to break things messing with code that is doing stuff I don't understand because of stuff like this. (would be nice to have a clean console but life... 🙄)
[x] - URL is requesting images over http instead of https
The page at 'https://generation-change.netlify.com/results?postcode=BH154DH' was loaded over HTTPS, but requested an insecure image 'http://b.tile.osm.org/11/1012/687.png'.
Leaflet maps tile layer calls are all using http. fix by turning to https.[ ] - Cors error with cookie being set without 'SameSite' attribute. Part of a new chrome release requiring cross-site requests to only deliver cookies with
SameSite=None
. Dropbox needs to update their cookie settings or we need to use not dropbox or find a way to not have this error show up....[ ] Many occurrences of this error
Uncaught (in promise) TypeError: Cannot read property 'querySelectorAll' of null
on the results page Investigating. I think to do with the leaflet maps tiles[ ] Many occurences of this error
Uncaught TypeError: Cannot read property 'removeFragment' of undefined
Investigating. I think to do with the leaflet maps tiles