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
M.ChanuM.Chanu 

Jquery plugin for google map in Salesforce.com

Hi All m using a Jquery Plugin in my Visualforce component to integrate with GoogleMap.  I have provided all Google API key as well as the resource link but m not able to see the MAP in the vf page. I am new to this and stil in learning phase.

 

Below is the  Visual force component that i used to call the Jquery plugin and also the Google Map API.

 

 

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false&key=AIzaSyAsa7Q4gy5pzrZzsGkUxhRauOw12gtk9CA"></script>
<script type="text/javascript" src="{!URLFOR($Resource.gmap3,'gMap/jquery.gmap3.min.js')}"></script>
<script type="text/javascript" src="{!URLFOR($Resource.gmap3,'gMap/jquery.jquery-1.4.4.min.js')}"></script>
<script type="text/javascript" src="{!URLFOR($Resource.gmap3,'gMap/jquery.gmap3.js')}"></script>


<style>
.sfgmap {
    border: 1px solid #000;

}
</style>
<div id="map" style="width:{!width}px;height:{!height}px;" class="sfgmap"></div>
<script type="text/javascript">
var addresses = new Array();
var defaultaddress = '';
if("{!default}" != ""){
    defaultaddress = "{!default}";
}else{
    defaultaddress = "{!addressmodel.default}";
}
<apex:repeat value="{!addressmodel.addresslist}" var="address">
    var addObject = new Object();
    if("{!uselatlng}" == "false"){
        addObject.address = "{!address.address}";
    }else{
        addObject.latitude = "{!address.lat}";
        addObject.longitude = "{!address.lng}";
    }
    addObject.html = "{!address.info}";
    addresses.push(addObject);
</apex:repeat>
$(function() {
    $("#map").gmap3({ markers: addresses,
                  address: defaultaddress,
                  zoom: {!zoom} });
});
</script>
</apex:component>