1

I have 2 custom object and a contact object

Ex.
Cars Object
Owners of Cars (related to cars and contacts)
Contacts

I basically need to create a map in the Contact object based on the "owners of cars" object which included a list cars located all over US. So when I go to the contact it will show a map of how many cars with a marker all over the US.

Ex.
Toyota
John doe (list of cars in NY, CA, OH, FL) In the "CArs" object
John Doe Contacts has a map of USA with the Markers pointed in NY, CA, OH, FL

Any guidance will help. Starting code will be good too.

Thanks

1 Answer 1

2

I think that this specific Salesforce Trailhead course contains all the information you might need - https://developer.salesforce.com/trailhead/project/salesforce_developer_workshop/using_javascript_in_visualforce

  1. It shows you how to use Google Map in VisualForce pages
  2. Shows you how to query locations (longitude and latitude) and use it on VisualForce page
  3. Finally, it shows you how to place markers on a map

You'll just have to add this page in your Contact object's page layout instead of using it as a separate page as it is done in this example. For guidance on how to embed a page in standard layout you can take a look at this link.

And one last note - if the page doesn't appear in Visualforce Pages when you go to edit the standard layout, make sure that your Visualforce page is using the standard controller standardController='Contact' and that your other controller that is querying for marker locations is defined as extension to standard controller. You can see more about that in this link

I hope that this can help you get started and do let me know if you need any additional information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .