INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part I

by Sudipta Deb | Aug 16, 2015 | coding, dev 501, integration, javascript, map, mapbox, mobile, visualforce | 0 comments

Maps are very powerful application to visualise information. In today’s world, map plays a very important role as many customers want to integrate maps with their applications to represent their account, contact, lead and many more information visually through map.

In one of my recent project, I came across a similar requirement where I need to integrate map with Visualforce to show lead information visually in map. To implement this requirement, I have chosen Mapbox. I know you have the question in mind – Why Mapbox, why not Google Map? The reason why I have chosen Mapbox, not the Google Map – I will come to it later. But for the time being let’s keep our focus completely on Mapbox.

In this post, I will explain how you can integrate Mapbox with Visualforce page. I will start with a very basic example and then dig into more and more complex ones. I believe in this way, you will also feel more comfortable with Mapbox+Visualforce integration.

Note – The day I am writing this post, the version of Mapbox API is: Version 2.2.1.

Step 1 – Create Mapbox account
First you need to create a Mapbox account. You can do that by clicking on Signup button.

Step 2 – Get Default Public Token 
Once you have logged in, go to your profile, followed by click on Apps to get your default public token. Below is the screenshot –

Step 3 – Create your first project
You can create your first project by clicking on the project icon at the top. Once the project is created you will get the project id.

With the above three steps, our Mapbox configuration is completed. Let’s move into our first basic example –

Example – Display Mapbox With Visualforce Page –

Below is the Mapbox_1 Visualforce page. Click here

Now when you will open this page, you will see the map like below –

In my next post, I will play with few attributes to make the map more interactive. Till then, if you have any feedback or specific requirement, I will really appreciate if you can post it to me. Thanks.

Written by

Related Posts

What is Coding Assistant

What Is a Coding Assistant?

A coding assistant is an AI tool that helps developers write, understand, review, test, and maintain code. Far more than simple autocomplete, modern coding assistants can reason about entire codebases, explain complex logic, catch subtle bugs, and even autonomously execute multi-step engineering tasks. They are rapidly becoming an indispensable part of the modern developer’s workflow.

read more...
How To Verify API Connection & Perform HTTP Callout in Salesforce Flow

How To Verify API Connection & Perform HTTP Callout in Salesforce Flow

Traditionally, integrating external systems or fetching real-time data from web services within Salesforce Flows has been a multi-step process involving Apex code or external tools. However, the Spring ’24 Release marks a paradigm shift by introducing a built-in capability to validate API connections and execute HTTP callouts seamlessly, all within the intuitive and user-friendly environment of Salesforce Flow.

read more...

0 Comments

Leave a Reply