Hello Everyone! I am a beginner in using openstreet maps. I have encountered an issue with my website i.e. when I am loading my website with secure https then the maps have stopped loading. While it was working fine with http. This is my code: <script> // initialize Leaflet var greenIcon = L.icon({ iconUrl: 'cloud.png', iconSize: [30, 20] }); var map = L.map('map').setView({ lon: 67.022095, lat: 24.926294 }, 10);
This is the error: Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure stylesheet 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css'. This request has been blocked; the content must be served over HTTPS. asked 11 Jun '20, 11:14 Mahnoor Atiq |
Somewhere in your html (not in the snippet in your question) you have a reference to http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css , which is http not https (and is a very old version of leaflet).
permanent link
This answer is marked "community wiki".
answered 11 Jun '20, 11:55 SomeoneElse ♦ |