|
| 1 | +--- |
| 2 | +title: Advanced Map Widget |
| 3 | +description: Learn how to use the advanced map widget, which allows you to track a things location in real time or during a specific time period. |
| 4 | +author: Benjamin Dannegård |
| 5 | +tags: [Arduino Cloud, Map, GPS, Location] |
| 6 | +--- |
| 7 | + |
| 8 | +The **advanced map widget** is used to track the location of a cloud Thing and draw a path between the different logged points. You can track the data in both real time, select from a specific time period while selecting the variables you want to display. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +This widget can be added onto existing projects (if you are already tracking location), and is particularly interesting to use in projects such as: |
| 13 | +- Weather stations, |
| 14 | +- Environmental data stations, |
| 15 | +- Various science projects where location tracking is needed. |
| 16 | + |
| 17 | +This widget can use variables from **different Things**, so you can monitor data from various devices and plot it all in one place. |
| 18 | + |
| 19 | +For example, you could set up a series of sensors around a city, and measure the CO2 emissions from your phone or laptop in a single chart! |
| 20 | + |
| 21 | +## Hardware & Software Needed |
| 22 | + |
| 23 | +- [Arduino Cloud](https://app.arduino.cc/). |
| 24 | +- Cloud compatible boards, [see full list](https://docs.arduino.cc/arduino-cloud/guides/overview#compatible-hardware). |
| 25 | + |
| 26 | +## Setup & Configuration |
| 27 | + |
| 28 | +To use the advanced map widget, you will need to set up a Thing and a variable that you want to track. This variable needs to be a `location` type. |
| 29 | + |
| 30 | +***If you are unfamiliar with how to set up a Thing and variables, head on over to the [Getting Started with the Arduino Cloud](/arduino-cloud/guides/overview) article.*** |
| 31 | + |
| 32 | +**1.** Head on over to the **"Dashboards"** in the Arduino Cloud, and create a new dashboard (or use an existing dashboard). |
| 33 | + |
| 34 | +**2.** Add a new **"Advanced Map Widget"**, selecting it from the list of available widgets. |
| 35 | + |
| 36 | +**3.** Link the location variable you want to track. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +**4.** After selection, your variables will appear in the right panel, with a number of configuration options. You can for example choose how the track between logged locations will be represented (line, spline, spline area, line area and bar). You can also change the icon of the pin on the map. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +**5.** Click on **"Done"** when finished selecting the variable. If your board is connected and is sending data to the Cloud, you will see the widget's location data update frequently. |
| 45 | + |
| 46 | +## Example Code |
| 47 | + |
| 48 | +The sketch of your project does not require much complexity. In your automatically generated code, simply add the location tracking code inside of the loop. : |
| 49 | + |
| 50 | +```arduino |
| 51 | +
|
| 52 | +``` |
| 53 | + |
| 54 | +## Usage |
| 55 | + |
| 56 | +With the widget set up, let's explore some of its features. |
| 57 | + |
| 58 | +### Value Tracking |
| 59 | + |
| 60 | +Hover over a line to see what the value of a variable was in a specific point in time. In this case, we choose to check only the temperature and the humidity. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +### Specific Time Period |
| 65 | + |
| 66 | +To see a specific time period, click on the calendar icon, where you can select the starting & end time & date. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +As an example, the widget below shows the illuminance (LUX) recorded via the **MKR ENV Shield**, the `light` variable. |
| 71 | + |
| 72 | +Here, we can see that sunset occurred around 18.00 (6PM), and sunrise sometime around 07.00 (7AM). |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +## Limitations |
| 77 | + |
| 78 | +The following variables are not supported in the advanced chart widget. |
| 79 | + |
| 80 | +- |
| 81 | + |
| 82 | +## Summary |
| 83 | + |
| 84 | +The advanced chart widget can be used for **any** project that includes location tracking. It is perfect for scientific projects when monitoring the location of the cloud Thing over time is needed. |
0 commit comments