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
nicloznicloz 

Add a VF page that show a Google MAP

Dears

 

I need to add a page in contact module that show a static google map, this map will be created after send via URL some data needed by google to create the map.

 

Below the link:

 

http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|color:red|label:C|40.718217,-73.998284&sensor=false

 

This is a test link I will pass the address of contac for each user.

 

Best Regards

Best Answer chosen by Admin (Salesforce Developers) 
paul-lmipaul-lmi

 

<apex:page>
<apex:image id="googlemap" value="your maps url" />
</apex:page>

 

the thing you'll need to do, is get the coordinates for the address, that will pass to this URL.  i believe google has an API to convert address to coordinates, so you could do an API call in your controller to convert the current record's address to the coordinates, and then pass those back to the page via a get method in the controller.  it's not really as cut and dry as you're probably looking for, but it should work.

All Answers

Ispita_NavatarIspita_Navatar

I found the following documentation , please check if it is helpful.

 

Use the following  URL to get the google API

http://osdir.com/ml/GoogleMapsAPI/2009-04/msg02804.html
http://sites.force.com/appexchange/apex/listingDetail?listingId=a0N300000016d25EAA


Steps:-

1) Go to this URL (http://sites.force.com/appexchange/apex/listingDetail?listingId=a0N300000016d25EAA)
 click on Get it button (it ask for log in  in to u r org enter u r user name & password)
 once u get log it instal this application (Just go with Steps)
 After installation just go to   All Teb > Customize My Tabs
 & in 'Available Tabs' list u find a tab i.e "International Mapping Setup"  Shift it to 'Selected Tabs' list click save

 Now you can see the International Mapping Setup Tab  with all other tabs when you click on that tab a page opens and then follow the steps mentioned in it.
Steps:-
1. Go to 'Google Maps API Key'  section click on  'sign up'  do the steps required.
 2. Go to contact page layout edit it  then in view select Pages u found u pages there named as  GoogleMapINT
 3. Add it to your page layout and save it .

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

nicloznicloz

 

Thanks for your reply, now I have had installed the  Google map international, but now our clients want that map static, with the static map I have more features than the Integration Google map implemented in salesforce.

 

Best Regards

Ispita_NavatarIspita_Navatar

Are you facing any issues with the static map implementation?

paul-lmipaul-lmi

 

<apex:page>
<apex:image id="googlemap" value="your maps url" />
</apex:page>

 

the thing you'll need to do, is get the coordinates for the address, that will pass to this URL.  i believe google has an API to convert address to coordinates, so you could do an API call in your controller to convert the current record's address to the coordinates, and then pass those back to the page via a get method in the controller.  it's not really as cut and dry as you're probably looking for, but it should work.

This was selected as the best answer