You are currently viewing Salesforce™ Google Map Integration

Salesforce™ Google Map Integration

Sharing is caring!

We are Salesforce™ Experts and we channelize our energy by documenting all the industry-specific technical problems we solve in Salesforce™ CRM world. Here I am about to explain one of the Google Maps API with custom development projects. I was closely involved as a Salesforce™ Developer. At, below I will provide you a brief description of the project what basically it is and how we helped our end client.


In, this Project Client basically need a system viewer where he can calculate a distance between the source and the other records. The basic agenda of this project to help our end client where they will help their customer and they can identify all the machine from the source of Account. The original idea of the project is that from a single Account record Source we need the ability to produce a list of other accounts. 

Account records that fall within a certain proximity radius to that account is a list of accounts that result from the search ‘Proximity’ accounts. An account in the system could potentially be a source account. The user initiating the search from the Source account would first need to populate a screen showing various criteria information. Such criteria would include a ‘Radius’ setting we will provide the initial default value but we will need the ability to override. Additional criteria would include two or three custom fields these currently exist on the Account record. It will provide default values for each but we will need the ability to override. It is not mandatory that the list of Proximity accounts display in map form. 

If the Proximity accounts are displayed in a list, and not on a map, it is important that we can see the distance in miles from each Proximity account to the Source account.

We came with the solution:-

In,this what we acknowledge that from the list of account we can identify certain set of machines from the source to the estimate miles and can find out the list of machines from the source with different cost. It would ease to identify the certain machine from the list of miles and also it can be identified from the last sale day ago which we can filter from all the above source and then click on search. From this, it provides two options:-

1-Generate PDF

2-View Map Generate PDF:- From this Option Customer after selecting their choices they will click on this option and they will get a detailed report within the Pdf.

View Map:- It provides a viewer to identify all the destination location of the products and analyze the certain destination via this map. Now, with the following screenshots its methodology can be understood as follows:-

1) Search Filter with the various criteria   2) Search Result with the Following Criteria :- 3) From various options it can be identified with the map :  It can be understood with the following Code Snippets as follows. These are the few components which we deployed to the production.

1. Show All Account on Filter Controller :-

From below code we are able to distinguish how to multi select the option which are available on the filter-

public with sharing class ShowAllAccountOnFilterController {

public String recordID{get;set;}

public Account Sourceaccount{get;set;}

public double Last_Sale_Days_Ago{get;set;}

public list accountList{get;set;}

public list accountlistSearched{get;set;}

public list accountlistSearched1{get;set;} // list will show on map

public list SearchAccountListWithMiles{get;set;}

public list accountpicklistvalue;

public list seletectedaccountpicklistvalue;

public boolean listisempty{get;set;}

public boolean showiflistfilled{get;set;}

public  String headerdata{get;set;}

public string url{get;set;}

public double radiusdis{get;set;}

public String Machines{get;set;}

public String SourceAccountAddress;

public String sourceaddress=”;

public String otherAccountAddress;

public double selectedvalue{get;set;}

Below is a description of the above model with the ER Diagram


Ajay Dubedi

CEO | Founder
Ajay Dubedi, the founder and CEO of Cloud Analogy, is a prominent Salesforce Sales, Service, and Marketing cloud Consultant with a rich expertise in handling challenging business models. Ajay has assisted and implemented solutions in industries comprising Banking, Health Care, Networking, Education, Telecommunication and Manufacturing. Ajay is globally acclaimed for his extensive experience in APEX Programming, VisualForce pages, Triggers, Workflows, Page Layouts, Roles, Profiles, Reports & Dashboards.

Hire the best Salesforce Implementation Partner. Choose Cloud Analogy, the world's most preferred Salesforce Implementation Company that provides custom CRM Implementation services.

Leave a Reply

× How can I help you?