Chrome控制台中某些页面上带有Google Maps的混合内容字体错误

时间:2018-09-01 05:20:10

标签: wordpress google-maps-api-3 mixed-content

在wordpress网站https://www.lbgenetics.com上,我在使用Google Maps V3的页面上的控制台中看到错误。


Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure font 'https:'. This request has been blocked; the content must be served over HTTPS.
map.js:87 Mixed Content: The page at 'https://www.lbgenetics.com/where-to-get-a-dna-test-in-California/' was loaded over HTTPS, but requested an insecure font 'https:'. This request has been blocked; the content must be served over HTTPS.
Ju.f @ map.js:87
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:87
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:64
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
be @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:63
Wd.wa @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
(anonymous) @ map.js:1
map.js:13 Mixed Content: The page at 'https://www.lbgenetics.com/where-to-get-a-dna-test-in-California/' was loaded over HTTPS, but requested an insecure font 'https:'. This request has been blocked; the content must be served over HTTPS.
Xs @ map.js:13
Ys @ map.js:13
(anonymous) @ common.js:12
_.to.get @ common.js:159
_.Zc @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:53
Ju.f @ map.js:89
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:87
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:64
(anonymous) @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
be @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:63
Wd.wa @ js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA:137
(anonymous) @ map.js:1
map.js:13 Mixed Content: The page at 'https://www.lbgenetics.com/where-to-get-a-dna-test-in-California/' was loaded over HTTPS, but requested an insecure font 'https:'. This request has been blocked; the content must be served over HTTPS.

如果我只删除地图代码,错误就会消失。 如果我仅将Maps代码移动到没有动态数据的纯HTML代码,则不会显示任何错误。

有趣的是,带有地图的“路线”页面没有显示这些错误。 例如https://www.lbgenetics.com/directions-to/?locid=1025

我已经在数据库和每个文件中搜索了一种使用http:的字体,但找不到任何实例。通常,控制台会提供有关字体的完整路径,但是在这种情况下,它仅将字体引用为“ https:”

在这一点上我很沮丧,任何帮助将不胜感激。

这是地图代码部分

<script  src="https://maps.googleapis.com/maps/api/js?key=AIzaSyApMXvd4zpzPP1pcNk2zA4ce25CxPxnnmA"></script>

<script type="text/javascript"> 

    // Define the list of markers.
    // This could be generated server-side with a script creating the array.

function initialize() {

    var locations = [ <?php echo $frm->coords;?> ];
    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 10,
      center: new google.maps.LatLng(locations[0].lat,locations[0].lng),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    //iterate through the locations
    for(var i=0;i<locations.length; i++){
        addMarker(locations[i]);
    }
    //add a new Marker
    function addMarker(coords){
        var marker =new google.maps.Marker({
            position:coords,
            map:map,
                  title:'Click for more info'

        });
    //add event listener to each marker
       google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
          window.location.href = locations[i].url;
        }
      })(marker, i));
    }

    //fit all the markers into the viewport 
   function fitBoundsToVisibleMarkers() {
     var bounds = new google.maps.LatLngBounds();

    for (var i=0; i<locations.length; i++) {
            bounds.extend(locations[i]);
        } 
      map.fitBounds(bounds);
    }
    fitBoundsToVisibleMarkers() ;

}window.onload = initialize();
</script>

0 个答案:

没有答案