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
alexander yurpolskyalexander yurpolsky 

How to display ALL contact addresses on google maps (only cities)

Hello,

I'm looking for a way to display all the cities of my contacts on google map. 

Would love to get help how to do it?
Alain CabonAlain Cabon
Hi Alexander,

There are many samples of code with google map.
A recent question and code: https://developer.salesforce.com/forums/?id=9060G0000005S3OQAU

Interesting but quite complicated as you can see (+ a problem of view state (reserved memory), over 135 ko).

We often use the maps and Salesforce has published an open-source application: http://www.dreamhouseapp.io/lightning-components (http://www.dreamhouseapp.io/lightning-components/)
using a map for Lightning components (you can install it and read all the code).

When you know the longitudes/latitudes, the places are easy put on a map for free. Otherwise, if you just know the addresses, you could have to pay the service of translation (address > longitude/latitude).

Using a map is one of the exercise for this superbadge (my favorite one for Lightning) : https://trailhead.salesforce.com/fr/superbadges/superbadge_lcf

Wait and see for other complete working samples with google map using Visualforce pages posting here. 
alexander yurpolskyalexander yurpolsky
Unfortunately my client is unable to use the Lightning version.
So a solution related to the use of Lightning's tools will not work in my case.

Currently trying to find an example of code  on the web .
Alain CabonAlain Cabon
Visualizing Salesforce Data with Google GeoMaps (2013)
Less than 30 lines of code!
https://medium.com/salesforce-analytics/visualizing-salesforce-data-with-google-geomaps-13c4a1198953
https://developer.salesforce.com/forums/?id=906F0000000B1wgIAC

(I am posting non tested solutions by myself because your feedback can be very interesting as we often have problem with this google map API integrated into Salesforce, always"easy' in the principle but that never really works as expected in the "real world' with hundreds of locations or you have to pay for a pre-package solution)
alexander yurpolskyalexander yurpolsky
Hey Alain,

I'm embarrassed to admit I can not figure out step 2.
After I created my report, what would be my next step? in the guied he syes "Now we will transform the results from the Analytics API into that format." BUT HOW DO I TRANSFORM MY REPORT INTO DATAFORMT? 

And what is Analytics API? Do I install it?

Thanks 
Alain CabonAlain Cabon
Alexander, it is exactly our problem. Always "easy" or "30 lines of code" but in reality, that is never so "simple". 

Moreover, geomaps (2013) could be totally obsolete now and not your need at all. As you can see from the links above, many people say that they have coded a complete working solution among the responses but it is never posted in fact. We have access to plenty of non working solutions.

You will also find plenty of web sites and videos like this one: http://garysmithpartnership.com/display-salesforce-data-google-maps-integration/
But where is their complete working code?

On this forum, there is perhaps a working solution (fixed by Dane Stone in 2013): https://success.salesforce.com/answers?id=90630000000guBkAAI

But read all the comment, at the beginning: "Great! that works for me!" and at the end (the most recent ones): "hi Ashley, I got the same error as you .'.  The google map API itself could have completely changed since 2013 for sure.

So you are in a long process if you don't buy a pre-packaged solution that many companies are willing to sell for a good price to you.

I think many working solutions should exist for free on the internet but it is a long process to find them and overall test them.

Good luck!