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
KitagawaSan805KitagawaSan805 

Displaying Related Accounts on Google Map

Hello, 

 

I am looking to create a vf page within the account page that will show all related account records based on a field called Ultimate_Parent_ID__c. The idea being that it will show all the sites for a given company. 

 

I already have the latlng coordinates stored on the account object, and a controller to query the related accounts (see below) but I can't seem to get them to plot on a google map. I have been looking around the various tutorials, but they all seem to go over how to geocode them, or how to show only 1 point on the map. 

 

Any help would be greatly appreicated! 

 

public class mapController2 {
    public String address {get;set;}
    private List<Account> accounts;

    public void find() {
        accounts = [SELECT Id, Name, BillingStreet, BillingCity, BillingCountry, BillingLat__c, BillingLong__c FROM Account 
        WHERE Ultimate_Parent_ID__c = :ApexPages.currentPage().getParameters().get('Account.Ultimate_Parent_ID__c')];
        
    }

    public List<Account> getAccounts() {
        return accounts;
    }
}