leaflet-maps-with-google-sheets
leaflet-maps-with-google-sheets copied to clipboard
known issue: Chrome local developer cross-origins error for GeoJSON
We may not be able to fix this, so make a note to warn novice mapmakers:
If testing the map on a local computer (rather than GitHub Pages), use Firefox browser, because Chrome generates a cross-origins error for polygon GeoJSON
Ilya's notes about the underlying problem: Leaflet ‘forces’ http instead of https when using maps locally on your computer, as your local machine is an insecure location and HTTPS does not work with it, so leaflet is trying to be ‘smart’ about it and removes ’s'. Carto, however, has two completely different URLs for the two protocols, so the basemap is not loaded.
Chrome loves the new URL when it’s loaded from https (so from github it works perfect), however it will never let you get those maps from Carto to your local machine. I will see if I can tweak the plugin so that it can handle two URLs (http for local, https for secure origins).