You need to sign in to do that
Don't have an account?
How to create a secure HTTPS connection from VF page
Dears
I create visual force page that connect to google map and display it in account module, the map works perfect in firefox, but when I run it in Internet Explores i got a message inform that "This page ha content that won´t be sent using a secure HTTPS" (message summary) and I have two options "Yes" or "No" when I click in Yes the map is not displayed, when I click "No" the map is displayed but in a wrong latitude, longitude address, how may I solve this issue with internet exploere? Below the code:
<apex:page standardController="Account" extensions="lat_lon_GoogleMap" >
<html>
<head>
<script type="text/javascript"
src="http://www.google.com/jsapi?key=ABQIAAAAe2NFOp1WA-r3hEnPeArUrBST0mNpJvtWvmgvEdrgGXs5szHHahQf0jJpikHErriZM-CeKx3OJZgXvQ"></script>
<script type="text/javascript">
var geocoder;
var address;
//standardController="Account" extensions="lat_lon_GoogleMap"
google.load("maps", "2");
google.load("search", "1");
// Call this function when the page has been loaded
function initialize() {
/****display map in div*****/
var map = new google.maps.Map2(document.getElementById("map"));
/**** in my opinion only display the map until this section*******/
/**** Thsi section is not displayed, the address*******/
map.setCenter(new google.maps.LatLng(10.4974997, -66.8445959), 15);
map.openInfoWindow(map.getCenter(),
document.createTextNode("Please complete info"));//msj
map.setMapType(G_HYBRID_MAP);//G_HYBRID_MAP, G_SATELLITE_MAP
map.setUIToDefault();
GEvent.addListener(map, "click", getAddress);
geocoder = new GClientGeocoder();
}
function getAddress(overlay, latlng) {
if (latlng != null) {
address = latlng;
geocoder.getLocations(latlng, showAddress);
}
}
function showAddress(response) {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
if (!response || response.Status.code != 200) {
alert("Por favor contacte al administrador, no se guardaron las Coordenadas, Status Code:" + response.Status.code);
} else {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
}
}
google.setOnLoadCallback(initialize);
}//si no tiene lat
</script>
</head>
<body>
<apex:form id="form1">
<apex:pageMessages id="error"/>
<!-- Display info-->
</apex:form>
<!-- Display map-->
<div id="map" style="width: 950px; height: 700px"> </div>
</body>
</html>
</apex:page>
Thanks in advances
Hello Nicloz,
Try changing following thing, that will solve your problem.
<script type="text/javascript"
src="https://www.google.com/jsapi?key=ABQIAAAAe2NFOp1WA-r3hEnPeArUrBST0mNpJvtWvmgvEdrgGXs5szHHahQf0jJpikHE..."></script>
Please mark this as solution if this resolves your problem.
Thanks,
Thanks for your response, I changed It to "https" but I still get the same message.
Does anybody have another solutions for this issue?
Best Regards