Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixed Content using Google Maps

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
like image 437
David Hackro Avatar asked Oct 25 '25 23:10

David Hackro


1 Answers

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***" />
like image 92
David Hackro Avatar answered Oct 29 '25 22:10

David Hackro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!