Displaying a location in a map

When a Salesforce record contains geolocation data, a common requirement is to show this location on a map, for example, to allow field service agents to determine the location of their next job or for a sales rep to plan their day visiting prospects.

In this recipe, we will create a Visualforce page that plots the location of a lead record that was created with geolocation information.

Note

This recipe makes use of the Google Maps API. At the time of writing, the Terms and Conditions of this API provide free use only when your implementation is freely and publicly accessible. In the event that you wish to use this API in a production Salesforce implementation, you will be required to purchase a Google Maps API for ...

Get Visualforce Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.