New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tilelayers over HTTPS #472
Comments
Thanks for the report! Can you elaborate on "that is considered an antipattern since there is no way of forcing SSL when you need it"? Is there a case where the page is being served over http but you need the tiles to be served over https? That said, we can't use |
No problem, thanks for the quick response. Regarding the anti-pattern: https://www.paulirish.com/2010/the-protocol-relative-url/ but that is not really relevant when running local and using image files. Using SSL everywhere by hardcoding is fine with me, but i'm not the one affected, just reporting the issue. I help people out with Leaflet on SO and ran into someone with this problem so i thought i'de mention here. I'm not able to know how switching everything to SSL will affect your users. I see no problems but it's your decision. |
I also get a Mixed Content Warning when using https. For Carto Tiles there is already a fix: leaflet-providers. Leaflet for R still uses leaflet-providers 1.1.15 (9 Aug 2016). The newest version is 1.1.17 which doesn't contain the fix. So we just have to wait for the next version and update the configuration accordingly (or are these files unused?). Edit:
This works fine for me. |
I've upgraded to the latest leaflet-providers in #476. Once merged this issue can be closed out. |
Most providers have the protocol hardcoded in to the URL:
"url": "http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png"
Which throws mixed content errors to the console when loading using SSL:
You could just go with protocol less/relative URL like some providers already have:
"url": "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
but that is considered an antipattern since there is no way of forcing SSL when you need it, so it would need a new option, something like this:
"url": "{protocol}://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png"
I'de love to do a PR for you but i'm very unfamiliar with R
The text was updated successfully, but these errors were encountered: