Смешанный контент с использованием Google Maps

Я использую карту gmaps show на своем веб-сайте.

МОЙ КОД

<div class="col-md-12" >
  <script type="text/javascript" content="zk.googleAPIkey='***MyKey***'" />
    <gmaps id="gmaps" zoom="${initialZoom}" lat="${initialLatitude}" lng="${initialLongitude}" width="100%" height="350px" showSmallCtrl="false"   >
    <gmarker id="marker"  content="" visible="${false}" />
    </gmaps>
</div>

На моем локальном сервере работает нормально, но на моем производительном сервере с https не работают, и у меня есть эта ошибка:

ИСКЛЮЧЕНИЕ

zk.wpd:20 Mixed Content: The page at 'https://www.domain.com/' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/jsapi?key=***MyKey***'. This request has been blocked; the content must be served over HTTPS.loadScript @ zk.wpd:20

2 ответа

Решение

Я решаю свою проблему zk.googleAPIkey=****key*** за https://maps.googleapis.com/maps/api/js?key=****key***

Проблема в этом теге zk.googleAPIkey потому что ваша ценность http://maps.googleapis.com/maps/api/js? проблема заключается в http

До

<script type="text/javascript" content="zk.googleAPIkey='***MyKey***'" />

После

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=***key***" />

Добавил следующее и решил мою проблему

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"/>

в голове

Из демоверсии ZK карт Google:

<gmaps version="3.26" id="gmaps" width="520px" height="400px" showSmallCtrl="true" protocol="https">

Можете ли вы попробовать добавить свойство протокола?

Другие вопросы по тегам