function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lingannalinganna 

salesforce integration with google map

 

Hi

 

I used the below code for google map integration with salesforce  but the google map  not visible in my visual force page 

but when I use the  same code in note pad with out <apex:page> tag  its working .

anybody help me

 

 

 

<apex:page sidebar="false">

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=false ">
</script>
<script type="text/javascript">
function initialize() {
var myOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
</script>
</head>
<body onload="initialize()">

<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>


</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

That won't change the fact that there is a mixture of secure and insecure content.  If this is a page that only you are going to use, you can change your browser security settings to allow http and https on the same page.  If you can't do that, you have two options:

 

(1) See if there's an https version of the API available - you might need a commercial license for this, its been a while since I used it.

(2) Access Salesforce via http (not recommended).

All Answers

bob_buzzardbob_buzzard

Do you have any errors reported by the browser?  The fact that you are including the API as an http resource may conflict with the main page if you are accessing Salesforce over https.   

lingannalinganna

I am getting error : this page has insecure content.

 

how to solve this error can u please tell me

 

 

AravindBabu512AravindBabu512

Hi,

 

Did you try giving sidebar="false" showHeader="false" in the apex:page tag. It must a conflict between the custom styling and the standard styling.

 

Thanks,

Aravind.

lingannalinganna

i did that one also no use

bob_buzzardbob_buzzard

That won't change the fact that there is a mixture of secure and insecure content.  If this is a page that only you are going to use, you can change your browser security settings to allow http and https on the same page.  If you can't do that, you have two options:

 

(1) See if there's an https version of the API available - you might need a commercial license for this, its been a while since I used it.

(2) Access Salesforce via http (not recommended).

This was selected as the best answer
nansi kela 21nansi kela 21
Hi linganna..

This link will help you for  salesforce integrate with google map api.. 
http://webkul.com/blog/how-to-integrate-google-map-api-in-salesforce/

Thank you,
Nansi kela