+ Start a Discussion

geolocation in visual force

Hello I started very recently with visualforce. The map must show 3 addresses (one for each field) and also to be able to center them when clicking

What should you call the geolocation system?

From already thank you very much
Khan AnasKhan Anas (Salesforce Developers) 

Greetings to you!

Please refer to the below links which might help you further with the above requirement.





I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

I have tried to use several codes to implement the google maps with the addresses, but it always tells me that the billing address is incorrect

I thank you anyway
I have looked for the solution and probe with different codes but continue with that error and the addresses that are registered are correct thank

you very much again
<apex:page standardController="Account">
<apex:pageBlock >
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
<script type="text/javascript"> 
$(document).ready(function() {
  var myOptions = {
    zoom: 20,
    mapTypeId: google.maps.MapTypeId.HYBRID,
    mapTypeControl: true
  var map;
  var marker;
  var geocoder = new google.maps.Geocoder();
  var address = "{!Account.Project_Street_Address__c}";
  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Account.Name}</b>"
  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);
        //center map
        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!Account.Name}"
        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
        google.maps.event.addListener(infowindow, 'closeclick', function() {
    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Account.Name}'s address could not be found, please make sure the address is correct.");
  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
#map {
  font-family: Arial;
  line-height:normal !important;
<div id="map"></div> 

It doesn't tell me the name of the account that has the wrong address but the same addresses are the ones that come directly with the salesforce version and are correct