Logistics planning can be a complicated task. But what if there was a dashboard that showed you where your employees are and how far they are from the office? This could be very useful to calculate emissions per employee. In this blog, we will show you how to link Google Maps to your dashboard and automatically calculate the distance between the employee and the destination.
Dimmensions
First, we need to assign each worker to a city. This is done in the properties of Text 1.
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eaf90_665f2739338f401ffdafb03c_Picture1.png)
Next, we go to UD1, where we enter the locations. These locations will be the workers' destination points. We again put the name of the city in Text 1.
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eafa4_665f274b82b6ba3db3e7c60e_Picture2.png)
Coding
After entering the cities, you need to create two Business Rules that retrieve the Google API and store them in a data table. Call the Business Rules "FXT_TravelDistance_FTD" and "MapPinPoint". The code can be found here.
Data adapters
After creating the Business Rules, you need to create two data adapters: one for the map and the other for the location. You can find the SQL query for da_GoogleData.
here.
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eaf94_665f2770f7155127c4bae6aa_Picture3.png)
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eaf98_665f277a422863a03bcbd3b8_Picture4.png)
BI Viewer
After creating the two data adapters, create a BI Viewer called biv_Map_PD. This BI Viewer will contain the two data adapters. Next, you need to design the BI Viewer. In our BI Viewer, we can set what distance we want to display between the destination and the employees. This is a calculated field.
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eaf9d_665f2787bf3422d9654de50a_Picture5.png)
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750b0676ff20da0eb0db_665f278ba9d11042aa760d20_Picture6.png)
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eafa1_665f2796e6f2866e54beb41a_Picture7.png)
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750a0676ff20da0eaf8b_665f279d422863a03bcbff80_Picture8.png)
Final result
Place the BI Viewer under a dashboard, and this should be your final result:
![](https://cdn.prod.website-files.com/64a2ce29bf31e6caa9d9f19e/66bf750b0676ff20da0eb0d8_665f27a65c0759719b3de88f_Picture9.png)