NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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 ='map').setView({ lon: 67.022095, lat: 24.926294 }, 10);

            // add the OpenStreetMap tiles
            L.tileLayer('https://{s}{z}/{x}/{y}.png', {
                maxZoom: 19,
                attribution: '&copy; <a href="">OpenStreetMap contributors</a>'

            // show the scale bar on the lower left corner

            var data = <?php echo JSON_encode($donnees); ?>;

            for (var i = 0; i < data.length; i++) {
                    lon: data[i].lng,
                    lat: data[i].lat
                }, {
                    icon: greenIcon
                }).bindPopup("<b>Location Name: </b>" + data[i].name + "<br> <b>Number of Fans: </b>"+ data[i].count_fan").addTo(map);

This is the error: Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure stylesheet ''. This request has been blocked; the content must be served over HTTPS.

asked 11 Jun '20, 11:14

Mahnoor%20Atiq's gravatar image

Mahnoor Atiq
accept rate: 0%

Somewhere in your html (not in the snippet in your question) you have a reference to , 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's gravatar image

SomeoneElse ♦
accept rate: 16%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 11 Jun '20, 11:14

question was seen: 2,463 times

last updated: 11 Jun '20, 11:55

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum