In continuation with my previous two posts –
today, I will explain how you can fetch geographic data from Salesforce and accordingly show them in Salesforce.
To start with let me first create an object – Household where I can store geographic information. Below you can find the object details –
Now when you will open the page you will see the three locations plotted.
In this example, I am using apex:repeat to prepare the GeoJSON data. To understand what is GeoJSON data, below is what Wikipedia stating –
Once the GeoJSON data is ready, I am adding the same with featurelayer –
Finally, I am using the click event to show the Household name when user clicks on the points inside map. The code for that –
//Show popup with information on mouse click
In my next post, I will explain how you can draw geographic areas inside map using Mapbox. Please provide your feedback. Thanks.