3

I use gmaps show Map in my web site.

MY CODE

<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>

In my local server work fine but in my productive server with https don't work and i have this error:

EXCEPTION

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
Anand Bhat
  • 5,591
  • 26
  • 30
David Hackro
  • 3,652
  • 6
  • 41
  • 61

3 Answers3

5

added the following and solved my problem

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

in head

Mahendra Pratap
  • 3,174
  • 5
  • 23
  • 45
4

I solvel my problem remplace zk.googleAPIkey=****key*** for https://maps.googleapis.com/maps/api/js?key=****key***

The problem is this tag zk.googleAPIkey because your value is http://maps.googleapis.com/maps/api/js? the problem is the http

Before

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

After

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=***key***" />
chillworld
  • 4,207
  • 3
  • 23
  • 50
David Hackro
  • 3,652
  • 6
  • 41
  • 61
0

From ZK demo of google maps :

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

Can you try adding the protocol property?

chillworld
  • 4,207
  • 3
  • 23
  • 50