Category: mobile

INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part III

In continuation with my previous two posts -INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part IINTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part IItoday, 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 the Visualforce page – Mapbox Click hereNow 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 -L.mapbox.featureLayer(geojson).addTo(map);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 clickmyLayer.on(‘click’,function(e){     e.layer.openPopup();}); In my next post, I will explain how you can draw geographic areas inside map using Mapbox. Please provide your feedback....

Read More

INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part II

In continuation to my previous post – INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part I, today, I will play with few attributes from Mapbox to make the map more interactive.Below are the things I will do -I will add different layers and explain how to toggle between layers.I will add scale controlI will add attribution controlI will set the location in the mapTo understand what is layer and how Mapbox works, I would request you to go through the official Mapbox tutorial @ https://www.mapbox.com/guides/how-mapbox-works/. Since from this post, we will go into deep with Mapbox, so it is better to have your basic clear in terms of how Mapbox works and what are the terminologies they use.Let’s go directly to the Visualforce Page Mapbox_2 click hereNow if you open the Visualforce page, you will see – Clicking on Layer icon, you will see -Choosing Sudipta First Map, you will see different map like -Cool!!. There are many more attributes available which you can check from Mapbox Developer resource @ https://www.mapbox.com/mapbox.js/api/v2.2.1/In my next post, I will explain how you can retrieve geographical data from Salesforce object and show them in map with Mapbox API. Sounds interesting, right!! I am working on this now, very soon I will share the information with you all.Till then, if you have any feedback, please share with me....

Read More

INTEGRATE MAPBOX WITH VISUALFORCE TO CREATE BEAUTIFUL MAP – Part I

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 accountFirst 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...

Read More

Salesforce Lightning Component Framework – All you need to know to get started…

Salesforce Lightning Component framework is really awesome. This is the framework which is having Apex on the server-side and JavaScript on the client-side. In this post, I will go through few objects, functions, concepts which will be used very frequently in most of the framework. So let’s get started -Controller -Below is one controller function. It takes three parameters component, event, helper.  Controller functions are used for client-side activities. For example – behavior on button click, form submit etc. can be defined inside a controller function. When calling this functions, as a developer, you don’t need to set these parameters, the framework will populate them with the required values.Helper Functions – This is the place where you will write all your codes which will be shared between components or sub components. If you have something non-trivial logic, you should move that to helper function and let your controller call the helper function. Below is one example where I am retrieving all cases. Now to retrieve cases, I need to write SOQL and that is something happening inside Apex controller (Server-Side). So my helper function getCases is calling the Apex controller’s function and I am calling my handling function (getCases) from controller function. The advantage with this approach is that now I can call getCases whenever required from my controller. I don’t need to repeat the same login every time.Component – Lightning component is...

Read More

Lightning strikes Trailhead – Fun way to learn Lightning

Trailhead is one of my favourite approach to learn new stuffs from Salesforce in an interactive way. I highly recommend employers to encourage all it’s developers and administrators to check trailhead and learn new stuffs.Trailhead brings a new module “Lightning Components” which will help developers to understand lightning concepts. In today’s post, I will review this new module “Lightning Components”.This module comes with 9 different sub modules. All the sub modules are organised so well that at the end of 9th sub module, you will feel really comfortable and at the same time feel the power of lightning which will definitely inspire you to explore the unexplored world.Let’s start discussing each sub module.Sub Module 1: Getting Started with Lightning Components -This is the first sub module which will give you an overview of Lightning Components. By the end of this module you will understand below important concepts -What is all about Lightning Component Framework?Difference between Lightning and VisualforceWhat are the different places where you can use the Lightning Component framework?This sub module mainly tells you how you can go for component based development. Google is having Polymer, Facebook is having React and now Salesforce is also having Lightning Framework – Component based development.After completing the challenge, you can earn 100 points.Sub Module 2: Creating Components -This is the module where you will get familiar with creating lightning components, adding...

Read More
Loading