You need to sign in to do that
Don't have an account?
dstonesifer
Google Maps Help
Is it possible to simply create a custom button in a list view using a URL content source that will open selected records in a Google map with markers?
I've been able to get the button to open a google map, but can't figure out how to bring in the records selected from my list view, or if it's even possible without a bunch of other customizations.
I tried installing the "Salesforce International Mapping using Google Maps" off appexchange, but frankly was overwhelmed with all the pages, components, etc. that creates.
Thanks for any help.
Dave
I have tried this for one record i am getting all sucessfully,Just pass the selected record id from listviewbutton javascript code in querystring parameters.
apex/googlepage?id='Selected ID';
Then there get the id into controller using apexpagereference class.
like apex.
:ApexPages.currentPage().getParameters().get('id')
And Declare a property in java script of the googlemappage
like var Addr={!address};
Query the address from selected object and assign address to addr property in controller.
then you will get .
i am giving code samples use them.
for marker
marker.openInfoWindowHtml("<div style=\"float:left;\"><div style=\"font-family: arial, san-serif; padding-left:30px;\"><span style=\"font-weight:bold;\">{!Contact.Name}</span><br/>{!Contact.MailingStreet}<br/>{!Contact.MailingCity}, {!Contact.MailingState} {!Contact.MailingPostalCode}<br/><br/></div></div>");
Use this sample.
public String Address{get;set;}
list<contact> lstcontact = new list<contact>();
public contactMap(ApexPages.StandardController controller) {
lstcontact =[select Name,MailingCity,MailingStreet,MailingState from contact where id =:ApexPages.currentPage().getParameters().get('id')];
Address=lstcontact[0].MailingCity+','+lstcontact[0].MailingStreet+','+lstcontact[0].MailingState;
}
}
All Answers
I have tried this for one record i am getting all sucessfully,Just pass the selected record id from listviewbutton javascript code in querystring parameters.
apex/googlepage?id='Selected ID';
Then there get the id into controller using apexpagereference class.
like apex.
:ApexPages.currentPage().getParameters().get('id')
And Declare a property in java script of the googlemappage
like var Addr={!address};
Query the address from selected object and assign address to addr property in controller.
then you will get .
i am giving code samples use them.
for marker
marker.openInfoWindowHtml("<div style=\"float:left;\"><div style=\"font-family: arial, san-serif; padding-left:30px;\"><span style=\"font-weight:bold;\">{!Contact.Name}</span><br/>{!Contact.MailingStreet}<br/>{!Contact.MailingCity}, {!Contact.MailingState} {!Contact.MailingPostalCode}<br/><br/></div></div>");
Use this sample.
public String Address{get;set;}
list<contact> lstcontact = new list<contact>();
public contactMap(ApexPages.StandardController controller) {
lstcontact =[select Name,MailingCity,MailingStreet,MailingState from contact where id =:ApexPages.currentPage().getParameters().get('id')];
Address=lstcontact[0].MailingCity+','+lstcontact[0].MailingStreet+','+lstcontact[0].MailingState;
}
}